Skip to content

Commit

Permalink
Make the wording in of the "expected identifier" error in the .macro …
Browse files Browse the repository at this point in the history
…directive

consistent with the other "expected identifier" errors.
Extracted from the Andy/PaX patch. I added the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162291 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Aug 21, 2012
1 parent 578d5f4 commit d7ae0f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MC/MCParser/AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3071,14 +3071,14 @@ bool GenericAsmParser::ParseDirectiveMacro(StringRef Directive,
SMLoc DirectiveLoc) {
StringRef Name;
if (getParser().ParseIdentifier(Name))
return TokError("expected identifier in directive");
return TokError("expected identifier in '.macro' directive");

MacroParameters Parameters;
if (getLexer().isNot(AsmToken::EndOfStatement)) {
for (;;) {
MacroParameter Parameter;
if (getParser().ParseIdentifier(Parameter))
return TokError("expected identifier in directive");
return TokError("expected identifier in '.macro' directive");
Parameters.push_back(Parameter);

if (getLexer().isNot(AsmToken::Comma))
Expand Down
9 changes: 9 additions & 0 deletions test/MC/AsmParser/bad-macro.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: not llvm-mc -triple x86_64-apple-darwin10 %s 2>&1 | FileCheck %s

.macro 23

// CHECK: expected identifier in '.macro' directive

.macro abc 33

// CHECK: expected identifier in '.macro' directive

0 comments on commit d7ae0f1

Please sign in to comment.