1 /* Copyright (C) 2001 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
5 /* This tests that we avoid accidental pasting, as well as gratuitous
6 space insertion, in various nasty places _inside_ a macro's
7 replacement list: on either side of a paste, and on either side of
8 an argument. It also tests that we don't pass empty macro leading
9 whitespace to the next line - this problem use to break Emacs
12 Neil Booth, 1 Feb 2001. */
14 #define EMPTY_WITH_LEADING_SPACE
15 #define f(x, y) :x: -y##> -##y>
16 #define g(x, y) :x: :y##2 2##y:
18 /* This should preprocess as
23 We used to get a space at the start of the line. */
25 EMPTY_WITH_LEADING_SPACE
30 { dg-final { if ![file exists avoidpaste2.i] { return } } }
31 { dg-final { if { [grep avoidpaste2.i "^: : : - > - >"] != "" } \{ } }
32 { dg-final { if { [grep avoidpaste2.i "^:2: :22 22:"] != "" } \{ } }
33 { dg-final { return \} \} } }
34 { dg-final { fail "avoidpaste2.c: paste avoidance" } }