aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-19 17:49:43 -0800
committerMichael Forney <mforney@mforney.org>2019-02-19 17:49:43 -0800
commitf326044f9fc4ef7e182603e8686dde3f12da42dd (patch)
tree501aa8008e0f3bbdbcdb207d75aba6d0eba9f9f5 /tests
parent5e668f124cdaccb38cf2a879ccf456c971743136 (diff)
Implement __builtin_va_copy
Diffstat (limited to 'tests')
-rw-r--r--tests/builtin-va-copy.c4
-rw-r--r--tests/builtin-va-copy.qbe20
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/builtin-va-copy.c b/tests/builtin-va-copy.c
new file mode 100644
index 0000000..7a69596
--- /dev/null
+++ b/tests/builtin-va-copy.c
@@ -0,0 +1,4 @@
+void f(void) {
+ static __builtin_va_list a, b;
+ __builtin_va_copy(a, b);
+}
diff --git a/tests/builtin-va-copy.qbe b/tests/builtin-va-copy.qbe
new file mode 100644
index 0000000..7d88659
--- /dev/null
+++ b/tests/builtin-va-copy.qbe
@@ -0,0 +1,20 @@
+data $.La.2 = align 8 { z 24 }
+data $.Lb.3 = align 8 { z 24 }
+export
+function $f() {
+@start.1
+@body.2
+ %.1 =l loadl $.Lb.3
+ storel %.1, $.La.2
+ %.2 =l add $.Lb.3, 8
+ %.3 =l add $.La.2, 8
+ %.4 =l loadl %.2
+ storel %.4, %.3
+ %.5 =l add %.2, 8
+ %.6 =l add %.3, 8
+ %.7 =l loadl %.5
+ storel %.7, %.6
+ %.8 =l add %.5, 8
+ %.9 =l add %.6, 8
+ ret
+}