xref: /llvm-project/llvm/test/LTO/X86/unified-internalize.ll (revision a1ca3af31eeec61cfb9d619f55b655b0eb0b9494)
1; RUN: opt <%s -unified-lto -thinlto-split-lto-unit -thinlto-bc -o %t.bc
2
3; Test internalization during unified LTO. This makes sure internalization does
4; happen in runRegularLTO().
5; RUN: llvm-lto2 run %t.bc -o %t.o -save-temps --unified-lto=full \
6; RUN:     -r=%t.bc,salad,pxl \
7; RUN:     -r=%t.bc,balsamic,pl \
8; RUN:     -r=%t.bc,thousandisland,pl \
9; RUN:     -r=%t.bc,main,pxl \
10; RUN:     -r %t.bc,ranch,px \
11; RUN:     -r %t.bc,egg, \
12; RUN:     -r %t.bc,bar,px
13; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck  %s
14
15; CHECK: @llvm.used = appending global {{.*}} @bar
16; CHECK: define dso_local dllexport void @thousandisland
17; CHECK: define dso_local void @salad
18; CHECK: define internal void @balsamic
19; CHECK: define dso_local void @main
20; CHECK: define available_externally void @egg()
21
22target triple = "x86_64-scei-ps4"
23target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24
25define void @salad() {
26    call void @balsamic()
27    ret void
28}
29define void @balsamic() {
30    ret void
31}
32define dllexport void @thousandisland() {
33    ret void
34}
35
36define void @main() {
37    ret void
38}
39
40define void ()* @ranch() {
41  ret void ()* @egg
42}
43
44define available_externally void @egg() {
45  ret void
46}
47
48%"foo.1" = type { i8, i8 }
49declare dso_local i32 @bar(%"foo.1"* nocapture readnone %this) local_unnamed_addr
50@llvm.used = appending global [2 x i8*] [i8* bitcast (i32 (%"foo.1"*)* @bar to i8*), i8* bitcast (void ()* @thousandisland to i8*)], section "llvm.metadata"
51