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