summaryrefslogtreecommitdiff
path: root/chapter22/src/test
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-05-02 15:18:50 -0700
committerCliff Click <cliffc@acm.org>2025-05-02 15:18:50 -0700
commitd7444a70ca43db00b75a3a2b81e5fa49b73410e1 (patch)
treed3dd70bff6cd6ca32613b70cf6218e1e73967f0f /chapter22/src/test
parentaf3586252ed3332722ae9eb8133b74f485a420ef (diff)
downloadSimple-d7444a70ca43db00b75a3a2b81e5fa49b73410e1.tar.gz
Simple-d7444a70ca43db00b75a3a2b81e5fa49b73410e1.zip
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.
Diffstat (limited to 'chapter22/src/test')
-rw-r--r--chapter22/src/test/java/com/seaofnodes/simple/Chapter22Test.java2
-rw-r--r--chapter22/src/test/java/com/seaofnodes/simple/progs/helloWorld.smp2
-rw-r--r--chapter22/src/test/java/com/seaofnodes/simple/progs/jig.smp23
3 files changed, 11 insertions, 16 deletions
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<<JHRiBybfX.v2) {}
- int v3=JHRiBybfX.v1;
- while(JHRiBybfX.v2)
- v3=JHRiBybfX.v0;
-}
-return 0; \ No newline at end of file
+struct s0 {
+ u16 v0;
+ i16 v3;
+ u32 v5;
+};
+return new s0.v3;
+if(0)
+ while(new s0.v5+new s0.v5) return 0;
+return new s0.v0;