1 ; RUN: llc -mtriple=arm64-apple-ios -global-isel -o - %s | FileCheck %s
3 define ptr @rt0(i32 %x) nounwind readnone {
7 ; CHECK-NEXT: mov x0, x30
8 %0 = tail call ptr @llvm.returnaddress(i32 0)
12 define ptr @rt0_call_clobber(i32 %x) nounwind readnone {
14 ; CHECK-LABEL: rt0_call_clobber:
15 ; CHECK: stp x20, x19, [sp, #-32]!
16 ; CHECK: stp x29, x30, [sp, #16]
21 ; CHECK-NEXT: mov x0, x30
24 %ret = call i32 @foo()
25 %0 = tail call ptr @llvm.returnaddress(i32 0)
29 define ptr @rt2() nounwind readnone {
32 ; CHECK: ldr x[[reg:[0-9]+]], [x29]
33 ; CHECK: ldr x[[reg]], [x[[reg]]]
34 ; CHECK: ldr x30, [x[[reg]], #8]
39 %0 = tail call ptr @llvm.returnaddress(i32 2)
45 declare ptr @llvm.returnaddress(i32) nounwind readnone