summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-07-12 20:58:28 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-07-12 20:58:28 +0000
commit82a5430ee824bbe3a49360db41d53d316f9fd016 (patch)
tree0f01fc608feaf1c456aad3905bb56b4477c8d171
parent20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8 (diff)
downloadclang-82a5430ee824bbe3a49360db41d53d316f9fd016.tar.gz
clang-82a5430ee824bbe3a49360db41d53d316f9fd016.tar.bz2
clang-82a5430ee824bbe3a49360db41d53d316f9fd016.tar.xz
Make sure the assembler-with-cpp hack for "#" works with multiple "#"s in
succession. Fixes PR16363. Merged from r184240 Author: Eli Friedman <eli.friedman@gmail.com> Date: Tue Jun 18 21:33:38 2013 +0000 git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@186204 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Lex/PPDirectives.cpp2
-rw-r--r--test/Preprocessor/assembler-with-cpp.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 50a0cb55f7..71483b80c2 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -1896,6 +1896,8 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) {
// confused.
if (getLangOpts().AsmPreprocessor && Tok.isNot(tok::eod)) {
LastTok.setKind(tok::unknown);
+ MI->AddTokenToBody(LastTok);
+ continue;
} else {
Diag(Tok, diag::err_pp_stringize_not_parameter);
ReleaseMacroInfo(MI);
diff --git a/test/Preprocessor/assembler-with-cpp.c b/test/Preprocessor/assembler-with-cpp.c
index a9c42940a3..65be564786 100644
--- a/test/Preprocessor/assembler-with-cpp.c
+++ b/test/Preprocessor/assembler-with-cpp.c
@@ -77,3 +77,7 @@
// rdar://8823139
# ##
// CHECK-Identifiers-False: # ##
+
+#define X(a) # # # 1
+X(1)
+// CHECK-Identifiers-False: # # # 1