aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit11f1a8335e207971f66eb60609e16b8719be5450 (patch)
treed9e3c481fd4599da0d3a9c39accba9b51ce5599a /test/Transforms/TailCallElim
parent30c1ff234d30567fc20d6c41d8fd9c3aacbbf9ca (diff)
downloadexternal_llvm-11f1a8335e207971f66eb60609e16b8719be5450.zip
external_llvm-11f1a8335e207971f66eb60609e16b8719be5450.tar.gz
external_llvm-11f1a8335e207971f66eb60609e16b8719be5450.tar.bz2
Check for the returns_twice attribute in callsFunctionThatReturnsTwice. This
fixes PR11038, but there are still some cleanups to be done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/TailCallElim')
-rw-r--r--test/Transforms/TailCallElim/setjmp.ll21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/Transforms/TailCallElim/setjmp.ll b/test/Transforms/TailCallElim/setjmp.ll
index 35bb75d..7ef9cb3 100644
--- a/test/Transforms/TailCallElim/setjmp.ll
+++ b/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