Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / ThinLTO / X86 / internalize.ll
blob70b28469b4865709007b8639c3ed1f0179149217
1 ; RUN: opt -module-summary %s -o %t1.bc
2 ; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc
3 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=REGULAR
4 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o -  --exported-symbol=foo | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZE
6 ; Test the enable-lto-internalization option by setting it to false.
7 ; This makes sure indices are not marked as internallinkage and therefore
8 ; internalization does not happen.
9 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc \
10 ; RUN:          -enable-lto-internalization=false --exported-symbol=foo
11 ; RUN: llvm-dis < %t1.bc.thinlto.internalized.bc | FileCheck %s --check-prefix=INTERNALIZE-OPTION-DISABLE
13 ; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
14 ; RUN:     -r=%t1.bc,_foo,pxl \
15 ; RUN:     -r=%t1.bc,_bar,pl \
16 ; RUN:     -r=%t1.bc,_linkonce_func,pl
17 ; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck  %s --check-prefix=INTERNALIZE2
19 ; Test the enable-lto-internalization option by setting it to false.
20 ; This makes sure indices are not marked as internallinkage and therefore
21 ; internalization does not happen.
22 ; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps -enable-lto-internalization=false \
23 ; RUN:     -r=%t1.bc,_foo,pxl \
24 ; RUN:     -r=%t1.bc,_bar,pl \
25 ; RUN:     -r=%t1.bc,_linkonce_func,pl
26 ; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck  %s --check-prefix=INTERNALIZE2-OPTION-DISABLE
28 ; REGULAR: define void @foo
29 ; REGULAR: define void @bar
30 ; REGULAR: define linkonce void @linkonce_func()
31 ; INTERNALIZE: define void @foo
32 ; INTERNALIZE: define internal void @bar
33 ; INTERNALIZE: define internal void @linkonce_func()
34 ; INTERNALIZE-OPTION-DISABLE: define void @foo
35 ; INTERNALIZE-OPTION-DISABLE: define void @bar
36 ; INTERNALIZE-OPTION-DISABLE: define linkonce void @linkonce_func()
37 ; INTERNALIZE2: define dso_local void @foo
38 ; INTERNALIZE2: define internal void @bar
39 ; INTERNALIZE2: define internal void @linkonce_func()
40 ; INTERNALIZE2-OPTION-DISABLE: define dso_local void @foo
41 ; INTERNALIZE2-OPTION-DISABLE: define dso_local void @bar
42 ; INTERNALIZE2-OPTION-DISABLE: define weak dso_local void @linkonce_func()
44 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
45 target triple = "x86_64-apple-macosx10.11.0"
47 define void @foo() {
48     call void @bar()
49     ret void
51 define void @bar() {
52     call void @linkonce_func()
53         ret void
55 define linkonce void @linkonce_func() {
56     ret void