mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
e2a48fbd9d
Indirect tail-calls shouldn't use R9 for the branch destination, as it's not reliably a call-clobbered register. rdar://14793425 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188967 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
511 B
LLVM
15 lines
511 B
LLVM
; RUN: llc < %s -mtriple=thumbv7-apple-ios -mcpu=cortex-m3 | FileCheck %s
|
|
|
|
@foo = common global void ()* null, align 4
|
|
|
|
; Make sure in the presence of a tail call, r9 doesn't get used to hold
|
|
; the destination address. It's callee-saved in AAPCS.
|
|
define arm_aapcscc void @test(i32 %a) nounwind {
|
|
; CHECK-LABEL: test:
|
|
; CHECK-NOT bx r9
|
|
%tmp = load void ()** @foo, align 4
|
|
tail call void asm sideeffect "", "~{r0},~{r1},~{r2},~{r3},~{r12}"() nounwind
|
|
tail call arm_aapcscc void %tmp() nounwind
|
|
ret void
|
|
}
|