2018-01-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / undef2.c
blob189a72dd9c2d956d8f85d49caafa08e9b7daacf7
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__