From d7444a70ca43db00b75a3a2b81e5fa49b73410e1 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 2 May 2025 15:18:50 -0700 Subject: Add nested classes; string constants, static var lookup. Add alignment math. Pick up extern names at call sites Partial add constant TMP from cpool. Add constant arrays and singleton TMPs. --- .../java/com/seaofnodes/simple/Chapter22Test.java | 2 +- .../com/seaofnodes/simple/progs/helloWorld.smp | 2 +- .../test/java/com/seaofnodes/simple/progs/jig.smp | 23 +++++++++------------- 3 files changed, 11 insertions(+), 16 deletions(-) (limited to 'chapter22/src/test/java') diff --git a/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java b/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java index 0cf7f254..3bf379cd 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java +++ b/chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java @@ -51,7 +51,7 @@ return cc.cz; @Test @Ignore public void testHelloWorld() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/helloWorld.smp")); - TestC.run(src,TestC.CALL_CONVENTION,null,null,"build/objs/helloWorld","","Hello, World!",0); + TestC.run(src,TestC.CALL_CONVENTION,null,null,"build/objs/helloWorld","","Hello, World!",13); } diff --git a/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp b/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp index 97400501..16ef4bc6 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp +++ b/chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp @@ -1,2 +1,2 @@ // -*- mode: java; -*- -return sys.libc.write(1,"Hello, World!\n",14); +return sys.libc.write(1,"Hello, World!",13); diff --git a/chapter22/src/test/java/com/seaofnodes/simple/progs/jig.smp b/chapter22/src/test/java/com/seaofnodes/simple/progs/jig.smp index 073200e3..b3bbf722 100644 --- a/chapter22/src/test/java/com/seaofnodes/simple/progs/jig.smp +++ b/chapter22/src/test/java/com/seaofnodes/simple/progs/jig.smp @@ -1,15 +1,10 @@ // -*- mode: java; -*- -//8942465726750756914 -while(0) { - struct s0 { - byte v0; - i32 v1; - i8 v2; - }; - s0 !JHRiBybfX=new s0; - while(1<