annotate gcc/testsuite/gcc.dg/cpp/avoidpaste2.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* { dg-do preprocess } */
kono
parents:
diff changeset
4 /* { dg-options "-ansi" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* This tests that we avoid accidental pasting, as well as gratuitous
kono
parents:
diff changeset
7 space insertion, in various nasty places _inside_ a macro's
kono
parents:
diff changeset
8 replacement list: on either side of a paste, and on either side of
kono
parents:
diff changeset
9 an argument. It also tests that we don't pass empty macro leading
kono
parents:
diff changeset
10 whitespace to the next line - this problem use to break Emacs
kono
parents:
diff changeset
11 preprocessor abuse.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 Neil Booth, 1 Feb 2001. */
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 #define EMPTY_WITH_LEADING_SPACE
kono
parents:
diff changeset
16 #define f(x, y) :x: -y##> -##y>
kono
parents:
diff changeset
17 #define g(x, y) :x: :y##2 2##y:
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 /* This should preprocess as
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 : : : - > - >
kono
parents:
diff changeset
22 :2: :22 22:
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 We used to get a space at the start of the line. */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 EMPTY_WITH_LEADING_SPACE
kono
parents:
diff changeset
27 f(:,)
kono
parents:
diff changeset
28 g(2, 2)
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* { dg-final { scan-file avoidpaste2.i "(^|\\n): : : - > - >" } }
kono
parents:
diff changeset
31 { dg-final { scan-file avoidpaste2.i "(^|\\n):2: :22 22:" } } */