summaryrefslogtreecommitdiff
path: root/test/Transforms/ArgumentPromotion/tail.ll
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-23 17:19:42 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-23 17:19:42 +0000
commit35b78fd04c4b1e2a0b648a2d5d0463cfa8f4c0ce (patch)
tree118156f3bfd080edcd31be4d0b5fdd50bb92e226 /test/Transforms/ArgumentPromotion/tail.ll
parent7d3b9d96b6405c1a0b6d1ae73d5a4a1d506d500d (diff)
downloadllvm-35b78fd04c4b1e2a0b648a2d5d0463cfa8f4c0ce.tar.gz
llvm-35b78fd04c4b1e2a0b648a2d5d0463cfa8f4c0ce.tar.bz2
llvm-35b78fd04c4b1e2a0b648a2d5d0463cfa8f4c0ce.tar.xz
Remove tail marker when changing an argument to an alloca.
Argument promotion can replace an argument of a call with an alloca. This requires clearing the tail marker as it is very likely that the callee is now using an alloca in the caller. This fixes pr14710. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ArgumentPromotion/tail.ll')
-rw-r--r--test/Transforms/ArgumentPromotion/tail.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/ArgumentPromotion/tail.ll b/test/Transforms/ArgumentPromotion/tail.ll
new file mode 100644
index 0000000000..e6bc557d9d
--- /dev/null
+++ b/test/Transforms/ArgumentPromotion/tail.ll
@@ -0,0 +1,19 @@
+; RUN: opt %s -argpromotion -S -o - | FileCheck %s
+
+%pair = type { i32, i32 }
+
+declare i8* @foo(%pair*)
+
+define internal void @bar(%pair* byval %Data) {
+; CHECK: define internal void @bar(i32 %Data.0, i32 %Data.1)
+; CHECK: %Data = alloca %pair
+; CHECK-NOT: tail
+; CHECK: call i8* @foo(%pair* %Data)
+ tail call i8* @foo(%pair* %Data)
+ ret void
+}
+
+define void @zed(%pair* byval %Data) {
+ call void @bar(%pair* byval %Data)
+ ret void
+}