17ab1f692STeresa Johnson; RUN: opt -module-summary %s -o %t.o
27ab1f692STeresa Johnson; RUN: opt -module-summary %p/Inputs/thinlto_internalize.ll -o %t2.o
37ab1f692STeresa Johnson
47ab1f692STeresa Johnson; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
57ab1f692STeresa Johnson; RUN:     --plugin-opt=thinlto \
67ab1f692STeresa Johnson; RUN:     --plugin-opt=-import-instr-limit=0 \
77ab1f692STeresa Johnson; RUN:     --plugin-opt=save-temps \
87ab1f692STeresa Johnson; RUN:     -o %t3.o %t2.o %t.o
9*9ba95f99STeresa Johnson; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s
107ab1f692STeresa Johnson
117ab1f692STeresa Johnson; f() should be internalized and eliminated after inlining
127ab1f692STeresa Johnson; CHECK-NOT: @f()
137ab1f692STeresa Johnson
1427694571STeresa Johnson; h() should be internalized after promotion, and eliminated after inlining
1527694571STeresa Johnson; CHECK-NOT: @h.llvm.
1627694571STeresa Johnson
177ab1f692STeresa Johnsontarget triple = "x86_64-unknown-linux-gnu"
187ab1f692STeresa Johnsondefine i32 @g() {
197ab1f692STeresa Johnson  call void @f()
2027694571STeresa Johnson  call void @h()
217ab1f692STeresa Johnson  ret i32 0
227ab1f692STeresa Johnson}
237ab1f692STeresa Johnsondefine void @f() {
247ab1f692STeresa Johnson  ret void
257ab1f692STeresa Johnson}
2627694571STeresa Johnsondefine internal void @h() {
2727694571STeresa Johnson  ret void
2827694571STeresa Johnson}
29