1; REQUIRES: x86-registered-target 2 3; check the -lto-embed-bitcode=post-thinlto-merge does not perform optimizations 4; we expect 't1' - i.e start-lib1.ll's products - have both foo and bar defined, 5; but the bar call is still made from foo. 6; RUN: opt -module-summary %p/Inputs/start-lib1.ll -o %t1.bc 7; RUN: opt -module-summary %p/Inputs/start-lib2.ll -o %t2.bc 8; RUN: llvm-lto -thinlto -o %t.o %t1.bc %t2.bc 9 10; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t.o -x ir %t1.bc -c -fthinlto-index=%t.o.thinlto.bc -mllvm -lto-embed-bitcode=post-merge-pre-opt 11; RUN: llvm-readelf -S %t.o | FileCheck %s --check-prefixes=CHECK-ELF,CHECK-CMD 12; RUN: llvm-objcopy --dump-section=.llvmbc=%t-embedded.bc %t.o /dev/null 13; RUN: llvm-dis %t-embedded.bc -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOOPT 14 15; For the optimized case, we expect the inlining of foo into bar to happen. 16; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t.o -x ir %t1.bc -c -fthinlto-index=%t.o.thinlto.bc -mllvm -lto-embed-bitcode=optimized 17; RUN: llvm-readelf -S %t.o | FileCheck %s --check-prefixes=CHECK-ELF,CHECK-NO-CMD 18; RUN: llvm-objcopy --dump-section=.llvmbc=%t-embedded.bc %t.o /dev/null 19; RUN: llvm-dis %t-embedded.bc -o - | FileCheck %s --check-prefixes=CHECK,CHECK-OPT 20 21; CHECK-ELF: .text PROGBITS 0000000000000000 [[#%x,OFF:]] [[#%x,SIZE:]] 00 AX 0 22; CHECK-ELF-NEXT: .llvmbc PROGBITS 0000000000000000 [[#%x,OFF:]] [[#%x,SIZE:]] 00 0 23; CHECK-ELF-CMD: .llvmcmd 24; CHECK-ELF-NO-CMD-NOT: .llvmcmd 25 26; CHECK: define void @foo() 27; CHECK-OPT-NEXT: ret void 28; CHECK-NOOPT-NEXT: call void @bar() 29; CHECK-NOOPT: define available_externally void @bar() !thinlto_src_module !0 { 30; CHECK-NOOPT-NEXT: ret void 31