1 /* Test for integer promotion rules: C90 subset of types. */
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
8 #define CHECK(T1, T2, TC) \
13 __typeof__(a+b) *d = 0; \
21 /* One type is unsigned long. */
22 CHECK(unsigned long, unsigned long, unsigned long);
23 CHECK(unsigned int, unsigned long, unsigned long);
24 CHECK(unsigned long, unsigned int, unsigned long);
25 CHECK(int, unsigned long, unsigned long);
26 CHECK(long, unsigned long, unsigned long);
27 CHECK(unsigned long, int, unsigned long);
28 CHECK(unsigned long, long, unsigned long);
29 /* long and unsigned int. */
30 #if LONG_MAX >= UINT_MAX
31 CHECK(unsigned int, long, long);
32 CHECK(long, unsigned int, long);
34 CHECK(unsigned int, long, unsigned long);
35 CHECK(long, unsigned int, unsigned long);
37 /* One type is long. */
38 CHECK(long, long, long);
39 CHECK(int, long, long);
40 CHECK(long, int, long);
41 /* One type is unsigned int. */
42 CHECK(unsigned int, unsigned int, unsigned int);
43 CHECK(int, unsigned int, unsigned int);
44 CHECK(unsigned int, int, unsigned int);