2017-11-05 01:04:39 +08:00
|
|
|
; RUN: opt -module-summary %s -o %t1.bc
|
2016-04-24 11:18:01 +08:00
|
|
|
; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc
|
|
|
|
; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=REGULAR
|
|
|
|
; 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
|
|
|
|
|
2018-11-05 23:49:46 +08:00
|
|
|
; Test the enable-lto-internalization option by setting it to false.
|
|
|
|
; This makes sure indices are not marked as internallinkage and therefore
|
|
|
|
; internalization does not happen.
|
|
|
|
; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc \
|
|
|
|
; RUN: -enable-lto-internalization=false --exported-symbol=foo
|
|
|
|
; RUN: llvm-dis < %t1.bc.thinlto.internalized.bc | FileCheck %s --check-prefix=INTERNALIZE-OPTION-DISABLE
|
|
|
|
|
2017-04-12 02:12:00 +08:00
|
|
|
; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
|
2016-08-18 08:59:24 +08:00
|
|
|
; RUN: -r=%t1.bc,_foo,pxl \
|
|
|
|
; RUN: -r=%t1.bc,_bar,pl \
|
|
|
|
; RUN: -r=%t1.bc,_linkonce_func,pl
|
2017-12-16 10:10:00 +08:00
|
|
|
; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE2
|
2016-08-18 08:59:24 +08:00
|
|
|
|
2018-11-05 23:49:46 +08:00
|
|
|
; Test the enable-lto-internalization option by setting it to false.
|
|
|
|
; This makes sure indices are not marked as internallinkage and therefore
|
|
|
|
; internalization does not happen.
|
|
|
|
; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps -enable-lto-internalization=false \
|
|
|
|
; RUN: -r=%t1.bc,_foo,pxl \
|
|
|
|
; RUN: -r=%t1.bc,_bar,pl \
|
|
|
|
; RUN: -r=%t1.bc,_linkonce_func,pl
|
|
|
|
; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE2-OPTION-DISABLE
|
2016-08-18 08:59:24 +08:00
|
|
|
|
2016-04-24 11:18:01 +08:00
|
|
|
; REGULAR: define void @foo
|
|
|
|
; REGULAR: define void @bar
|
2016-08-18 08:59:24 +08:00
|
|
|
; REGULAR: define linkonce void @linkonce_func()
|
2016-04-24 11:18:01 +08:00
|
|
|
; INTERNALIZE: define void @foo
|
|
|
|
; INTERNALIZE: define internal void @bar
|
2016-08-18 08:59:24 +08:00
|
|
|
; INTERNALIZE: define internal void @linkonce_func()
|
2018-11-05 23:49:46 +08:00
|
|
|
; INTERNALIZE-OPTION-DISABLE: define void @foo
|
|
|
|
; INTERNALIZE-OPTION-DISABLE: define void @bar
|
|
|
|
; INTERNALIZE-OPTION-DISABLE: define linkonce void @linkonce_func()
|
2017-11-05 01:04:39 +08:00
|
|
|
; INTERNALIZE2: define dso_local void @foo
|
2018-01-12 06:15:05 +08:00
|
|
|
; INTERNALIZE2: define internal void @bar
|
|
|
|
; INTERNALIZE2: define internal void @linkonce_func()
|
2018-11-05 23:49:46 +08:00
|
|
|
; INTERNALIZE2-OPTION-DISABLE: define dso_local void @foo
|
|
|
|
; INTERNALIZE2-OPTION-DISABLE: define dso_local void @bar
|
|
|
|
; INTERNALIZE2-OPTION-DISABLE: define weak dso_local void @linkonce_func()
|
2016-04-24 11:18:01 +08:00
|
|
|
|
|
|
|
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-apple-macosx10.11.0"
|
|
|
|
|
|
|
|
define void @foo() {
|
2018-01-29 16:03:30 +08:00
|
|
|
call void @bar()
|
2016-04-24 11:18:01 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
define void @bar() {
|
2016-08-18 08:59:24 +08:00
|
|
|
call void @linkonce_func()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
define linkonce void @linkonce_func() {
|
2016-04-24 11:18:01 +08:00
|
|
|
ret void
|
2017-11-05 01:04:39 +08:00
|
|
|
}
|