9a3933b7308f18c35345de08af33cb075f1b5346
1 /* Copyright (C) 2000, 2001 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
5 /* This tests correct spacing of macro expansion output, as well as
6 the line it falls on. This is quite subtle; it involves newlines
7 within macro arguments becoming spaces, but not if it turns out to
8 not be a macro invocation. Also, multiple macro invocations spread
11 Neil Booth, 1 Dec 2000, 23 Sep 2001. */
15 #define glue(x, y) x ## y
18 /* The correct output is shown here. Note the spaces, and the way
19 everything after the invocation of f appears on the same line.
28 glue (EMPTY
4, 4) EMPTY
;
39 { dg-final { if ![file exists spacing1.i] { return } } }
40 { dg-final { if \{ [grep spacing1.i " 44 ;"] != "" \} \{ } }
41 { dg-final { if \{ [grep spacing1.i "f.*bar"] == "" \} \{ } }
42 { dg-final { if \{ [grep spacing1.i "^bar"] != "" \} \{ } }
43 { dg-final { if \{ [grep spacing1.i "g \"1 2\" bam baz"] != "" \} \{ } }
44 { dg-final { return \} \} \} \} } }
45 { dg-final { fail "spacing1.c: spacing and new-line preservation" } }