xref: /aosp_15_r20/external/llvm/test/Linker/funcimport2.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %s -o %t1.bc
2*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %p/Inputs/funcimport2.ll -o %t2.bc
3*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto -o %t3 %t1.bc %t2.bc
4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-link -import=bar:%t2.bc %t1.bc -summary-index=%t3.thinlto.bc -S | FileCheck %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK: define available_externally hidden void @foo() {
7*9880d681SAndroid Build Coastguard Workerdefine available_externally hidden void @foo() {
8*9880d681SAndroid Build Coastguard Worker    ret void
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdeclare void @bar()
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerdefine void @caller() {
14*9880d681SAndroid Build Coastguard Worker  call void @bar()
15*9880d681SAndroid Build Coastguard Worker  call void @foo()
16*9880d681SAndroid Build Coastguard Worker  ret void
17*9880d681SAndroid Build Coastguard Worker}
18