aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-29 20:15:35 +0000
committerChris Lattner <sabre@nondot.org>2003-05-29 20:15:35 +0000
commit2cc36e69977b736c27d8b067c7deb9f6dc8e2912 (patch)
tree3fee8425d228d272089209ddbec102e361d72621
parent6cf7f6d43da7c327e4d2f89cd64588b0f756f8f3 (diff)
New testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6412 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest.ll32
-rw-r--r--test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest2.ll34
2 files changed, 66 insertions, 0 deletions
diff --git a/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest.ll b/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest.ll
new file mode 100644
index 0000000000..8ae3454571
--- /dev/null
+++ b/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest.ll
@@ -0,0 +1,32 @@
+; Test to make sure that SSA is correctly updated
+; RUN: as < %s | opt -cee
+;
+implementation ; Functions:
+
+int %test(int %A, int %B, bool %c0) {
+Start: ; No predecessors!
+ %c1 = seteq int %A, %B ; <bool> [#uses=1]
+ br bool %c1, label %Eq, label %Start_crit_edge
+
+Start_crit_edge: ; preds = %Start
+ br label %Loop
+
+Eq: ; preds = %Start
+ br label %Loop
+
+Loop: ; preds = %Bottom, %Eq, %Start_crit_edge
+ %Z = phi int [ %A, %Start_crit_edge ], [ %B, %Eq ], [ %Z, %Bottom ] ; <int> [#uses=2]
+ %c2 = setge int %A, %B ; <bool> [#uses=1]
+ br bool %c2, label %Forwarded, label %Loop_crit_edge
+
+Loop_crit_edge: ; preds = %Loop
+ br label %Bottom
+
+Forwarded: ; preds = %Loop
+ %Z2 = phi int [ %Z, %Loop ] ; <int> [#uses=1]
+ call int %test( int 0, int %Z2, bool true ) ; <int>:0 [#uses=0]
+ br label %Bottom
+
+Bottom: ; preds = %Forwarded, %Loop_crit_edge
+ br label %Loop
+}
diff --git a/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest2.ll b/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest2.ll
new file mode 100644
index 0000000000..732eb56f0f
--- /dev/null
+++ b/test/Transforms/CorrelatedExprs/2002-10-08-DominatorTest2.ll
@@ -0,0 +1,34 @@
+; Simple test to make sure dominators are updated properly
+; RUN: as < %s | opt -cee
+
+implementation ; Functions:
+
+int %test(int %A, int %B, bool %c0) {
+Start: ; No predecessors!
+ %c1 = seteq int %A, %B ; <bool> [#uses=1]
+ br bool %c1, label %Eq, label %Start_crit_edge
+
+Start_crit_edge: ; preds = %Start
+ br label %Loop
+
+Eq: ; preds = %Start
+ br label %Loop
+
+Loop: ; preds = %Bottom, %Eq, %Start_crit_edge
+ %Z = phi int [ %A, %Start_crit_edge ], [ %B, %Eq ];, [ %Z, %Bottom ] ; <int> [#uses=2]
+ %c2 = setge int %A, %B ; <bool> [#uses=1]
+ br bool %c2, label %Forwarded, label %Loop_crit_edge
+
+Loop_crit_edge: ; preds = %Loop
+ %X = seteq int %Z, 7
+ br bool %X, label %Forwarded, label %Bottom
+
+Forwarded: ; preds = %Loop
+ %Z2 = phi int [ %Z, %Loop ], [%Z, %Loop_crit_edge] ; <int> [#uses=1]
+ call int %test( int %Z, int %Z2, bool true ) ; <int>:0 [#uses=0]
+ br label %Bottom
+
+Bottom: ; preds = %Forwarded, %Loop_crit_edge
+ ret int %Z
+ ;br label %Loop
+}