aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-07-11 00:53:32 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-07-11 00:53:32 +0000
commitba584fe8feb840a82ad5966cb9eca6df0eeaafc2 (patch)
tree268af3d1949025309d0dd67d6cc63d0d28de9fa7 /test
parentbb78930489aceab797eecffe6771c6e52ff0c80c (diff)
Lower RETURNADDR node in Mips backend.
Patch by Sasa Stankovic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/Mips/return_address.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/return_address.ll b/test/CodeGen/Mips/return_address.ll
new file mode 100644
index 0000000000..e1c9241984
--- /dev/null
+++ b/test/CodeGen/Mips/return_address.ll
@@ -0,0 +1,23 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s
+
+define i8* @f1() nounwind {
+entry:
+ %0 = call i8* @llvm.returnaddress(i32 0)
+ ret i8* %0
+
+; CHECK: addu $2, $zero, $ra
+}
+
+define i8* @f2() nounwind {
+entry:
+ call void @g()
+ %0 = call i8* @llvm.returnaddress(i32 0)
+ ret i8* %0
+
+; CHECK: addu $[[R0:[0-9]+]], $zero, $ra
+; CHECK: jal
+; CHECK: addu $2, $zero, $[[R0]]
+}
+
+declare i8* @llvm.returnaddress(i32) nounwind readnone
+declare void @g()