shithub: scc

Download patch

ref: 912280612a54370fb154224164cccf24b95d1129
parent: 2cba9e1b69528c16908d8cd28854211a604cd45b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Jun 22 14:31:20 EDT 2022

tests/cc: Add 0209-flexible.c

--- /dev/null
+++ b/tests/cc/execute/0209-flexible.c
@@ -1,0 +1,17 @@
+struct str {
+	int a;
+	char v[];
+};
+
+int
+main(void)
+{
+	struct str *p;
+	int ary[20];
+
+	p = (struct str *) ary;
+	p->a = 2;
+	p->v[0] = 1;
+
+	return !(p->a + p->v[0] == 3);
+}
--- a/tests/cc/execute/scc-tests.lst
+++ b/tests/cc/execute/scc-tests.lst
@@ -199,3 +199,4 @@
 0206-initializer.c
 0207-structcb.c
 0208-sizeof.c
+0209-flexible.c