gcc/testsuite/gcc.dg/c11-enum-3.c
raw| 1 | /* Test C23 enumerations with values not representable in int are not diagnosed |
| 2 | for C11 with -pedantic-errors -Wno-c11-c23-compat. */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-std=c11 -pedantic-errors -Wno-c11-c23-compat" } */ |
| 5 | |
| 6 | enum e1 { e1a = -__LONG_LONG_MAX__ - 1 }; |
| 7 | |
| 8 | enum e2 { e2a = __LONG_LONG_MAX__ }; |
| 9 | |
| 10 | enum e3 { e3a = (unsigned int) -1 }; |
| 11 | |
| 12 | enum e4 { e4a = (long long) -__INT_MAX__ - 1, e4b = (unsigned int) __INT_MAX__ }; |
| 13 | |
| 14 | enum e5 { e5a = __INT_MAX__, e5b }; |