diff options
| author | Cliff Click <cliffc@acm.org> | 2026-11-08 14:10:02 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-11-08 14:10:02 -0800 |
| commit | 06fb5aceeb65a75b1cd643debd667c52fdcafcb9 (patch) | |
| tree | c99813eaf27d98f840245302c4d6e923c964307e /chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java | |
| parent | 6560a92433a38825fd1d44d9c66ffba9f26990ff (diff) | |
| download | Simple-ch30.tar.gz Simple-ch30.zip | |
Better error messagesch30
Better error messages.
Buffs to the std lib; getch() to fetch a single character; streaming I/O handles retries, and large sizes, with better error reporting.
Formatted strings.
Default int moved to i32.
TicTacToe, the game.
Diffstat (limited to 'chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java')
| -rw-r--r-- | chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java b/chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java index 214bc69e..70cfe25e 100644 --- a/chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java +++ b/chapter30/src/test/java/com/seaofnodes/simple/Chapter13Test.java @@ -35,7 +35,7 @@ while( prime <= arg ) { return primeCount; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("return Phi(Region,0,Phi(Loop,1,Phi(Region,Phi_primeCount,Phi_primeCount,(Phi_primeCount+1))));", code.print()); + assertEquals("return Phi(Region,0,Phi(Loop,1,Phi(Region,Phi_primeCount,Phi_primeCount,(((Phi_primeCount+1)<<32)>>32))));", code.print()); assertEquals("0", Eval2.eval(code, 1)); // No primes 1 or below assertEquals("1", Eval2.eval(code, 2)); // 2 assertEquals("2", Eval2.eval(code, 3)); // 2, 3 @@ -116,7 +116,7 @@ if (v1) { return v0.f; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("return Phi(Region,.f,2);", code.print()); + assertEquals("return ((Phi(Region,((.f<<32)>>32),2)<<32)>>32);", code.print()); } @@ -134,7 +134,7 @@ while (arg) v.f = 2; return i; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("return arg;", code.print()); + assertEquals("return ((arg<<32)>>32);", code.print()); } @Test @@ -151,7 +151,7 @@ while(1) { return v.f; """); code.driver(CodeGen.Phase.FinalizeIR); - assertEquals("return Phi(Loop,0,2);", code.print()); + assertEquals("return ((Phi(Loop,0,2)<<32)>>32);", code.print()); for( int arg : new int[]{-1,0,1,3,100} ) assertEquals("0",Eval2.eval(code,arg)); } |
