diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp --- a/llvm/lib/MC/MCAsmInfo.cpp +++ b/llvm/lib/MC/MCAsmInfo.cpp @@ -114,7 +114,10 @@ } bool MCAsmInfo::isAcceptableChar(char C) const { - return isAlnum(C) || C == '_' || C == '$' || C == '.' || C == '@'; + if (C == '@') + return doesAllowAtInName(); + + return isAlnum(C) || C == '_' || C == '$' || C == '.'; } bool MCAsmInfo::isValidUnquotedName(StringRef Name) const { diff --git a/llvm/test/CodeGen/AArch64/ehcontguard.ll b/llvm/test/CodeGen/AArch64/ehcontguard.ll --- a/llvm/test/CodeGen/AArch64/ehcontguard.ll +++ b/llvm/test/CodeGen/AArch64/ehcontguard.ll @@ -1,7 +1,7 @@ ; RUN: llc < %s -mtriple=aarch64-windows | FileCheck %s ; EHCont Guard is currently only available on Windows -; CHECK: .set @feat.00, 16384 +; CHECK: .set "@feat.00", 16384 ; CHECK: .section .gehcont$y diff --git a/llvm/test/CodeGen/AArch64/win_cst_pool.ll b/llvm/test/CodeGen/AArch64/win_cst_pool.ll --- a/llvm/test/CodeGen/AArch64/win_cst_pool.ll +++ b/llvm/test/CodeGen/AArch64/win_cst_pool.ll @@ -4,14 +4,14 @@ define double @double() { ret double 0x2000000000800001 } -; CHECK: .globl __real@2000000000800001 -; CHECK-NEXT: .section .rdata,"dr",discard,__real@2000000000800001 +; CHECK: .globl "__real@2000000000800001" +; CHECK-NEXT: .section .rdata,"dr",discard,"__real@2000000000800001" ; CHECK-NEXT: .p2align 3 -; CHECK-NEXT: __real@2000000000800001: +; CHECK-NEXT: "__real@2000000000800001": ; CHECK-NEXT: .xword 0x2000000000800001 ; CHECK: double: -; CHECK: adrp x8, __real@2000000000800001 -; CHECK-NEXT: ldr d0, [x8, :lo12:__real@2000000000800001] +; CHECK: adrp x8, "__real@2000000000800001" +; CHECK-NEXT: ldr d0, [x8, :lo12:"__real@2000000000800001"] ; CHECK-NEXT: ret ; MINGW: .section .rdata,"dr" diff --git a/llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp b/llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp --- a/llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp +++ b/llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp @@ -554,9 +554,11 @@ } TEST_F(SystemZAsmLexerLinux, CheckPrintAcceptableSymbol) { - std::string AsmStr = "ab13_$.@"; + std::string AsmStr = "ab13_$."; EXPECT_EQ(true, MAI->isValidUnquotedName(AsmStr)); - AsmStr += "#"; + AsmStr = "ab13_$.@"; + EXPECT_EQ(false, MAI->isValidUnquotedName(AsmStr)); + AsmStr = "ab13_$.#"; EXPECT_EQ(false, MAI->isValidUnquotedName(AsmStr)); }