From 83bd8281e556a42b47e5b136691128236d8d1e2f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 25 May 2009 17:16:10 +0000 Subject: Fix a couple of bugs: 1. When we accept "#garbage" in asm-with-cpp mode, change the token kind of the # to unknown so that the preprocessor won't try to process it as a real #. This fixes a crash on the attached example 2. Fix macro definition extents processing to handle #foo at the end of a macro to say the definition ends with the foo, not the #. This is a follow-on fix to r72283, and rdar://6916026 llvm-svn: 72388 --- clang/test/Preprocessor/assembler-with-cpp.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'clang/test/Preprocessor/assembler-with-cpp.c') diff --git a/clang/test/Preprocessor/assembler-with-cpp.c b/clang/test/Preprocessor/assembler-with-cpp.c index 00080cce9b3..2e84ed1a6b0 100644 --- a/clang/test/Preprocessor/assembler-with-cpp.c +++ b/clang/test/Preprocessor/assembler-with-cpp.c @@ -58,14 +58,20 @@ // #define T6() T6 #nostring #define T7(x) T7 #x -T6() -T7(foo) -// RUN: grep 'T6 #nostring' %t && -// RUN: grep 'T7 "foo"' %t && +8: T6() +9: T7(foo) +// RUN: grep '8: T6 #nostring' %t && +// RUN: grep '9: T7 "foo"' %t && // Concatenation with period doesn't leave a space -// RUN: grep -F '.T8' %t && +// RUN: grep -F '10: .T8' %t && #define T8(A,B) A ## B -T8(.,T8) +10: T8(.,T8) + + +// This should not crash. +// RUN: grep '11: #0' %t && +#define T11(a) #0 +11: T11(b) // RUN: true -- cgit v1.2.3