aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorScott Graham <[email protected]>2026-01-08 12:32:59 -0800
committerQuentin Carbonneaux <[email protected]>2026-01-13 18:47:58 +0100
commitb3b6d8ba0b33693f406a314d2dd10c68400cd8a4 (patch)
treec9d69aa8c23a020cef330d1c8e1e403c77078269 /test
parentb6545e90d85176235e179a7f74caefded4b15c42 (diff)
winabi: fix allocation of parameters to regs with hidden argwinabi
In the presence of the hidden arg for return-by-value, the registers used for natural arguments were incorrect. (This should be applied on the 'winabi' branch.)
Diffstat (limited to 'test')
-rw-r--r--test/abi9.ssa20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/abi9.ssa b/test/abi9.ssa
new file mode 100644
index 0000000..cb70028
--- /dev/null
+++ b/test/abi9.ssa
@@ -0,0 +1,20 @@
+type :obj = { l, l, l, l }
+
+export
+function :obj $f(l %self) {
+@_0
+ %_1 =l alloc8 16
+ storel 77, %_1
+ ret %_1
+}
+
+# >>> driver
+# #include <stdio.h>
+# typedef struct { long long a, b, c, d; } obj;
+# extern obj f();
+# int main() { obj ret = f(); printf("%lld\n", ret.a); return 0; }
+# <<<
+
+# >>> output
+# 77
+# <<<