summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-04-17 10:00:59 -0700
committerCliff Click <cliffc@acm.org>2025-04-17 10:00:59 -0700
commite8e8335258b85f95f24ac506f770fbdd08f4a083 (patch)
treeab16688f4391afba836475c4f9a339ca04b2c606
parent71835b1cc3d597234e7fb50e7ddddf2b20cf10e2 (diff)
downloadSimple-e8e8335258b85f95f24ac506f770fbdd08f4a083.tar.gz
Simple-e8e8335258b85f95f24ac506f770fbdd08f4a083.zip
win64 spills more than sys5
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
index 1d37deb0..74c0d42d 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
@@ -90,8 +90,8 @@ public class Chapter21Test {
EvalRisc5 R5 = TestRisc5.build("newtonFloat", 0, 10);
R5.fregs[riscv.FA0 - riscv.F_OFFSET] = 3.0;
- int trap = R5.step(1000);
- assertEquals(0,trap);
+ int trap_r5 = R5.step(1000);
+ assertEquals(0,trap_r5);
// Return register A0 holds fib(8)==55
assertEquals(1.732051,R5.fregs[riscv.FA0 - riscv.F_OFFSET], 0.00001);
@@ -174,9 +174,13 @@ public class Chapter21Test {
assertEquals(17+1,R5.ld8(p1));
assertEquals(60+0,R5.ld8(p2));
}
+
@Test public void testArgCount() throws IOException {
+ // Test passes more args than registers in Sys5, which is far far more
+ // than what Win64 allows - so Win64 gets a lot more spills here.
String arg_count = "191.000000\n";
- TestC.run("arg_count", arg_count, 42);
+ TestC.run("arg_count", arg_count,
+ TestC.CALL_CONVENTION.equals("Win64") ? 42 : 15);
EvalRisc5 R5 = TestRisc5.build("no_stack_arg_count", 0, 0);