From 995544ef901f70589025c278e112547966a1df09 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 18 Jun 2013 21:33:38 +0000 Subject: [PATCH] Make sure the assembler-with-cpp hack for "#" works with multiple "#"s in succession. Fixes PR16363. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184240 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/PPDirectives.cpp | 2 ++ test/Preprocessor/assembler-with-cpp.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 3e3312a926..c25e317b42 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -1920,6 +1920,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 -- 2.40.0