llvm.org GIT mirror llvm / a3a2046
Thumb1 functions using @llvm.returnaddress were not saving the incoming LR. Radar 8031193. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106582 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 10 years ago
2 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
174174 isKill = false;
175175 }
176176
177 if (isKill) {
177 if (isKill)
178178 MBB.addLiveIn(Reg);
179 MIB.addReg(Reg, RegState::Kill);
180 }
179
180 MIB.addReg(Reg, getKillRegState(isKill));
181181 }
182182 return true;
183183 }
0 ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
1 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin
1 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin | FileCheck %s
22 ; rdar://8015977
33 ; rdar://8020118
44
55 define i8* @rt0(i32 %x) nounwind readnone {
66 entry:
77 ; CHECK: rt0:
8 ; CHECK: {r7, lr}
89 ; CHECK: mov r0, lr
910 %0 = tail call i8* @llvm.returnaddress(i32 0)
1011 ret i8* %0
1314 define i8* @rt2() nounwind readnone {
1415 entry:
1516 ; CHECK: rt2:
17 ; CHECK: {r7, lr}
1618 ; CHECK: ldr r0, [r7]
1719 ; CHECK: ldr r0, [r0]
1820 ; CHECK: ldr r0, [r0, #4]