shithub: scc

Download patch

ref: 961c4456038b77fcf1832b819ef7210c5af4f652
parent: 43efcd9672e99df6b4717a65d77eb100f3b6ddc3
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Nov 15 00:30:23 EST 2021

cc/tests: Add more regression tests

--- /dev/null
+++ b/tests/cc/execute/0188-multi-string.c
@@ -1,0 +1,17 @@
+#define STR(x) #x
+#define RES "This is a string!"
+
+int
+main()
+{
+	char str1[] = STR(This is a string!);
+	char str2[] = RES;
+	int i;
+
+	for (i = 0; str1[i]; i++) {
+		if (str1[i] != str2[i])
+			break;
+	}
+
+	return str1[i] - str2[i];
+}
--- /dev/null
+++ b/tests/cc/execute/0189-cpp-no.c
@@ -1,0 +1,13 @@
+# 1 "/home/k0ga/src/scc/tests/cc/execute/0126-macropar.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 31 "<command-line>"
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+# 32 "<command-line>" 2
+# 1 "/home/k0ga/src/scc/tests/cc/execute/0126-macropar.c"
+
+int
+main()
+{
+	return 0;
+}
--- /dev/null
+++ b/tests/cc/execute/0190-enum-ary.c
@@ -1,0 +1,11 @@
+enum { Bla = 0, Bla2 = 1 };
+
+struct node {
+	char name[Bla2];
+};
+
+int
+main(void)
+{
+	return 0;
+}
--- a/tests/cc/execute/scc-tests.lst
+++ b/tests/cc/execute/scc-tests.lst
@@ -178,3 +178,6 @@
 0185-esc-macro2.c
 0186-dec-ary.c
 0187-zero-struct.c
+0188-multi-string.c [TODO]
+0189-cpp-no.c [TODO]
+0190-enum-ary.c [TODO]