summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter12Test.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-06-13 15:42:08 -0700
committerCliff Click <cliffc@acm.org>2026-10-24 15:56:44 -0700
commit89dd0a79da85b2c7102b7c8918a1466e6238fe94 (patch)
treecfa3d1457e9c40ad79ae78ded15c7c2ff286d79d /src/test/java/com/seaofnodes/simple/Chapter12Test.java
parent8309071562b63f77a15425ab2146e05dbcb5acfd (diff)
downloadSimple-linear-chapter24a.tar.gz
Simple-linear-chapter24a.zip
Chapter 24a: SCCP Within a Functionlinear-chapter24a
Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki <jun784@gmail.com> Co-authored-by: Hadházy Tamás <helsgithub15@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter12Test.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/Chapter12Test.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter12Test.java b/src/test/java/com/seaofnodes/simple/Chapter12Test.java
index 4026ea8b..2ef209c5 100644
--- a/src/test/java/com/seaofnodes/simple/Chapter12Test.java
+++ b/src/test/java/com/seaofnodes/simple/Chapter12Test.java
@@ -14,7 +14,7 @@ public class Chapter12Test {
"""
return 3.14;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return 3.14;", code.print());
assertEquals("3.14", Eval2.eval(code, 0));
}
@@ -75,7 +75,7 @@ i0.f = f0;
f0.i = i0;
return f0.i.f.i.i;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return 17;", code.print());
}
@@ -87,7 +87,7 @@ struct N { !N? !next; int i; };
N n = new N;
return n.next;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return null;", code.print());
}
@@ -100,7 +100,7 @@ struct N { !M !next; int i; };
N n = new N { next = new M; };
return n.next;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return (const)M;", code.print());
}
@@ -150,7 +150,7 @@ return n.i;
struct S{};
return 0;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return 0;", code.print());
assertEquals("0", Eval2.eval(code, 0));
}
@@ -162,7 +162,7 @@ return 0;
struct S1 { !S2? !s; };
return new S2;
""");
- try { code.parse().iter().finalizeIR(); fail(); }
+ try { code.driver(CodeGen.Phase.FinalizeIR); fail(); }
catch( Exception e ) { assertEquals("Unknown struct type 'S2'",e.getMessage()); }
}
@@ -174,7 +174,7 @@ struct S1 { !S2? !s; };
struct S2 { int x; };
return new S1.s=new S2;
""");
- code.parse().iter().finalizeIR();
+ code.driver(CodeGen.Phase.FinalizeIR);
assertEquals("return S2;", code.print());
}