summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2021-10-17 20:56:25 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2021-10-17 21:03:03 +0200
commit503c672d47695afe62fdf3439732ec96a68903b0 (patch)
tree6a96cbb912b0b68b58a869ec1bc41757a439d43d /test
parent462e49fd5c8ff82a341212d9a66621727c70fe1d (diff)
downloadroux-503c672d47695afe62fdf3439732ec96a68903b0.tar.gz
amd64/sysv: unbreak env calls
Env calls were disfunctional from the
start. This fixes them on amd64, but
they remain to do on arm64. A new
test shows how to use them.
Diffstat (limited to 'test')
-rw-r--r--test/env.ssa21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/env.ssa b/test/env.ssa
new file mode 100644
index 0000000..7a7bb58
--- /dev/null
+++ b/test/env.ssa
@@ -0,0 +1,21 @@
+# sanity checks for env calls
+
+function l $epar(env %e, l %i) {
+@start
+	%x =l add %e, %i
+	ret %x
+}
+
+export function l $earg(l %a, l %b) {
+@start
+	%r1 =l call $epar(env %a, l %b)
+	# okay to call a regular function
+	# with an env argument
+	%r2 =l call $labs(env 113, l %r1)
+	ret %r2
+}
+
+# >>> driver
+# extern long earg(long, long);
+# int main(void) { return !(earg(2, -44) == 42); }
+# <<<