From 0b263f550d5e54d050f58f6b315b092944c9eff9 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 10 Aug 2026 11:11:18 -0700 Subject: Chapter 32: Compiler Internal Speedups Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki Co-authored-by: Claude Opus 5 --- src/test/java/com/seaofnodes/simple/Chapter10Test.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/test/java/com/seaofnodes/simple/Chapter10Test.java') diff --git a/src/test/java/com/seaofnodes/simple/Chapter10Test.java b/src/test/java/com/seaofnodes/simple/Chapter10Test.java index 559def2f..13950789 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter10Test.java +++ b/src/test/java/com/seaofnodes/simple/Chapter10Test.java @@ -197,7 +197,9 @@ while (arg) { return bar.a; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("Stop[ return ((Phi(Loop,0,(Sar+2))<<32)>>32); return Test.Bar; ]", code.print()); + assertEquals("Stop[ return Phi(Loop,0,(((Phi_a+2)<<32)>>32)); return Test.Bar; ]", code.print()); + assertEquals("0",Eval2.eval(code,0)); + assertEquals("6",Eval2.eval(code,-3)); } @Test @@ -319,7 +321,9 @@ while( i.x < i.len ) { return sum; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("Stop[ return Phi(Loop,0,(((Phi_sum+((Phi(Loop,0,(((Sar+1)<<32)>>32))<<32)>>32))<<32)>>32)); return Test.Iter; ]", code.print()); + assertEquals("Stop[ return Phi(Loop,0,(((Phi_sum+((Phi(Loop,0,(Sar+1))<<32)>>32))<<32)>>32)); return Test.Iter; ]", code.print()); + assertEquals("0",Eval2.eval(code,0)); + assertEquals("45",Eval2.eval(code,10)); } -- cgit v1.2.3