Don't accept '$' in identifiers in assembler-with-cpp mode.

llvm-svn: 67013
This commit is contained in:
Daniel Dunbar 2009-03-15 00:11:28 +00:00
parent 0422efc994
commit 36a3e92521
2 changed files with 10 additions and 1 deletions

View File

@ -644,7 +644,9 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
if (!Options.ObjC1 && LangStd < lang_gnu_START)
Options.Blocks = 0;
Options.DollarIdents = 1; // FIXME: Really a target property.
// Never accept '$' in identifiers when preprocessing assembler.
if (LK != langkind_asm_cpp)
Options.DollarIdents = 1; // FIXME: Really a target property.
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
Options.Microsoft = MSExtensions;

View File

@ -0,0 +1,7 @@
// RUN: clang -dump-tokens %s &> %t &&
// RUN: grep "identifier '\$A'" %t
// RUN: clang -dump-tokens -x assembler-with-cpp %s &> %t &&
// RUN: grep "identifier 'A'" %t
// PR3808
$A