summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/TailCallElim
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-10-05 20:05:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-10-05 20:05:13 +0000
commit79d0c4f4b098bf27a16e8071b2b981fc30d34200 (patch)
treecb9662e125abef5819853033c913524d072395cc /llvm/test/Transforms/TailCallElim
parente37e0301372667edae46092b5bef93a6cd3e0e3a (diff)
downloadbcm5719-llvm-79d0c4f4b098bf27a16e8071b2b981fc30d34200.tar.gz
bcm5719-llvm-79d0c4f4b098bf27a16e8071b2b981fc30d34200.zip
Check for the returns_twice attribute in callsFunctionThatReturnsTwice. This
fixes PR11038, but there are still some cleanups to be done. llvm-svn: 141204
Diffstat (limited to 'llvm/test/Transforms/TailCallElim')
-rw-r--r--llvm/test/Transforms/TailCallElim/setjmp.ll21
1 files changed, 17 insertions, 4 deletions
diff --git a/llvm/test/Transforms/TailCallElim/setjmp.ll b/llvm/test/Transforms/TailCallElim/setjmp.ll
index 35bb75dddb3..7ef9cb360f5 100644
--- a/llvm/test/Transforms/TailCallElim/setjmp.ll
+++ b/llvm/test/Transforms/TailCallElim/setjmp.ll
@@ -1,16 +1,29 @@
; RUN: opt < %s -tailcallelim -S | FileCheck %s
-; Test that we don't tail call in a functions that calls setjmp.
+; Test that we don't tail call in a functions that calls returns_twice
+; functions.
+declare void @bar()
+
+; CHECK: foo1
; CHECK-NOT: tail call void @bar()
-define void @foo(i32* %x) {
+define void @foo1(i32* %x) {
bb:
%tmp75 = tail call i32 @setjmp(i32* %x)
call void @bar()
ret void
}
-declare i32 @setjmp(i32*) returns_twice
+declare i32 @setjmp(i32*)
-declare void @bar()
+; CHECK: foo2
+; CHECK-NOT: tail call void @bar()
+
+define void @foo2(i32* %x) {
+bb:
+ %tmp75 = tail call i32 @zed2(i32* %x)
+ call void @bar()
+ ret void
+}
+declare i32 @zed2(i32*) returns_twice
OpenPOWER on IntegriCloud