2017-11-04 09:54:20 +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
|
|
|
|
|
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-11-04 09:54:20 +08:00
|
|
|
; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE
|
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()
|
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() {
|
|
|
|
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-04 09:54:20 +08:00
|
|
|
}
|