aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-04-15 00:59:32 -0700
committerMichael Forney <mforney@mforney.org>2024-04-15 01:24:32 -0700
commit5f402dadeebe61d82bc809d2017cae46af2cd131 (patch)
tree045fdc6d33021e5ef458b33427f01060add7e7df /test
parentfc501ceff7fefc6ea2fdd956e2c769fcd11d9fdd (diff)
decl: Support variadic functions with no other parameters
Diffstat (limited to 'test')
-rw-r--r--test/varargs+aarch64.qbe10
-rw-r--r--test/varargs+riscv64.qbe11
-rw-r--r--test/varargs+x86_64-sysv.c8
-rw-r--r--test/varargs+x86_64-sysv.qbe10
4 files changed, 39 insertions, 0 deletions
diff --git a/test/varargs+aarch64.qbe b/test/varargs+aarch64.qbe
index 5b6e830..c444c85 100644
--- a/test/varargs+aarch64.qbe
+++ b/test/varargs+aarch64.qbe
@@ -45,3 +45,13 @@ function $f3(w %.1, ...) {
@while_join.9
ret
}
+export
+function $f4(...) {
+@start.10
+ %.1 =l alloc8 32
+@body.11
+ vastart %.1
+ %.2 =d vaarg %.1
+ %.3 =w vaarg %.1
+ ret
+}
diff --git a/test/varargs+riscv64.qbe b/test/varargs+riscv64.qbe
index 48638bb..1b0851e 100644
--- a/test/varargs+riscv64.qbe
+++ b/test/varargs+riscv64.qbe
@@ -49,3 +49,14 @@ function $f3(w %.1, ...) {
%.10 =l loadl %.3
ret
}
+export
+function $f4(...) {
+@start.10
+ %.1 =l alloc8 8
+@body.11
+ vastart %.1
+ %.2 =d vaarg %.1
+ %.3 =w vaarg %.1
+ %.4 =l loadl %.1
+ ret
+}
diff --git a/test/varargs+x86_64-sysv.c b/test/varargs+x86_64-sysv.c
index 71bf1d3..dfa1b98 100644
--- a/test/varargs+x86_64-sysv.c
+++ b/test/varargs+x86_64-sysv.c
@@ -24,3 +24,11 @@ void f3(int n, ...) {
}
__builtin_va_end(ap);
}
+
+void f4(...) {
+ __builtin_va_list ap;
+ __builtin_va_start(ap);
+ __builtin_va_arg(ap, double);
+ __builtin_va_arg(ap, int);
+ __builtin_va_end(ap);
+}
diff --git a/test/varargs+x86_64-sysv.qbe b/test/varargs+x86_64-sysv.qbe
index 46904b6..4fa8e7b 100644
--- a/test/varargs+x86_64-sysv.qbe
+++ b/test/varargs+x86_64-sysv.qbe
@@ -47,3 +47,13 @@ function $f3(w %.1, ...) {
@while_join.9
ret
}
+export
+function $f4(...) {
+@start.10
+ %.1 =l alloc8 24
+@body.11
+ vastart %.1
+ %.2 =d vaarg %.1
+ %.3 =w vaarg %.1
+ ret
+}