1 /* Copyright (C) 2000 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
5 /* Tests tradcpp0 with defined. The defined operator in traditional C
6 works just the same as the defined operator in Standard C. */
8 /* Source: Zack Weinberg, glibc, Neil Booth 11 Dec 2000. */
11 #error REGPARMS should not be defined
16 #error REGPARMS should be defined
19 #define defined /* { dg-error "defined" } */
21 /* No diagnostics, though you could argue there should be. */
23 #error defined is defined!
26 #define is_Z_defined defined Z
29 #error Z is not defined
32 /* The behavior of "defined" when it comes from a macro expansion is
35 #error Macro expanding into defined operator test 1
45 #error Macro expanding into defined operator test 2
51 /* Do all the tests over again with the () form of defined. */
53 /* No diagnostics, though you could argue there should be. */
55 #error defined is defined!
58 #define is_Z_defined defined ( Z )
61 #error Z is not defined
64 /* The behavior of "defined" when it comes from a macro expansion is
67 #error Macro expanding into defined operator test 1
77 #error Macro expanding into defined operator test 2