diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-14 18:19:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-14 18:19:37 +0000 |
commit | 848fa212e8a5e966f140b2ccc24f6a0815846fa2 (patch) | |
tree | e6fb56e4cdbb50a5f99c9d3ddc99e179a33b8244 /clang/test/Preprocessor | |
parent | 5e8515832166d5df2368bb3758a83494630b689b (diff) | |
download | bcm5719-llvm-848fa212e8a5e966f140b2ccc24f6a0815846fa2.tar.gz bcm5719-llvm-848fa212e8a5e966f140b2ccc24f6a0815846fa2.zip |
revert r133003 and fix the bug properly: the issue was that ## in a token
lexer is not a paste operator, it is a normal token. This fixes a conformance
issue shown here:
http://p99.gforge.inria.fr/c99-conformance/c99-conformance-clang-2.9.html
and it defines away the crash from before.
llvm-svn: 133005
Diffstat (limited to 'clang/test/Preprocessor')
-rw-r--r-- | clang/test/Preprocessor/macro_paste_bad.c | 7 | ||||
-rw-r--r-- | clang/test/Preprocessor/macro_paste_simple.c | 13 |
2 files changed, 11 insertions, 9 deletions
diff --git a/clang/test/Preprocessor/macro_paste_bad.c b/clang/test/Preprocessor/macro_paste_bad.c index 1c0b74ba298..0a028a44686 100644 --- a/clang/test/Preprocessor/macro_paste_bad.c +++ b/clang/test/Preprocessor/macro_paste_bad.c @@ -32,10 +32,3 @@ XX // expected-error {{attempt to use a poisoned identifier}} #define VA __VA_ ## ARGS__ int VA; // expected-warning {{__VA_ARGS__ can only appear in the expansion of a C99 variadic macro}} - -// PR9981 -#define M1(A) A -#define M2(X) -M1(M2(##)) // expected-error {{pasting formed '()', an invalid preprocessing token}} - - diff --git a/clang/test/Preprocessor/macro_paste_simple.c b/clang/test/Preprocessor/macro_paste_simple.c index 563d7f44958..0e62ba46dc9 100644 --- a/clang/test/Preprocessor/macro_paste_simple.c +++ b/clang/test/Preprocessor/macro_paste_simple.c @@ -1,5 +1,14 @@ -// RUN: %clang_cc1 %s -E | grep "barbaz123" +// RUN: %clang_cc1 %s -E | FileCheck %s #define FOO bar ## baz ## 123 -FOO +// CHECK: A: barbaz123 +A: FOO + +// PR9981 +#define M1(A) A +#define M2(X) X +B: M1(M2(##)) + +// CHECK: B: ## + |