summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter11Test.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-08-05 16:15:27 -0700
committerCliff Click <cliffc@acm.org>2024-10-23 17:51:09 -0700
commit0b76dcf4048533e1adc44ca4b67f3228e9719530 (patch)
tree44e361dbeb7cbc8a0436054abf7f93fcec716eff /src/test/java/com/seaofnodes/simple/Chapter11Test.java
parenta080ea0774887141c26e38e57355e5520c49396a (diff)
downloadSimple-linear-chapter13.tar.gz
Simple-linear-chapter13.zip
Chapter 13: Referenceslinear-chapter13
Co-authored-by: Thalia Archibald <thalia@archibald.dev> Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter11Test.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/Chapter11Test.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter11Test.java b/src/test/java/com/seaofnodes/simple/Chapter11Test.java
index a8b09226..da0bc087 100644
--- a/src/test/java/com/seaofnodes/simple/Chapter11Test.java
+++ b/src/test/java/com/seaofnodes/simple/Chapter11Test.java
@@ -291,7 +291,7 @@ else {
}
}
""");
- StopNode stop = parser.parse().iterate();
+ StopNode stop = parser.parse().iterate(false);
assertEquals("Stop[ return 9; return 0; return 0; return 0; return 0; ]", stop.toString());
}
@@ -324,7 +324,7 @@ while( prime <= arg ) {
return primeCount;
""");
StopNode stop = parser.parse().iterate();
- assertEquals("Stop[ return 0; return Phi(Loop19,1,Phi(Region81,Phi_primeCount,Phi(Region76,(Phi_primeCount+1),Phi_primeCount))); ]", stop.toString());
+ assertEquals("Stop[ return 0; return Phi(Loop20,1,Phi(Region87,Phi_primeCount,Phi(Region81,(Phi_primeCount+1),Phi_primeCount))); ]", stop.toString());
assertEquals(0L, Evaluator.evaluate(stop, 1)); // No primes 1 or below
assertEquals(1L, Evaluator.evaluate(stop, 2)); // 2
assertEquals(2L, Evaluator.evaluate(stop, 3)); // 2, 3
@@ -366,7 +366,7 @@ if (arg) {
return i;
""");
StopNode stop = parser.parse().iterate();
- assertEquals("return Phi(Region31,.f,0);", stop.toString());
+ assertEquals("return Phi(Region34,.f,0);", stop.toString());
}
@Test
@@ -451,7 +451,7 @@ while (arg) {
}
return i;
""");
- StopNode stop = parser.parse().iterate();
+ StopNode stop = parser.parse().iterate(false);
assertEquals("return .f;", stop.toString());
}
@@ -471,8 +471,8 @@ while(arg) {
}
return arg;
""");
- StopNode stop = parser.parse().iterate();
- assertEquals("return Phi(Loop13,arg,Phi(Region35,.f,0));", stop.toString());
+ StopNode stop = parser.parse().iterate(false);
+ assertEquals("return Phi(Loop15,arg,Phi(Region37,.f,0));", stop.toString());
}
@Test
@@ -489,7 +489,7 @@ if (arg) {
}
return v;
""");
- StopNode stop = parser.parse().iterate();
+ StopNode stop = parser.parse().iterate(false);
assertEquals("return new S;", stop.toString());
}
@@ -523,7 +523,7 @@ else if (arg == 1) s.f = 1;
return s.f;
""");
StopNode stop = parser.parse().iterate();
- assertEquals("return Phi(Region35,1,Phi(Region33,1,0));", stop.toString());
+ assertEquals("return Phi(Region37,1,Phi(Region35,1,0));", stop.toString());
assertEquals(1L, Evaluator.evaluate(stop, 0));
assertEquals(1L, Evaluator.evaluate(stop, 1));
assertEquals(0L, Evaluator.evaluate(stop, 2));