diff options
| author | Cliff Click <cliffc@acm.org> | 2025-04-12 11:41:58 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-04-12 11:41:58 -0700 |
| commit | d08925c1ff212e2157356eacbd748e679b80954d (patch) | |
| tree | 5761010cf6fba6101734a3bb6f806fdf3841210b /chapter21/src/test/java/com/seaofnodes | |
| parent | 798bd959410eb6c2e0b9f7ae1222181ac2b295d4 (diff) | |
| download | Simple-d08925c1ff212e2157356eacbd748e679b80954d.tar.gz Simple-d08925c1ff212e2157356eacbd748e679b80954d.zip | |
2 more encoding bugs
Missing constant NIL, arm CAST
Diffstat (limited to 'chapter21/src/test/java/com/seaofnodes')
| -rw-r--r-- | chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java | 8 | ||||
| -rw-r--r-- | chapter21/src/test/java/com/seaofnodes/simple/progs/antiDep1.smp | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java index 0610d294..e584f9bc 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java @@ -64,6 +64,14 @@ public class Chapter21Test { testCPU(src,"arm" , "SystemV",19,null); } + @Test + public void testAntiDeps1() throws IOException { + String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/antiDep1.smp")); + testCPU(src,"x86_64_v2", "SystemV", 3,"return mov(mov(S));"); + testCPU(src,"riscv" , "SystemV",10,"return mov(mov(S));"); + testCPU(src,"arm" , "SystemV",10,"return mov(mov(S));"); + } + @Test public void testNewtonExport() throws IOException { String result = """ 0 0.000000 diff --git a/chapter21/src/test/java/com/seaofnodes/simple/progs/antiDep1.smp b/chapter21/src/test/java/com/seaofnodes/simple/progs/antiDep1.smp new file mode 100644 index 00000000..b18dfd16 --- /dev/null +++ b/chapter21/src/test/java/com/seaofnodes/simple/progs/antiDep1.smp @@ -0,0 +1,11 @@ +// -*- mode: java; -*- +struct S { int f; }; +var v0 = new S; +S? v1; +if (arg) v1 = new S; +if (v1) { + v0.f = v1.f; +} else { + v0.f = 2; +} +return v0; |
