2014-03-29 10:18:08 +00:00
|
|
|
; RUN: llc < %s -march=arm64 | FileCheck %s
|
|
|
|
|
|
|
|
define i8* @rt0(i32 %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: rt0:
|
2014-04-09 14:43:59 +00:00
|
|
|
; CHECK: mov x0, x30
|
2014-03-29 10:18:08 +00:00
|
|
|
; CHECK: ret
|
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @rt2() nounwind readnone {
|
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: rt2:
|
2014-04-09 14:43:59 +00:00
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
2014-04-09 14:43:50 +00:00
|
|
|
; CHECK: mov x29, sp
|
|
|
|
; CHECK: ldr x[[REG:[0-9]+]], [x29]
|
2014-03-29 10:18:08 +00:00
|
|
|
; CHECK: ldr x[[REG2:[0-9]+]], [x[[REG]]]
|
|
|
|
; CHECK: ldr x0, [x[[REG2]], #8]
|
2014-04-09 14:43:59 +00:00
|
|
|
; CHECK: ldp x29, x30, [sp], #16
|
2014-03-29 10:18:08 +00:00
|
|
|
; CHECK: ret
|
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 2)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.returnaddress(i32) nounwind readnone
|