summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter11Test.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2024-07-17 18:11:56 +0100
committerCliff Click <cliffc@acm.org>2024-10-23 17:51:09 -0700
commita080ea0774887141c26e38e57355e5520c49396a (patch)
treef88ffba2da6c662ddc5f245ca1e364d1128f787f /src/test/java/com/seaofnodes/simple/Chapter11Test.java
parentdc77490c735104497851ed8c12ae5c713ab05b04 (diff)
downloadSimple-linear-chapter12.tar.gz
Simple-linear-chapter12.zip
Chapter 12: Floatslinear-chapter12
Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Co-authored-by: Thalia Archibald <thalia@archibald.dev> 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.java42
1 files changed, 4 insertions, 38 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter11Test.java b/src/test/java/com/seaofnodes/simple/Chapter11Test.java
index fdf56b56..a8b09226 100644
--- a/src/test/java/com/seaofnodes/simple/Chapter11Test.java
+++ b/src/test/java/com/seaofnodes/simple/Chapter11Test.java
@@ -292,7 +292,7 @@ else {
}
""");
StopNode stop = parser.parse().iterate();
- assertEquals("Stop[ return 9; return 0; return 0; ]", stop.toString());
+ assertEquals("Stop[ return 9; return 0; return 0; return 0; return 0; ]", stop.toString());
}
@@ -434,7 +434,7 @@ while(1)
arg = arg+ptr.v;
""");
StopNode stop = parser.parse().iterate();
- assertEquals("return 0;", stop.toString());
+ assertEquals("Stop[ return 0; return 0; ]", stop.toString());
}
@Test
@@ -496,7 +496,7 @@ return v;
@Test
public void testExample2() {
Parser parser = new Parser(
- """
+ """
struct S { int f; }
S v = new S;
int i = arg;
@@ -507,7 +507,7 @@ while (arg > 0) {
arg = arg - 1;
}
return v;
-""");
+ """);
StopNode stop = parser.parse().iterate();
//assertEquals("return new S;", stop.toString());
}
@@ -528,38 +528,4 @@ return s.f;
assertEquals(1L, Evaluator.evaluate(stop, 1));
assertEquals(0L, Evaluator.evaluate(stop, 2));
}
-
- @Test
- public void testScheduleUse() {
- Parser parser = new Parser(
-"""
-int v0=0;
-while(0>=0) {
- int v1=0;
- v1=v0;
- if(v1*0)
- v0=-v1;
-}
-return 0;
-""");
- StopNode stop = parser.parse().iterate();
- assertEquals("return 0;", stop.toString());
- }
-
- @Test
- public void testLoopCarriedDep() {
- Parser parser = new Parser(
-"""
-int v0=0;
-{
- int v1=0;
- while(v1) {
- v1=1+(v0!=0);
- v0=v1/0;
- }
-}
-""");
- StopNode stop = parser.parse().iterate();
- assertEquals("return 0;", stop.toString());
- }
}