* gcc.dg/predict-12.c: New testcase.
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / undef2.c
blob5614e039b22b2fea9daab2b97510748cf93c3bdc
1 /* C99 6.10.8 para 4: None of [the predefined macro names] shall be
2 the subject of a #define or an #undef preprocessing directive. */
4 /* { dg-do preprocess } */
6 #undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */
7 #undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */
8 #undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */
9 #undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */
10 #undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */
12 /* These should be protected from #undef, but aren't, because they
13 are set with normal #define commands - and on top of that, some
14 of them are library properties, outside our control. To consider:
15 warn about undefining/redefining any identifier beginning with
16 __STDC_ .
18 __STDC_HOSTED__
19 __STDC_VERSION__
20 __STDC_IEC_559__
21 __STDC_IEC_559_COMPLEX__
22 __STDC_ISO_10646__