mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-25 14:32:53 +00:00
dcc4207a00
Patch by Robert Lytton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186500 91177308-0d34-0410-b5e6-96231b3b80d8
27 lines
510 B
LLVM
27 lines
510 B
LLVM
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
; CHECK-LABEL: 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
|
|
}
|
|
|
|
; CHECK-LABEL: f3
|
|
; CHECK: entsp 2
|
|
; CHECK: stw [[REG:r[4-9]+]], sp[1]
|
|
; CHECK: mov [[REG]], r0
|
|
; CHECK: bl f2
|
|
; CHECK: mov r0, [[REG]]
|
|
; CHECK: ldw [[REG]], sp[1]
|
|
; CHECK: retsp 2
|
|
declare void @f2()
|
|
define i32 @f3(i32 %i) nounwind {
|
|
entry:
|
|
call void @f2()
|
|
ret i32 %i
|
|
}
|