summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-14 05:53:11 +0000
committerChris Lattner <sabre@nondot.org>2004-01-14 05:53:11 +0000
commitf6e180324e6ffef7489dc02bae32e8713a935611 (patch)
tree861a27311defa9bec97703dfd6dd7814c564eb35 /test
parentc9b0702a890c8afa3da413e42a3a7aa5bbd53e18 (diff)
downloadllvm-f6e180324e6ffef7489dc02bae32e8713a935611.tar.gz
llvm-f6e180324e6ffef7489dc02bae32e8713a935611.tar.bz2
llvm-f6e180324e6ffef7489dc02bae32e8713a935611.tar.xz
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
new file mode 100644
index 0000000000..c33f9e9e33
--- /dev/null
+++ b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
@@ -0,0 +1,24 @@
+; Test for a problem afflicting several C++ programs in the testsuite. The
+; instcombine pass is trying to get rid of the cast in the invoke instruction,
+; inserting a cast of the return value after the PHI instruction, but which is
+; used by the PHI instruction. This is bad: because of the semantics of the
+; invoke instruction, we really cannot perform this transformation at all at
+; least without splitting the critical edge.
+;
+; RUN: llvm-as < %s | opt -instcombine -disable-output
+
+declare sbyte* %test()
+
+int %foo() {
+entry:
+ br bool true, label %cont, label %call
+call:
+ %P = invoke int*()* cast (sbyte*()* %test to int*()*)()
+ to label %cont except label %N
+cont:
+ %P2 = phi int* [%P, %call], [null, %entry]
+ %V = load int* %P2
+ ret int %V
+N:
+ ret int 0
+}