Fix test/Preprocessor/macro_paste_spacing.c

llvm-svn: 38734
This commit is contained in:
Chris Lattner 2006-07-19 05:45:55 +00:00
parent 01ecf835c2
commit e8dcfef324
2 changed files with 12 additions and 1 deletions

View File

@ -372,6 +372,10 @@ void MacroExpander::Lex(LexerToken &Tok) {
return PPCache.Lex(Tok);
}
// If this is the first token of the expanded result, we inherit spacing
// properties later.
bool isFirstToken = CurToken == 0;
// Get the next token to return.
Tok = (*MacroTokens)[CurToken++];
@ -395,7 +399,7 @@ void MacroExpander::Lex(LexerToken &Tok) {
// If this is the first token, set the lexical properties of the token to
// match the lexical properties of the macro identifier.
if (CurToken == 1) {
if (isFirstToken) {
Tok.SetFlagValue(LexerToken::StartOfLine , AtStartOfLine);
Tok.SetFlagValue(LexerToken::LeadingSpace, HasLeadingSpace);
}

View File

@ -0,0 +1,7 @@
// RUN: clang %s -E | grep "^xy$"
#define A x ## y
blah
A