diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 5f92795b49d..03b004ecfac 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -3152,12 +3152,15 @@ bool AsmParser::parseDirectiveMacrosOnOff(StringRef Directive) { } /// parseDirectiveMacro -/// ::= .macro name [parameters] +/// ::= .macro name[,] [parameters] bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc) { StringRef Name; if (parseIdentifier(Name)) return TokError("expected identifier in '.macro' directive"); + if (getLexer().is(AsmToken::Comma)) + Lex(); + MCAsmMacroParameters Parameters; while (getLexer().isNot(AsmToken::EndOfStatement)) { MCAsmMacroParameter Parameter; diff --git a/test/MC/AsmParser/macros-argument-parsing.s b/test/MC/AsmParser/macros-argument-parsing.s new file mode 100644 index 00000000000..097a2702a06 --- /dev/null +++ b/test/MC/AsmParser/macros-argument-parsing.s @@ -0,0 +1,10 @@ +# RUN: llvm-mc -triple i386 -filetype asm -o - %s | FileCheck %s + + .macro it, cond + .endm + + it ne + .long 1 + +# CHECK: .long 1 +