xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/pic.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Check the function call in PIC relocation model.
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; If the relocation model is PIC, then the "bl" instruction for the function
4*9880d681SAndroid Build Coastguard Worker; call to the external function should come with PLT fixup type.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; RUN:  llc < %s -mtriple=armv7-unknown-linux-gnueabi \
7*9880d681SAndroid Build Coastguard Worker; RUN:           -relocation-model=pic -fast-isel -verify-machineinstrs \
8*9880d681SAndroid Build Coastguard Worker; RUN:    | FileCheck %s
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @test() {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker  %0 = call i32 @get()
14*9880d681SAndroid Build Coastguard Worker; CHECK: bl get
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker  call void @put(i32 %0)
17*9880d681SAndroid Build Coastguard Worker; CHECK: bl put
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdeclare i32 @get()
23*9880d681SAndroid Build Coastguard Workerdeclare void @put(i32)
24