mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-12 23:40:43 +00:00
27 lines
604 B
LLVM
27 lines
604 B
LLVM
|
; RUN: llc < %s -march=arm64 | FileCheck %s
|
||
|
|
||
|
define i8* @rt0(i32 %x) nounwind readnone {
|
||
|
entry:
|
||
|
; CHECK-LABEL: rt0:
|
||
|
; CHECK: mov x0, lr
|
||
|
; CHECK: ret
|
||
|
%0 = tail call i8* @llvm.returnaddress(i32 0)
|
||
|
ret i8* %0
|
||
|
}
|
||
|
|
||
|
define i8* @rt2() nounwind readnone {
|
||
|
entry:
|
||
|
; CHECK-LABEL: rt2:
|
||
|
; CHECK: stp fp, lr, [sp, #-16]!
|
||
|
; CHECK: mov fp, sp
|
||
|
; CHECK: ldr x[[REG:[0-9]+]], [fp]
|
||
|
; CHECK: ldr x[[REG2:[0-9]+]], [x[[REG]]]
|
||
|
; CHECK: ldr x0, [x[[REG2]], #8]
|
||
|
; CHECK: ldp fp, lr, [sp], #16
|
||
|
; CHECK: ret
|
||
|
%0 = tail call i8* @llvm.returnaddress(i32 2)
|
||
|
ret i8* %0
|
||
|
}
|
||
|
|
||
|
declare i8* @llvm.returnaddress(i32) nounwind readnone
|