blob: 8d0033c1f98e5946c753f7b4d810e3b2b20cf714 [file] [log] [blame]
Teresa Johnson7ab1f692016-06-09 01:14:13 +00001; RUN: opt -module-summary %s -o %t.o
2; RUN: opt -module-summary %p/Inputs/thinlto_internalize.ll -o %t2.o
3
4; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
5; RUN: --plugin-opt=thinlto \
6; RUN: --plugin-opt=-import-instr-limit=0 \
7; RUN: --plugin-opt=save-temps \
8; RUN: -o %t3.o %t2.o %t.o
Teresa Johnson9ba95f92016-08-11 14:58:12 +00009; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck %s
Teresa Johnson7ab1f692016-06-09 01:14:13 +000010
11; f() should be internalized and eliminated after inlining
12; CHECK-NOT: @f()
13
Teresa Johnson276945712016-07-13 03:42:41 +000014; h() should be internalized after promotion, and eliminated after inlining
15; CHECK-NOT: @h.llvm.
16
Teresa Johnson7ab1f692016-06-09 01:14:13 +000017target triple = "x86_64-unknown-linux-gnu"
18define i32 @g() {
19 call void @f()
Teresa Johnson276945712016-07-13 03:42:41 +000020 call void @h()
Teresa Johnson7ab1f692016-06-09 01:14:13 +000021 ret i32 0
22}
23define void @f() {
24 ret void
25}
Teresa Johnson276945712016-07-13 03:42:41 +000026define internal void @h() {
27 ret void
28}