summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-11-08 14:10:02 -0800
commit44505aa5b75b1046f13f2bc2a52fe0b16d975838 (patch)
treecc558485c807ac3842cd73943cf5e294c4a307de /src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java
parent2560096fb4636263798ae56c88687973c72cdf6e (diff)
downloadSimple-linear-chapter30.tar.gz
Simple-linear-chapter30.zip
Chapter 30: Text Formatting and Diagnosticslinear-chapter30
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 <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java b/src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java
index cfc0b7e0..1853aa48 100644
--- a/src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java
+++ b/src/test/java/com/seaofnodes/simple/SeparateCompilationTest.java
@@ -18,9 +18,9 @@ public class SeparateCompilationTest {
val run={int n ->
val power={int base,int exponent ->
if(exponent<=0) return 1;
- return base*power(base,exponent-1);
+ return base*power(base,--exponent);
};
- { {int int -> int} -> int } retain="C";
+ { {int int -> i64} -> int } retain="C";
retain(power);
return power(2,n);
};
@@ -28,14 +28,14 @@ public class SeparateCompilationTest {
new CodeGen(null,lib.toString(),null,"Callbacks",src,123,true,TypeInteger.BOT)
.driver(TestC.CPU_PORT,TestC.CALL_CONVENTION,false,false);
CodeGen code=new CodeGen(null,null,new Ary<>(new String[]{lib.toString()}),
- "Client","return Callbacks.run(arg);",123,true,TypeInteger.BOT)
+ "Client","return Callbacks.run(((arg<<32)>>32));",123,true,TypeInteger.BOT)
.driver(CodeGen.Phase.Opto);
// This assertion inspects a body, not just its saved summary.
ParseAll.loadCompUnit(code,code._compunits.get("Callbacks"));
assertNull(code._compunits.get("Callbacks")._src);
ParmNode base=code._start.walk(n -> n instanceof ParmNode p && p._label.equals("base") ? p : null);
assertNotNull(base);
- assertSame("Native code may call the saved callback with any base",TypeInteger.BOT,base._type);
+ assertSame("Native code may call the saved callback with any base",TypeInteger.I32,base._type);
code.driver(CodeGen.Phase.TypeCheck);
}