shithub: scc

Download patch

ref: d445c02b0d677bee2357da71b8e65aa0c1200286
parent: 98095af694ef699b5371cf0dcd92982ccd71dedd
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Jan 12 07:02:55 EST 2017

[test] Import error tests from Andrew Chambers

--- /dev/null
+++ b/tests/error/0001-sanity.c
@@ -1,0 +1,9 @@
+/*
+PATTERN: undefined symbol FOO
+*/
+
+int main()
+{
+	return FOO;
+}
+
--- /dev/null
+++ b/tests/error/0002-missinginclude.c
@@ -1,0 +1,1 @@
+#include "MISSING.h"
--- /dev/null
+++ b/tests/error/0003-junkinclude.c
@@ -1,0 +1,6 @@
+/*
+PATTERN: bar
+PATTERN: junk
+*/
+
+#include "0003-junkinclude.c" bar
--- /dev/null
+++ b/tests/error/0004-macroredef.c
@@ -1,0 +1,8 @@
+/*
+PATTERN: redefinition
+PATTERN: 7
+*/
+
+#define X 1
+#define X 2
+
--- /dev/null
+++ b/tests/error/0005-fmacro.c
@@ -1,0 +1,7 @@
+
+/*
+PATTERN: expected
+*/
+
+#define X(
+
--- /dev/null
+++ b/tests/error/0006-endif.c
@@ -1,0 +1,7 @@
+
+/*
+PATTERN: endif
+*/
+
+#endif
+
--- /dev/null
+++ b/tests/error/0007-unmatchedcppif.c
@@ -1,0 +1,7 @@
+/*
+PATTERN: endif
+*/
+
+#ifdef FOO
+
+
--- /dev/null
+++ b/tests/error/0008-unmatchedcppelse.c
@@ -1,0 +1,8 @@
+
+/*
+PATTERN: else
+*/
+
+#else
+
+
--- /dev/null
+++ b/tests/error/0009-unmatchedcppelif.c
@@ -1,0 +1,7 @@
+
+/*
+PATTERN: elif
+*/
+
+#elif 1
+
--- /dev/null
+++ b/tests/error/0010-extraelif.c
@@ -1,0 +1,12 @@
+
+/*
+PATTERN: elif
+*/
+
+#if 1
+
+#else
+
+#elif 0
+
+#endif
--- /dev/null
+++ b/tests/error/0011-extraelse.c
@@ -1,0 +1,12 @@
+
+/*
+PATTERN: else
+*/
+
+#if 1
+
+#else
+
+#else
+
+#endif
--- /dev/null
+++ b/tests/error/0012-ifnoexpr.c
@@ -1,0 +1,7 @@
+/*
+PATTERN: expression
+*/
+
+#if
+#endif
+
--- /dev/null
+++ b/tests/error/0013-macro.c
@@ -1,0 +1,8 @@
+/*
+PATTERN: macro
+*/
+
+#define X(A, ...) 0
+
+X()
+
--- /dev/null
+++ b/tests/error/0014-macro.c
@@ -1,0 +1,8 @@
+/*
+PATTERN: macro
+*/
+
+#define X() 0
+
+X(A)
+
--- /dev/null
+++ b/tests/error/0015-macro.c
@@ -1,0 +1,6 @@
+/*
+PATTERN: macro argument
+*/
+
+#define X(A, A) 0
+
--- /dev/null
+++ b/tests/error/0016-arrayinitsize.c
@@ -1,0 +1,5 @@
+/*
+PATTERN: incorrect
+*/
+
+int x[2] = {1, 2, 3};
--- /dev/null
+++ b/tests/error/0017-duplicatefunc.c
@@ -1,0 +1,13 @@
+
+int
+main()
+{
+	return 0;
+}
+
+int
+main()
+{
+	return 0;
+}
+
--- /dev/null
+++ b/tests/error/0018-voidparam.c
@@ -1,0 +1,12 @@
+
+int
+foo(void, int x)
+{
+	return 0;
+}
+
+int
+main()
+{
+	return foo();
+}
--- /dev/null
+++ b/tests/error/README
@@ -1,0 +1,2 @@
+These tests are taken from https://github.com/andrewchambers/qc.
+All the credits for this test suite are for Andrew Chambers.