summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/ARM/arm-frameaddr.ll9
-rw-r--r--llvm/test/CodeGen/ARM/arm-returnaddr.ll22
2 files changed, 29 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/ARM/arm-frameaddr.ll b/llvm/test/CodeGen/ARM/arm-frameaddr.ll
index 273986034c9..1c7ac25e073 100644
--- a/llvm/test/CodeGen/ARM/arm-frameaddr.ll
+++ b/llvm/test/CodeGen/ARM/arm-frameaddr.ll
@@ -1,10 +1,15 @@
-; RUN: llc < %s -mtriple=arm-apple-darwin | grep mov | grep r7
-; RUN: llc < %s -mtriple=arm-linux-gnueabi | grep mov | grep r11
+; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -check-prefix=DARWIN
+; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=LINUX
; PR4344
; PR4416
define arm_aapcscc i8* @t() nounwind {
entry:
+; DARWIN: t:
+; DARWIN: mov r0, r7
+
+; LINUX: t:
+; LINUX: mov r0, r11
%0 = call i8* @llvm.frameaddress(i32 0)
ret i8* %0
}
diff --git a/llvm/test/CodeGen/ARM/arm-returnaddr.ll b/llvm/test/CodeGen/ARM/arm-returnaddr.ll
new file mode 100644
index 00000000000..5bf476dbf86
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/arm-returnaddr.ll
@@ -0,0 +1,22 @@
+; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
+; rdar://8015977
+
+define arm_apcscc i8* @rt0(i32 %x) nounwind readnone {
+entry:
+; CHECK: rt0:
+; CHECK: mov r0, lr
+ %0 = tail call i8* @llvm.returnaddress(i32 0)
+ ret i8* %0
+}
+
+define arm_apcscc i8* @rt2() nounwind readnone {
+entry:
+; CHECK: rt2:
+; CHECK: ldr r0, [r7]
+; CHECK: ldr r0, [r0]
+; CHECK: ldr r0, [r0, #4]
+ %0 = tail call i8* @llvm.returnaddress(i32 2)
+ ret i8* %0
+}
+
+declare i8* @llvm.returnaddress(i32) nounwind readnone
OpenPOWER on IntegriCloud