xref: /aosp_15_r20/external/llvm/test/CodeGen/Thumb2/tail-call-r9.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-ios -mcpu=cortex-m3 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker@foo = common global void ()* null, align 4
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Make sure in the presence of a tail call, r9 doesn't get used to hold
6*9880d681SAndroid Build Coastguard Worker; the destination address. It's callee-saved in AAPCS.
7*9880d681SAndroid Build Coastguard Workerdefine arm_aapcscc void @test(i32 %a) nounwind {
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test:
9*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: bx r9
10*9880d681SAndroid Build Coastguard Worker  %tmp = load void ()*, void ()** @foo, align 4
11*9880d681SAndroid Build Coastguard Worker  tail call void asm sideeffect "", "~{r0},~{r1},~{r2},~{r3},~{r12}"() nounwind
12*9880d681SAndroid Build Coastguard Worker  tail call arm_aapcscc void %tmp() nounwind
13*9880d681SAndroid Build Coastguard Worker  ret void
14*9880d681SAndroid Build Coastguard Worker}
15