1 ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s 2 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin | FileCheck %s 3 ; RUN: llc < %s -mtriple=arm-apple-darwin -regalloc=basic | FileCheck %s 4 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin -regalloc=basic | FileCheck %s 5 ; rdar://8015977 6 ; rdar://8020118 7 8 define i8* @rt0(i32 %x) nounwind readnone { 9 entry: 10 ; CHECK: rt0: 11 ; CHECK: {r7, lr} 12 ; CHECK: mov r0, lr 13 %0 = tail call i8* @llvm.returnaddress(i32 0) 14 ret i8* %0 15 } 16 17 define i8* @rt2() nounwind readnone { 18 entry: 19 ; CHECK: rt2: 20 ; CHECK: {r7, lr} 21 ; CHECK: ldr r[[R0:[0-9]+]], [r7] 22 ; CHECK: ldr r0, [r0] 23 ; CHECK: ldr r0, [r0, #4] 24 %0 = tail call i8* @llvm.returnaddress(i32 2) 25 ret i8* %0 26 } 27 28 declare i8* @llvm.returnaddress(i32) nounwind readnone 29