1 /* Copyright (C) 2000 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
4 /* { dg-options "-traditional" } */
6 /* Tests tradcpp0 with defined. The defined operator in traditional C
7 works just the same as the defined operator in Standard C. */
9 /* Source: Zack Weinberg, glibc, Neil Booth 11 Dec 2000. */
12 #error REGPARMS should not be defined
17 #error REGPARMS should be defined
20 #define defined /* { dg-error "defined" } */
22 /* No diagnostics, though you could argue there should be. */
24 #error defined is defined!
27 #define is_Z_defined defined Z
30 #error Z is not defined
33 /* The behaviour of "defined" when it comes from a macro expansion is
36 #error Macro expanding into defined operator test 1
46 #error Macro expanding into defined operator test 2
52 /* Do all the tests over again with the () form of defined. */
54 /* No diagnostics, though you could argue there should be. */
56 #error defined is defined!
59 #define is_Z_defined defined ( Z )
62 #error Z is not defined
65 /* The behaviour of "defined" when it comes from a macro expansion is
68 #error Macro expanding into defined operator test 1
78 #error Macro expanding into defined operator test 2