libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-enum-1.c
blob556ccfdc712a24e1cca33b5a8f03b3b058b5e95d
1 /* Test C23 enumerations with values not representable in int are diagnosed for
2 C11. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c11 -pedantic-errors" } */
6 enum e1 { e1a = -__LONG_LONG_MAX__ - 1 }; /* { dg-error "ISO C restricts enumerator values" } */
8 enum e2 { e2a = __LONG_LONG_MAX__ }; /* { dg-error "ISO C restricts enumerator values" } */
10 enum e3 { e3a = (unsigned int) -1 }; /* { dg-error "ISO C restricts enumerator values" } */
12 enum e4 { e4a = (long long) -__INT_MAX__ - 1, e4b = (unsigned int) __INT_MAX__ };
14 enum e5 { e5a = __INT_MAX__, e5b }; /* { dg-error "ISO C restricts enumerator values" } */