shithub: scc

Download patch

ref: c959ddb9017bc8288fc444d80840f1ae61aa6ca7
parent: 7a39b526a28d598345a38327f3bcb613004c7937
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Nov 16 14:04:57 EST 2021

test/cc: Add 0194-vararg.c

--- /dev/null
+++ b/tests/cc/execute/0194-vararg.c
@@ -1,0 +1,21 @@
+#include <stdarg.h>
+
+int
+fun(int first, ...)
+{
+	int c;
+
+	va_list va;
+
+	va_start(va, first);
+	c = va_arg(va, int);
+	va_end(va);
+
+	return c;
+}
+
+int
+main()
+{
+	return fun(1, 0);
+}
--- a/tests/cc/execute/scc-tests.lst
+++ b/tests/cc/execute/scc-tests.lst
@@ -184,3 +184,4 @@
 0191-ary-addr.c
 0192-ptrcmp.c
 0193-incomplete.c
+0194-vararg.c