aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PowerPC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-08 06:59:59 +0000
committerChris Lattner <sabre@nondot.org>2007-12-08 06:59:59 +0000
commit3fc027df4fca0355717515abb4d6e3753e6dee2a (patch)
tree6311d6ce97604a9baa315d5657959d0b87784eb3 /test/CodeGen/PowerPC
parent73944fb22270697e75408cba52cca276be371a1f (diff)
downloadexternal_llvm-3fc027df4fca0355717515abb4d6e3753e6dee2a.zip
external_llvm-3fc027df4fca0355717515abb4d6e3753e6dee2a.tar.gz
external_llvm-3fc027df4fca0355717515abb4d6e3753e6dee2a.tar.bz2
implement __builtin_return_addr(0) on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC')
-rw-r--r--test/CodeGen/PowerPC/retaddr.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/retaddr.ll b/test/CodeGen/PowerPC/retaddr.ll
new file mode 100644
index 0000000..6b9a5e3
--- /dev/null
+++ b/test/CodeGen/PowerPC/retaddr.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=ppc32 | grep mflr
+; RUN: llvm-as < %s | llc -march=ppc32 | grep lwz
+
+target triple = "powerpc-apple-darwin8"
+
+define void @foo(i8** %X) {
+entry:
+ %tmp = tail call i8* @llvm.returnaddress( i32 0 ) ; <i8*> [#uses=1]
+ store i8* %tmp, i8** %X, align 4
+ ret void
+}
+
+declare i8* @llvm.returnaddress(i32)
+