mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-10 06:54:54 +00:00
Previously we only checked if the LR required saving if the frame size was non zero. However because the caller reserves 1 word for the callee to use that doesn't count towards our frame size it is possible for the LR to need saving and for the frame size to be 0. We didn't hit when the LR needed saving because of a function calls because the 1 word of stack we must allocate for our callee means the frame size is always non zero in this case. However we can hit this case if the LR is clobbered in inline asm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181520 91177308-0d34-0410-b5e6-96231b3b80d8
12 lines
229 B
LLVM
12 lines
229 B
LLVM
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
; CHECK: f1
|
|
; CHECK: stw lr, sp[0]
|
|
; CHECK: ldw lr, sp[0]
|
|
; CHECK-NEXT: retsp 0
|
|
define void @f1() nounwind {
|
|
entry:
|
|
tail call void asm sideeffect "", "~{lr}"() nounwind
|
|
ret void
|
|
}
|