xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/local-call.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=thumbv7-apple-ios -filetype=obj %s -o %t
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-objdump -macho -d %t | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; This function just messes up the offsets enough to make the libcall in
5*9880d681SAndroid Build Coastguard Worker; test_local_call unencodable with a blx.
6*9880d681SAndroid Build Coastguard Workerdefine void @thing() {
7*9880d681SAndroid Build Coastguard Worker  ret void
8*9880d681SAndroid Build Coastguard Worker}
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine i64 @__udivdi3(i64 %a, i64 %b) {
11*9880d681SAndroid Build Coastguard Worker  ret i64 %b
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine i64 @test_local_call(i64 %a, i64 %b) {
15*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_local_call:
16*9880d681SAndroid Build Coastguard Worker; CHECK: bl ___udivdi3
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker%res = udiv i64 %a, %b
19*9880d681SAndroid Build Coastguard Worker  ret i64 %res
20*9880d681SAndroid Build Coastguard Worker}