1 ; Do setup work for all below tests: generate bitcode and combined index
2 ; RUN: llvm-as -function-summary %s -o %t.bc
3 ; RUN: llvm-as -function-summary %p/Inputs/funcimport.ll -o %t2.bc
4 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
7 ; RUN: opt -function-import -summary-file %t3.thinlto.bc %s -S | FileCheck %s
9 define i32 @main() #0 {
11 call void (...) @weakalias()
12 call void (...) @analias()
13 %call = call i32 (...) @referencestatics()
14 %call1 = call i32 (...) @referenceglobals()
15 %call2 = call i32 (...) @referencecommon()
16 call void (...) @setfuncptr()
17 call void (...) @callfuncptr()
18 call void (...) @callweakfunc()
23 declare void @weakalias(...) #1
24 declare void @analias(...) #1
26 ; CHECK-DAG: define available_externally i32 @referencestatics(i32 %i)
27 declare i32 @referencestatics(...) #1
29 ; CHECK-DAG: define available_externally i32 @referenceglobals(i32 %i)
30 declare i32 @referenceglobals(...) #1
32 ; CHECK-DAG: define available_externally i32 @referencecommon(i32 %i)
33 declare i32 @referencecommon(...) #1
35 ; CHECK-DAG: define available_externally void @setfuncptr()
36 declare void @setfuncptr(...) #1
38 ; CHECK-DAG: define available_externally void @callfuncptr()
39 declare void @callfuncptr(...) #1
41 ; Won't import weak func
42 declare void @callweakfunc(...) #1