diff --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp --- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -74,7 +74,7 @@ if (isa(&ExportGV)) { // Create a local alias with the original name to avoid breaking // references from inline assembly. - std::string Alias = ".set " + OldName + "," + NewName + "\n"; + std::string Alias = ".set \"" + OldName + "\",\"" + NewName + "\"\n"; ExportM.appendModuleInlineAsm(Alias); } } diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll @@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-gnu" -; CHECK: module asm ".set a,a.[[HASH:[0-9a-f]+]]" +; CHECK: module asm ".set \22a\22,\22a.[[HASH:[0-9a-f]+]]\22" define void @b() { %f = alloca void ()*, align 8