2013-10-29 17:01:29 +00:00
|
|
|
; RUN: llc < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
|
2014-04-16 11:53:07 +00:00
|
|
|
; RUN: llc -o - %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
|
2013-10-29 17:01:29 +00:00
|
|
|
|
|
|
|
define i8* @rt0(i32 %x) nounwind readnone {
|
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: rt0:
|
|
|
|
; CHECK: mov x0, x30
|
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 0)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8* @rt2() nounwind readnone {
|
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: rt2:
|
|
|
|
; CHECK: ldr x[[reg:[0-9]+]], [x29]
|
|
|
|
; CHECK: ldr x[[reg]], [x[[reg]]]
|
|
|
|
; CHECK: ldr x0, [x[[reg]], #8]
|
|
|
|
%0 = tail call i8* @llvm.returnaddress(i32 2)
|
|
|
|
ret i8* %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @llvm.returnaddress(i32) nounwind readnone
|