PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / pr30260.c
blobe04a8beb64201e78723b0ceaa4f3e12467f2ff67
1 /* PR 30260 */
2 /* { dg-do link } */
3 /* { dg-options "-pedantic -O" } */
4 #include <limits.h>
6 void link_error (void);
8 enum A {
9 A1 = 0,
10 A2 = A1 - 1
12 enum B {
13 B1 = 0u,
14 B2 = B1 - 1 /* { dg-bogus "ISO C restricts enumerator values to range of 'int'" } */
16 int main(void)
18 enum A a = -1;
19 enum B b = -1;
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 ();
30 return 0;
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" } */