blob: 14ff6791561d3c90257b3c1729640613fcca4469 [file] [log] [blame]
Mehdi Amini059464f2016-04-24 03:18:01 +00001;; 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
5
Mehdi Amini8ac7b322016-08-18 00:59:24 +00006; RUN: llvm-lto2 %t1.bc -o %t.o -save-temps \
7; RUN: -r=%t1.bc,_foo,pxl \
8; RUN: -r=%t1.bc,_bar,pl \
9; RUN: -r=%t1.bc,_linkonce_func,pl
Mehdi Aminifd49c732016-08-23 19:32:41 +000010; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE
Mehdi Amini8ac7b322016-08-18 00:59:24 +000011
12
Mehdi Amini059464f2016-04-24 03:18:01 +000013; REGULAR: define void @foo
14; REGULAR: define void @bar
Mehdi Amini8ac7b322016-08-18 00:59:24 +000015; REGULAR: define linkonce void @linkonce_func()
Mehdi Amini059464f2016-04-24 03:18:01 +000016; INTERNALIZE: define void @foo
17; INTERNALIZE: define internal void @bar
Mehdi Amini8ac7b322016-08-18 00:59:24 +000018; INTERNALIZE: define internal void @linkonce_func()
Mehdi Amini059464f2016-04-24 03:18:01 +000019
20target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
21target triple = "x86_64-apple-macosx10.11.0"
22
23define void @foo() {
24 ret void
25}
26define void @bar() {
Mehdi Amini8ac7b322016-08-18 00:59:24 +000027 call void @linkonce_func()
28 ret void
29}
30define linkonce void @linkonce_func() {
Mehdi Amini059464f2016-04-24 03:18:01 +000031 ret void
32}