summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-03-20 22:20:40 +0000
committerBob Wilson <bob.wilson@apple.com>2010-03-20 22:20:40 +0000
commitc88d0722931b8442cd347bd530e2182d164c82c6 (patch)
tree5976d4a930357166f03263e9dc41b05dfb2e6ec5 /test
parent226036ee731a2041f37f28f958d2b6a50373f4f4 (diff)
downloadllvm-c88d0722931b8442cd347bd530e2182d164c82c6.tar.gz
llvm-c88d0722931b8442cd347bd530e2182d164c82c6.tar.bz2
llvm-c88d0722931b8442cd347bd530e2182d164c82c6.tar.xz
pr6652: Use LDM to restore PC to the return address on ARMv4.
Patch by John Tytgat! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll b/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll
new file mode 100644
index 0000000000..31525eff44
--- /dev/null
+++ b/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s
+; RUN: llc < %s -mtriple=armv5-unknown-eabi | FileCheck %s
+; RUN: llc < %s -mtriple=armv6-unknown-eabi | FileCheck %s
+
+define i32 @bar(i32 %a) nounwind {
+entry:
+ %0 = tail call i32 @foo(i32 %a) nounwind ; <i32> [#uses=1]
+ %1 = add nsw i32 %0, 3 ; <i32> [#uses=1]
+; CHECK: ldmia sp!, {r11, pc}
+ ret i32 %1
+}
+
+declare i32 @foo(i32)