summaryrefslogtreecommitdiff
path: root/chapter11/src/test/java/com/seaofnodes
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-10-04 13:30:41 -0700
committerCliff Click <cliffc@acm.org>2026-10-04 13:30:41 -0700
commita4994371c0b0fbea9d2802acc22d9cc3977a0de0 (patch)
tree98fd05869028a931f5ec8cf503b5cdf6b6c52e87 /chapter11/src/test/java/com/seaofnodes
parent9149ea7a50c564856bd09633f38d980e8230c34f (diff)
downloadSimple-readme.tar.gz
Simple-readme.zip
Slides for 2026 REBASEreadme
Diffstat (limited to 'chapter11/src/test/java/com/seaofnodes')
-rw-r--r--chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java b/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java
index 8bf1debe..9a5e4677 100644
--- a/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java
+++ b/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java
@@ -290,7 +290,8 @@ while( i.x < i.len ) {
return sum;
""");
StopNode stop = parser.parse().iterate();
- assertEquals("return Phi(Loop16,0,(Phi(Loop,0,(Phi_x+1))+Phi_sum));", stop.toString());
+ assertEquals("return Phi(Loop16,0,(Phi(Loop,0,(Phi_$2+1))+Phi_sum));", stop.toString());
+ assertEquals(10L,Evaluator.evaluate(stop,5));
}
@@ -549,8 +550,8 @@ return 0;
if (arg) s.x=arg+1; else s.x=arg+2;
return s;
""").parse().iterate();
- // The initializing slice also remains live as the aggregate default.
- assertEquals(2,countMemoryNodes(stop,StoreNode.class,new BitSet()));
+ // Releasing the old aggregate exposes the overwritten initializing Store.
+ assertEquals(1,countMemoryNodes(stop,StoreNode.class,new BitSet()));
assertEquals(2L,((Evaluator.Obj)Evaluator.evaluate(stop,0)).fields()[0]);
assertEquals(4L,((Evaluator.Obj)Evaluator.evaluate(stop,3)).fields()[0]);
}