Index: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp =================================================================== --- lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -5162,15 +5162,9 @@ /// parseDirectiveArchExtension /// ::= .arch_extension [no]feature bool AArch64AsmParser::parseDirectiveArchExtension(SMLoc L) { - MCAsmParser &Parser = getParser(); - - if (getLexer().isNot(AsmToken::Identifier)) - return Error(getLexer().getLoc(), "expected architecture extension name"); + SMLoc ExtLoc = getLoc(); - const AsmToken &Tok = Parser.getTok(); - StringRef Name = Tok.getString(); - SMLoc ExtLoc = Tok.getLoc(); - Lex(); + StringRef Name = getParser().parseStringToEndOfStatement().trim(); if (parseToken(AsmToken::EndOfStatement, "unexpected token in '.arch_extension' directive")) Index: test/MC/AArch64/directive-arch_extension-negative.s =================================================================== --- /dev/null +++ test/MC/AArch64/directive-arch_extension-negative.s @@ -0,0 +1,10 @@ +// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s + + .arch_extension axp64 +# CHECK: error: unknown architectural extension: axp64 +# CHECK-NEXT: .arch_extension axp64 + + .arch_extension notlb-rmi + tlbi vmalle1os +# CHECK: error: TLBI VMALLE1OS requires tlb-rmi +# CHECK-NEXT: tlbi vmalle1os Index: test/MC/AArch64/directive-arch_extension.s =================================================================== --- /dev/null +++ test/MC/AArch64/directive-arch_extension.s @@ -0,0 +1,5 @@ +// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s | FileCheck %s + + .arch_extension tlb-rmi + tlbi vmalle1os +// CHECK: tlbi vmalle1os