1 /* { dg-do run } */
2
3 /* Test that, when a macro expansion spills into the source file, we
4 expand macros we suck in from there, as the standard clearly states
5 they are not nested.
6
7 Submitter: Neil Booth, with minor modifications to the originals. 3
8 Dec 2000.
9 Source: PR 962 and Thomas Pornin. */
10
11 extern void abort (void);
12 int e = 10, f = 100;
13
14 #define e(n) 4 + n
15 #define X e
16 #define f(x) x
17 #define h(x) x + f
18
19 int
main()20 main ()
21 {
22 if (X(X) != 14) /* Should expand to "4 + e". */
23 abort ();
24
25 if (X(X(f)) != 108) /* Should expand to "4 + 4 + f". */
26 abort ();
27
28 if (h(e)(h(e)) != 120) /* Should expand to "e + e + f". */
29 abort ();
30
31 return 0;
32 }
33