xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/info-macros.c (revision a5a4af3bd380a7b58b758d9b311cef9f7c34aeb4)
1 #ifdef DEF_MACROS
2 
3   #ifdef ONE
4     #ifdef FOO
5     #undef FOO
6     #endif
7     #define FOO "hello"
8   #else
9     #undef FOO
10   #endif
11 
12 
13   #ifdef TWO
14     #ifdef FOO
15     #undef FOO
16     #endif
17     #define FOO " "
18   #endif
19 
20   #ifdef THREE
21     #ifdef FOO
22     #undef FOO
23     #endif
24     #define FOO "world"
25   #endif
26 
27   #ifdef FOUR
28     #ifdef FOO
29     #undef FOO
30     #endif
31     #define FOO(a) foo = a
32   #endif
33 #else
34 
main(int argc,const char ** argv)35 int main (int argc, const char **argv)
36 {
37   char *foo;
38 
39   #define DEF_MACROS
40   #define ONE
41   #include "info-macros.c"
42   foo = FOO;
43 
44   #define TWO
45   #include "info-macros.c"
46   foo = FOO;
47 
48   #define THREE
49   #include "info-macros.c"
50   foo = FOO;
51 
52   #undef THREE
53   #include "info-macros.c"
54   foo = FOO;
55 
56   #undef TWO
57   #include "info-macros.c"
58   foo = FOO;
59 
60   #undef ONE
61   #include "info-macros.c"
62   foo = (char *)0;
63 
64   #define FOUR
65   #include "info-macros.c"
66   FOO ("the end.");
67 
68   return 0;
69 }
70 #endif
71 
72