OSDN Git Service

* gcc.dg/cpp/avoidpaste1.c: Update.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cpp / avoidpaste1.c
1 /* Copyright (C) 2001 Free Software Foundation, Inc.  */
2
3 /* { dg-do preprocess } */
4
5 /* This tests that we avoid accidental pasting only before and after
6    macros and arguments, and not when the tokens are already pasted
7    in the souce file (e.g. "::" in a C source file).
8
9    Neil Booth, 28 Jan 2001.  */
10
11 #define f(x) x
12 #define g
13 #define tricky 1.0e ## -1
14
15 /* This should preprocess as
16
17 :: : : : : :^: 1.0e- 1
18 : : : .. . 0 0 .
19
20 It relies on the fact that even when preprocessing C we bother to separate
21 the colons of C++'s :: operator.  If we confine this behaviour to C++
22 in future, this test needs to change.  */
23
24 :: :g: :f(): :f(^): tricky
25 :f(:): .. .__INCLUDE_LEVEL__ __INCLUDE_LEVEL__. /* Check builtins, too.  */
26
27 /*
28    { dg-final { if ![file exists avoidpaste1.i] { return }                } }
29    { dg-final { if { [grep avoidpaste1.i ":: : : : : :\\^: 1.0e- 1"] != "" } \{   } }
30    { dg-final { if { [grep avoidpaste1.i ": : : \\\.\\\. \\\. 0 0 \\\."] != "" } \{  } }
31    { dg-final { return \} \}                                              } }
32    { dg-final { fail "avoidpaste1.c: paste avoidance"                     } }
33 */