summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-08-21 17:12:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-08-21 17:12:05 +0000
commitaf6da83a2c7e66f3dac0ab1cb746dea8c1cc6250 (patch)
tree2d05fba8c6376d38c87bbd6dc039d1e850b7963f
parent5e80ced3f68a2bf1dfe5c6bfb0eb23cd015ac15e (diff)
downloadbcm5719-llvm-af6da83a2c7e66f3dac0ab1cb746dea8c1cc6250.tar.gz
bcm5719-llvm-af6da83a2c7e66f3dac0ab1cb746dea8c1cc6250.zip
Make the wording in of the "expected identifier" error in the .macro directive
consistent with the other "expected identifier" errors. Extracted from the Andy/PaX patch. I added the test. llvm-svn: 162291
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp4
-rw-r--r--llvm/test/MC/AsmParser/bad-macro.s9
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index fcd5b15f8fb..f7236627d5d 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -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))
diff --git a/llvm/test/MC/AsmParser/bad-macro.s b/llvm/test/MC/AsmParser/bad-macro.s
new file mode 100644
index 00000000000..313607b7782
--- /dev/null
+++ b/llvm/test/MC/AsmParser/bad-macro.s
@@ -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
OpenPOWER on IntegriCloud