]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/pr30260.c
replace ISL with isl
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr30260.c
1 /* PR 30260 */
2 /* { dg-do link } */
3 /* { dg-options "-pedantic -O" } */
4 #include <limits.h>
5
6 void link_error (void);
7
8 enum A {
9 A1 = 0,
10 A2 = A1 - 1
11 };
12 enum B {
13 B1 = 0u,
14 B2 = B1 - 1 /* { dg-bogus "ISO C restricts enumerator values to range of 'int'" } */
15 };
16 int main(void)
17 {
18 enum A a = -1;
19 enum B b = -1;
20
21 if (!(a < 0))
22 link_error ();
23 if (!(A2 < 0))
24 link_error ();
25 if (!(b < 0))
26 link_error ();
27 if (!(B2 < 0))
28 link_error ();
29
30 return 0;
31 }
32
33 enum E1 { e10 = INT_MAX, e11 }; /* { dg-error "overflow in enumeration values" } */
34 enum E2 { e20 = (unsigned) INT_MAX, e21 }; /* { dg-error "overflow in enumeration values" } */