diff options
| author | Cliff Click <cliffc@acm.org> | 2025-04-05 11:30:35 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-04-05 11:30:35 -0700 |
| commit | 1741cb3039555b1446a1b0c1c3768f3763a0d9e6 (patch) | |
| tree | 76c0e7fe8ac67225d65013c9f86cc44d3a58f080 /chapter21/src/test/java/com | |
| parent | 631b699a4cf65f6c91a24df49329bb285aec09fc (diff) | |
| download | Simple-1741cb3039555b1446a1b0c1c3768f3763a0d9e6.tar.gz Simple-1741cb3039555b1446a1b0c1c3768f3763a0d9e6.zip | |
Add in-memory linker
Encoding supports writing cpool to either Elf or in memory
ElfFile writes constant pool
Diffstat (limited to 'chapter21/src/test/java/com')
| -rw-r--r-- | chapter21/src/test/java/com/seaofnodes/simple/Chapter18Test.java | 5 | ||||
| -rw-r--r-- | chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java | 4 |
2 files changed, 4 insertions, 5 deletions
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"); } |
