summaryrefslogtreecommitdiff
path: root/chapter21/src/test
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-03-23 11:26:16 -0700
committerCliff Click <cliffc@acm.org>2025-03-23 11:26:16 -0700
commit0afb4876e602faa75319bb1faf9adc7f6f7476c2 (patch)
tree2f6477bd91e78fa58f6d92e5a67eeecd13d35917 /chapter21/src/test
parent3e17e811c4429cda194ccdb892ddb2bd10fa71ea (diff)
downloadSimple-0afb4876e602faa75319bb1faf9adc7f6f7476c2.tar.gz
Simple-0afb4876e602faa75319bb1faf9adc7f6f7476c2.zip
Correct golden spill counts
Encoding: bad test cutout required JMP AddIRISC bad edges during spill.
Diffstat (limited to 'chapter21/src/test')
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java6
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java10
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java6
3 files changed, 11 insertions, 11 deletions
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java
index 856baac4..28111697 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java
@@ -63,9 +63,9 @@ for( int pc = 0; pc < program#; pc++ ) {
}
return output;
""";
- Chapter21Test.testCPU(src,"x86_64_v2", "SystemV",28,null);
- Chapter21Test.testCPU(src,"riscv" , "SystemV",12,null);
- Chapter21Test.testCPU(src,"arm" , "SystemV",12,null);
+ Chapter21Test.testCPU(src,"x86_64_v2", "SystemV",40,null);
+ Chapter21Test.testCPU(src,"riscv" , "SystemV",30,null);
+ Chapter21Test.testCPU(src,"arm" , "SystemV",30,null);
//assertEquals("Hello World!\n", Eval2.eval(code, 0, 10000));
}
}
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
index 9d780b57..cb55c033 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
@@ -57,16 +57,16 @@ public class Chapter21Test {
public void testString() throws IOException {
String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/stringHash.smp"));
testCPU(src,"x86_64_v2", "SystemV",18,null);
- testCPU(src,"riscv" , "SystemV", 3,null);
- testCPU(src,"arm" , "SystemV", 3,null);
+ testCPU(src,"riscv" , "SystemV",18,null);
+ testCPU(src,"arm" , "SystemV",17,null);
}
@Test
public void testArray1() throws IOException {
String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/array1.smp"));
- testCPU(src,"x86_64_v2", "SystemV",3,"return .[];");
- testCPU(src,"riscv" , "SystemV",1,"return (add,.[],(mul,.[],1000));");
- testCPU(src,"arm" , "SystemV",1,"return (add,.[],(mul,.[],1000));");
+ testCPU(src,"x86_64_v2", "SystemV",7,"return .[];");
+ testCPU(src,"riscv" , "SystemV",9,"return (add,.[],(mul,.[],1000));");
+ testCPU(src,"arm" , "SystemV",5,"return (add,.[],(mul,.[],1000));");
}
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java b/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java
index c83fe089..bf775b4f 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/MergeSortTest.java
@@ -58,9 +58,9 @@ merge_sort(a, b, a#);
return a;
""";
- Chapter20Test.testCPU(src,"x86_64_v2", "SystemV",46,"Stop[ return mov(mov([int])); return 0; ]");
- Chapter20Test.testCPU(src,"riscv" , "SystemV",36,"Stop[ return mov(mov([int])); return 0; ]");
- Chapter20Test.testCPU(src,"arm" , "SystemV",37,"Stop[ return mov(mov([int])); return 0; ]");
+ Chapter20Test.testCPU(src,"x86_64_v2", "SystemV",54,"Stop[ return mov(mov([int])); return 0; ]");
+ Chapter20Test.testCPU(src,"riscv" , "SystemV",44,"Stop[ return mov(mov([int])); return 0; ]");
+ Chapter20Test.testCPU(src,"arm" , "SystemV",44,"Stop[ return mov(mov([int])); return 0; ]");
//assertEquals("int[ 1,2,3,4,5,6,7,8,9,10,11]", Eval2.eval(code, 11));
}