From ba584fe8feb840a82ad5966cb9eca6df0eeaafc2 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 11 Jul 2012 00:53:32 +0000 Subject: 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 --- test/CodeGen/Mips/return_address.ll | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/CodeGen/Mips/return_address.ll (limited to 'test') diff --git a/test/CodeGen/Mips/return_address.ll b/test/CodeGen/Mips/return_address.ll new file mode 100644 index 0000000..e1c9241 --- /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() -- cgit v1.1