diff --git a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp index f5a3d4452c77..d2ce97abdd48 100644 --- a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -298,6 +298,7 @@ void splitAndWriteThinLTOBitcode( return false; })); StripDebugInfo(*MergedM); + MergedM->setModuleInlineAsm(""); for (Function &F : *MergedM) if (!F.isDeclaration()) { diff --git a/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll b/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll new file mode 100644 index 000000000000..15e47785cbe2 --- /dev/null +++ b/test/Transforms/ThinLTOBitcodeWriter/module-asm.ll @@ -0,0 +1,12 @@ +; RUN: opt -thinlto-bc -o %t %s +; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s +; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s + +target triple = "x86_64-unknown-linux-gnu" + +@g = constant i32 0, !type !0 +!0 = !{i32 0, !"typeid"} + +; M0: module asm "ret" +; M1-NOT: module asm +module asm "ret"