summaryrefslogtreecommitdiff
path: root/test/Other/2002-02-24-InlineBrokePHINodes.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-25 00:34:18 +0000
committerChris Lattner <sabre@nondot.org>2002-02-25 00:34:18 +0000
commit664c953b39b5bc3c2e6cf3feb5bb4ea92355d886 (patch)
treec5d826c6b809484bac5de2da008f5bb1ef635208 /test/Other/2002-02-24-InlineBrokePHINodes.ll
parent41b66b12e8be5024b0d8506b5b61a425a2becd49 (diff)
downloadllvm-664c953b39b5bc3c2e6cf3feb5bb4ea92355d886.tar.gz
llvm-664c953b39b5bc3c2e6cf3feb5bb4ea92355d886.tar.bz2
llvm-664c953b39b5bc3c2e6cf3feb5bb4ea92355d886.tar.xz
Testcase for new bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other/2002-02-24-InlineBrokePHINodes.ll')
-rw-r--r--test/Other/2002-02-24-InlineBrokePHINodes.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Other/2002-02-24-InlineBrokePHINodes.ll b/test/Other/2002-02-24-InlineBrokePHINodes.ll
new file mode 100644
index 0000000000..58e1b8c5f9
--- /dev/null
+++ b/test/Other/2002-02-24-InlineBrokePHINodes.ll
@@ -0,0 +1,26 @@
+; Inlining used to break PHI nodes. This tests that they are correctly updated
+; when a node is split around the call instruction. The verifier caught the error.
+;
+; RUN: as < %s | opt -inline -verify
+;
+implementation
+
+ulong "test"(ulong %X)
+begin
+ ret ulong %X
+end
+
+ulong "fib"(ulong %n)
+begin
+ %T = setlt ulong %n, 2 ; {bool}:0
+ br bool %T, label %BaseCase, label %RecurseCase
+
+RecurseCase:
+ %result = call ulong %test(ulong %n)
+ br label %BaseCase
+
+BaseCase:
+ %X = phi ulong [1, %0], [2, %RecurseCase]
+ ret ulong %X
+end
+