xref: /aosp_15_r20/external/llvm/test/ThinLTO/X86/llvm.used.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Do setup work for all below tests: generate bitcode and combined index
2*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %s -o %t.bc
3*9880d681SAndroid Build Coastguard Worker; RUN: opt -module-summary %p/Inputs/llvm.used.ll -o %t2.bc
4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s
8*9880d681SAndroid Build Coastguard Worker; CHECK: define available_externally void @globalfunc
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
12*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.11.0"
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Workerdefine internal void @_ZN12_GLOBAL__N_16Module4dumpEv() {
17*9880d681SAndroid Build Coastguard Worker    ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ZN12_GLOBAL__N_16Module4dumpEv to i8*)], section "llvm.metadata"
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine void @globalfunc() #0 {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker  ret void
25*9880d681SAndroid Build Coastguard Worker}
26