120
|
1 ; Do setup work for all below tests: generate bitcode and combined index
|
|
2 ; RUN: opt -module-summary %s -o %t.bc
|
|
3 ; RUN: opt -module-summary %p/Inputs/referenced_by_constant.ll -o %t2.bc
|
|
4 ; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
|
|
5
|
121
|
6 ; Check the import side: we currently only import bar() (with a future
|
|
7 ; enhancement to identify constants in the summary, we should mark
|
|
8 ; @someglobal/@someglobal2 for import as a local copy, which would
|
|
9 ; cause @referencedbyglobal and @localreferencedbyglobal to be exported
|
|
10 ; and promoted).
|
120
|
11 ; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=IMPORT
|
121
|
12 ; IMPORT: @someglobal.llvm.0 = external hidden unnamed_addr constant
|
|
13 ; IMPORT: @someglobal2.llvm.0 = external hidden unnamed_addr constant
|
120
|
14 ; IMPORT: define available_externally void @bar()
|
121
|
15
|
|
16 ; Check the export side: we currently only export bar(), which causes
|
|
17 ; @someglobal and @someglobal2 to be promoted (see above).
|
|
18 ; RUN: llvm-lto -thinlto-action=promote %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=EXPORT
|
|
19 ; EXPORT: @someglobal.llvm.0 = hidden unnamed_addr constant
|
|
20 ; EXPORT: @someglobal2.llvm.0 = hidden unnamed_addr constant
|
|
21 ; EXPORT: define void @referencedbyglobal()
|
|
22 ; EXPORT: define internal void @localreferencedbyglobal()
|
120
|
23
|
|
24 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
|
25 target triple = "x86_64-apple-macosx10.11.0"
|
|
26
|
|
27 declare void @bar()
|
|
28
|
|
29 define void @foo() {
|
|
30 call void @bar()
|
|
31 ret void
|
|
32 }
|