summaryrefslogtreecommitdiffstats
path: root/test/Transforms/TailCallElim/setjmp.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/TailCallElim/setjmp.ll')
-rw-r--r--test/Transforms/TailCallElim/setjmp.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/TailCallElim/setjmp.ll b/test/Transforms/TailCallElim/setjmp.ll
new file mode 100644
index 0000000..7b7fe56
--- /dev/null
+++ b/test/Transforms/TailCallElim/setjmp.ll
@@ -0,0 +1,16 @@
+; RUN: opt < %s -tailcallelim -S | FileCheck %s
+
+; Test that we don't tail call in a functions that calls setjmp.
+
+; CHECK-NOT: tail call void @bar()
+
+define void @foo(i32* %x) {
+bb:
+ %tmp75 = tail call i32 @setjmp(i32* %x)
+ call void @bar()
+ ret void
+}
+
+declare i32 @setjmp(i32*)
+
+declare void @bar()
OpenPOWER on IntegriCloud