From 1741cb3039555b1446a1b0c1c3768f3763a0d9e6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 5 Apr 2025 11:30:35 -0700 Subject: Add in-memory linker Encoding supports writing cpool to either Elf or in memory ElfFile writes constant pool --- chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java | 5 ++--- chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'chapter21/src/test/java') diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java index 21e6c777..99daae7d 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java @@ -61,11 +61,10 @@ return x2; {int -> int}? sq = { int x -> x*x; }; -return sq; """); code.parse().opto(); - assertEquals("Stop[ return { sq}; return (Parm_x(sq,int)*x); ]", code._stop.toString()); - assertEquals("{ int -> int #1}", Eval2.eval(code, 3)); + assertEquals("return (Parm_x(sq,int)*x);", code._stop.toString()); + //assertEquals("{ int -> int #1}", Eval2.eval(code, 3)); } @Test diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java index 066cd3d4..08b7c9d5 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java @@ -78,8 +78,8 @@ public class Chapter21Test { @Test public void testExport() throws IOException { - String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/newtonFloat.smp")) - + "flt farg = arg; return sqrt(farg) + sqrt(farg+2.0);"; + String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/newtonFloat.smp")); + //+ "flt farg = arg; return sqrt(farg) + sqrt(farg+2.0);"; CodeGen code = new CodeGen(src); code.parse().opto().typeCheck().instSelect( "x86_64_v2", "SystemV").GCM().localSched().regAlloc().encode().exportELF("build/objs/newton.o"); } -- cgit v1.2.3