From ed22ac30eaf0dd2d0347637ac4f8d598c087fab1 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 7 Feb 2025 09:12:14 -0800 Subject: Chapter 20: Graph Coloring Register Allocation --- src/test/java/com/seaofnodes/simple/Chapter20Test.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/java/com/seaofnodes/simple/Chapter20Test.java (limited to 'src/test/java/com') diff --git a/src/test/java/com/seaofnodes/simple/Chapter20Test.java b/src/test/java/com/seaofnodes/simple/Chapter20Test.java new file mode 100644 index 00000000..48458f95 --- /dev/null +++ b/src/test/java/com/seaofnodes/simple/Chapter20Test.java @@ -0,0 +1,17 @@ +package com.seaofnodes.simple; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class Chapter20Test { + + @Test + public void testJig() { + CodeGen code = new CodeGen(""" +return 0; +"""); + code.parse().opto().typeCheck(); + assertEquals("return 0;", code._stop.toString()); + assertEquals("0", Eval2.eval(code, 2)); + } +} -- cgit v1.2.3