Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / builtin-types-compatible-p.c
bloba998ef776f7d422cbaad19eeaf341ccfd1a4c8ef
1 int i;
2 double d;
4 /* Make sure we return a constant. */
5 float rootbeer[__builtin_types_compatible_p (int, typeof(i))];
7 typedef enum { hot, dog, poo, bear } dingos;
8 typedef enum { janette, laura, amanda } cranberry;
10 typedef float same1;
11 typedef float same2;
13 int main (void);
15 int main (void)
17 /* Compatible types. */
18 if (!(__builtin_types_compatible_p (int, const int)
19 && __builtin_types_compatible_p (typeof (hot), int)
20 && __builtin_types_compatible_p (typeof (hot), typeof (laura))
21 && __builtin_types_compatible_p (int[5], int[])
22 && __builtin_types_compatible_p (same1, same2)))
23 abort ();
25 /* Incompatible types. */
26 if (__builtin_types_compatible_p (char *, int)
27 || __builtin_types_compatible_p (char *, const char *)
28 || __builtin_types_compatible_p (long double, double)
29 || __builtin_types_compatible_p (typeof (i), typeof (d))
30 || __builtin_types_compatible_p (typeof (dingos), typeof (cranberry))
31 || __builtin_types_compatible_p (char, int)
32 || __builtin_types_compatible_p (char *, char **))
33 abort ();
34 exit (0);