summaryrefslogtreecommitdiff
path: root/test/Transforms/ArgumentPromotion
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-09-02 21:19:44 +0000
committerOwen Anderson <resistor@mac.com>2006-09-02 21:19:44 +0000
commitb833e5ac3fc9230947cbdfd50c7d8782a0c17d60 (patch)
treec62d141a5788fc27f5ee5e9e10c9d9b6c4c99ffa /test/Transforms/ArgumentPromotion
parent5f450d2948ac5bd83a31fbfff89e17b0e2536a80 (diff)
downloadllvm-b833e5ac3fc9230947cbdfd50c7d8782a0c17d60.tar.gz
llvm-b833e5ac3fc9230947cbdfd50c7d8782a0c17d60.tar.bz2
llvm-b833e5ac3fc9230947cbdfd50c7d8782a0c17d60.tar.xz
Make ArgumentPromotion handle recursive functions that pass pointers in their recursive calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ArgumentPromotion')
-rw-r--r--test/Transforms/ArgumentPromotion/recursion.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/ArgumentPromotion/recursion.ll b/test/Transforms/ArgumentPromotion/recursion.ll
new file mode 100644
index 0000000000..a005b9ce04
--- /dev/null
+++ b/test/Transforms/ArgumentPromotion/recursion.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep x.val
+; ModuleID = 'recursive2.bc'
+
+implementation ; Functions:
+
+internal int %foo(int* %x) {
+entry:
+ %tmp.foo = load int* %x
+ ret int %tmp.foo
+}
+
+int %bar(int* %x) {
+entry:
+ %tmp3 = call int %foo( int* %x) ; <int>[#uses=1]
+ ret int %tmp3
+} \ No newline at end of file