]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/cpp/gnu11-elifdef-3.c
1 /* Test #elifdef and #elifndef in GNU11. */
2 /* { dg-do preprocess } */
3 /* { dg-options "-std=gnu11 -pedantic" } */
9 #elifdef A /* { dg-warning "#elifdef before C23 is a GCC extension" } */
14 #error "#elifdef A did not apply"
19 #error "#elifdef B applied"
24 #error "#elifndef A applied"
28 #elifndef B /* { dg-warning "#elifndef before C23 is a GCC extension" } */
33 #error "#elifndef B did not apply"
37 #elifdef A /* { dg-warning "#elifdef before C23 is a GCC extension" } */
39 #error "#elifdef A did not apply"
43 #elifndef B /* { dg-warning "#elifndef before C23 is a GCC extension" } */
45 #error "#elifndef B did not apply"
49 #elifdef A /* { dg-warning "#elifdef before C23 is a GCC extension" } */
53 #elifndef B /* { dg-warning "#elifndef before C23 is a GCC extension" } */
56 /* As with #elif, the syntax of the new directives is relaxed after a
60 #elifdef x * y /* { dg-warning "#elifdef before C23 is a GCC extension" } */
64 #elifndef ! /* { dg-warning "#elifndef before C23 is a GCC extension" } */