[MC] Parse end-of-line for .addrsig & .addrsig_sym

This commit is contained in:
Fangrui Song 2021-03-06 16:26:27 -08:00
parent fd785f98aa
commit e5eb3e3836
2 changed files with 9 additions and 7 deletions

View File

@ -5782,14 +5782,16 @@ bool AsmParser::parseDirectivePrint(SMLoc DirectiveLoc) {
} }
bool AsmParser::parseDirectiveAddrsig() { bool AsmParser::parseDirectiveAddrsig() {
if (parseToken(AsmToken::EndOfStatement))
return true;
getStreamer().emitAddrsig(); getStreamer().emitAddrsig();
return false; return false;
} }
bool AsmParser::parseDirectiveAddrsigSym() { bool AsmParser::parseDirectiveAddrsigSym() {
StringRef Name; StringRef Name;
if (check(parseIdentifier(Name), if (check(parseIdentifier(Name), "expected identifier") ||
"expected identifier in '.addrsig_sym' directive")) parseToken(AsmToken::EndOfStatement))
return true; return true;
MCSymbol *Sym = getContext().getOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().emitAddrsigSym(Sym); getStreamer().emitAddrsigSym(Sym);

View File

@ -71,15 +71,15 @@
// CHECK-NEXT: ] // CHECK-NEXT: ]
// ASM: .addrsig // ASM: .addrsig
// ASM-NEXT: .addrsig_sym g1
.addrsig .addrsig
// ASM: .addrsig_sym g1
.addrsig_sym g1 .addrsig_sym g1
.globl g2 .globl g2
// ASM: .addrsig_sym g3 // ASM: .addrsig_sym g3
// ASM-NEXT: .addrsig_sym local
// ASM-NEXT: .addrsig_sym .Llocal
.addrsig_sym g3 .addrsig_sym g3
// ASM: .addrsig_sym local
.addrsig_sym local .addrsig_sym local
// ASM: .addrsig_sym .Llocal
.addrsig_sym .Llocal .addrsig_sym .Llocal
local: local: