Simplify cfg now eliminates all of the branches in this testcase
authorChris Lattner <sabre@nondot.org>
Fri, 9 Apr 2004 23:50:29 +0000 (23:50 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 Apr 2004 23:50:29 +0000 (23:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12803 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/SimplifyCFG/PhiEliminate2.ll [new file with mode: 0644]

diff --git a/test/Transforms/SimplifyCFG/PhiEliminate2.ll b/test/Transforms/SimplifyCFG/PhiEliminate2.ll
new file mode 100644 (file)
index 0000000..e93d293
--- /dev/null
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep br
+
+int %test(bool %C, int %V1, int %V2) {
+entry:
+        br bool %C, label %then, label %Cont
+
+then:
+        %V3 = or int %V2, %V1
+        br label %Cont
+Cont:
+       %V4 = phi int [%V1, %entry], [%V3, %then]
+       call int %test(bool false, int 0, int 0)           ;; don't fold into preds
+        ret int %V1
+}
+