Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/cpp/avoidpaste1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */ | |
2 | |
3 /* { dg-do preprocess } */ | |
4 /* { dg-options "-ansi" } */ | |
5 | |
6 /* This tests that we avoid accidental pasting only before and after | |
7 macros and arguments, and not when the tokens are already pasted | |
8 in the souce file (e.g. "::" in a C source file). | |
9 | |
10 Neil Booth, 28 Jan 2001. */ | |
11 | |
12 #define f(x) x | |
13 #define g | |
14 #define tricky 1.0e ## -1 | |
15 | |
16 /* This should preprocess as | |
17 | |
18 :: : : : : :^: 1.0e- 1 | |
19 : : : .. . 0 0 . | |
20 | |
21 It relies on the fact that even when preprocessing C we bother to separate | |
22 the colons of C++'s :: operator. If we confine this behavior to C++ | |
23 in future, this test needs to change. */ | |
24 | |
25 :: :g: :f(): :f(^): tricky | |
26 :f(:): .. .__INCLUDE_LEVEL__ __INCLUDE_LEVEL__. /* Check builtins, too. */ | |
27 | |
28 /* { dg-final { scan-file avoidpaste1.i ":: : : : : :\\^: 1.0e- 1" } } | |
29 { dg-final { scan-file avoidpaste1.i ": : : \\\.\\\. \\\. 0 0 \\\." } } */ |