1 /* Test for integer promotion rules: extended to long long by C99. */
2 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3 /* { dg-do compile } */
4 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
8 #define CHECK(T1, T2, TC) \
13 __typeof__(a+b) *d = 0; \
23 CHECK(unsigned int, unsigned int, unsigned int);
24 CHECK(long, long, long);
25 CHECK(unsigned long, unsigned long, unsigned long);
26 CHECK(long long, long long, long long);
27 CHECK(unsigned long long, unsigned long long, unsigned long long);
29 CHECK(int, long, long);
30 CHECK(int, long long, long long);
31 CHECK(long, int, long);
32 CHECK(long, long long, long long);
33 CHECK(long long, int, long long);
34 CHECK(long long, long, long long);
36 CHECK(unsigned int, unsigned long, unsigned long);
37 CHECK(unsigned int, unsigned long long, unsigned long long);
38 CHECK(unsigned long, unsigned int, unsigned long);
39 CHECK(unsigned long, unsigned long long, unsigned long long);
40 CHECK(unsigned long long, unsigned int, unsigned long long);
41 CHECK(unsigned long long, unsigned long, unsigned long long);
42 /* Unsigned of greater or equal rank. */
43 CHECK(int, unsigned int, unsigned int);
44 CHECK(int, unsigned long, unsigned long);
45 CHECK(int, unsigned long long, unsigned long long);
46 CHECK(unsigned int, int, unsigned int);
47 CHECK(long, unsigned long, unsigned long);
48 CHECK(long, unsigned long long, unsigned long long);
49 CHECK(unsigned long, int, unsigned long);
50 CHECK(unsigned long, long, unsigned long);
51 CHECK(long long, unsigned long long, unsigned long long);
52 CHECK(unsigned long long, int, unsigned long long);
53 CHECK(unsigned long long, long, unsigned long long);
54 CHECK(unsigned long long, long long, unsigned long long);
55 /* Signed of greater rank. */
56 #if LONG_MAX >= UINT_MAX
57 CHECK(unsigned int, long, long);
58 CHECK(long, unsigned int, long);
60 CHECK(unsigned int, long, unsigned long);
61 CHECK(long, unsigned int, unsigned long);
63 #if LLONG_MAX >= UINT_MAX
64 CHECK(unsigned int, long long, long long);
65 CHECK(long long, unsigned int, long long);
67 CHECK(unsigned int, long long, unsigned long long);
68 CHECK(long long, unsigned int, unsigned long long);
70 #if LLONG_MAX >= ULONG_MAX
71 CHECK(unsigned long, long long, long long);
72 CHECK(long long, unsigned long, long long);
74 CHECK(unsigned long, long long, unsigned long long);
75 CHECK(long long, unsigned long, unsigned long long);