1 ; RUN: llc < %s -march=arm64 | FileCheck %s 2 3 define i8* @rt0(i32 %x) nounwind readnone { 4 entry: 5 ; CHECK-LABEL: rt0: 6 ; CHECK: mov x0, x30 7 ; CHECK: ret 8 %0 = tail call i8* @llvm.returnaddress(i32 0) 9 ret i8* %0 10 } 11 12 define i8* @rt2() nounwind readnone { 13 entry: 14 ; CHECK-LABEL: rt2: 15 ; CHECK: stp x29, x30, [sp, #-16]! 16 ; CHECK: mov x29, sp 17 ; CHECK: ldr x[[REG:[0-9]+]], [x29] 18 ; CHECK: ldr x[[REG2:[0-9]+]], [x[[REG]]] 19 ; CHECK: ldr x0, [x[[REG2]], #8] 20 ; CHECK: ldp x29, x30, [sp], #16 21 ; CHECK: ret 22 %0 = tail call i8* @llvm.returnaddress(i32 2) 23 ret i8* %0 24 } 25 26 declare i8* @llvm.returnaddress(i32) nounwind readnone 27