commit 1679b6d153d6617c2049bc3bb79a4e5854fcb1cb
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Jan 12 12:02:55 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Jan 12 12:02:55 2017 +0100
[test] Import error tests from Andrew Chambers
diff --git a/tests/error/0001-sanity.c b/tests/error/0001-sanity.c
new file mode 100644
index 0000000..5057227
--- /dev/null
+++ b/tests/error/0001-sanity.c
_AT_@ -0,0 +1,9 @@
+/*
+PATTERN: undefined symbol FOO
+*/
+
+int main()
+{
+ return FOO;
+}
+
diff --git a/tests/error/0002-missinginclude.c b/tests/error/0002-missinginclude.c
new file mode 100644
index 0000000..1580fd2
--- /dev/null
+++ b/tests/error/0002-missinginclude.c
_AT_@ -0,0 +1 @@
+#include "MISSING.h"
diff --git a/tests/error/0003-junkinclude.c b/tests/error/0003-junkinclude.c
new file mode 100644
index 0000000..cba91a8
--- /dev/null
+++ b/tests/error/0003-junkinclude.c
_AT_@ -0,0 +1,6 @@
+/*
+PATTERN: bar
+PATTERN: junk
+*/
+
+#include "0003-junkinclude.c" bar
diff --git a/tests/error/0004-macroredef.c b/tests/error/0004-macroredef.c
new file mode 100644
index 0000000..28ed85c
--- /dev/null
+++ b/tests/error/0004-macroredef.c
_AT_@ -0,0 +1,8 @@
+/*
+PATTERN: redefinition
+PATTERN: 7
+*/
+
+#define X 1
+#define X 2
+
diff --git a/tests/error/0005-fmacro.c b/tests/error/0005-fmacro.c
new file mode 100644
index 0000000..ca22ea7
--- /dev/null
+++ b/tests/error/0005-fmacro.c
_AT_@ -0,0 +1,7 @@
+
+/*
+PATTERN: expected
+*/
+
+#define X(
+
diff --git a/tests/error/0006-endif.c b/tests/error/0006-endif.c
new file mode 100644
index 0000000..7ccc5c6
--- /dev/null
+++ b/tests/error/0006-endif.c
_AT_@ -0,0 +1,7 @@
+
+/*
+PATTERN: endif
+*/
+
+#endif
+
diff --git a/tests/error/0007-unmatchedcppif.c b/tests/error/0007-unmatchedcppif.c
new file mode 100644
index 0000000..dfcf8b4
--- /dev/null
+++ b/tests/error/0007-unmatchedcppif.c
_AT_@ -0,0 +1,7 @@
+/*
+PATTERN: endif
+*/
+
+#ifdef FOO
+
+
diff --git a/tests/error/0008-unmatchedcppelse.c b/tests/error/0008-unmatchedcppelse.c
new file mode 100644
index 0000000..657efbb
--- /dev/null
+++ b/tests/error/0008-unmatchedcppelse.c
_AT_@ -0,0 +1,8 @@
+
+/*
+PATTERN: else
+*/
+
+#else
+
+
diff --git a/tests/error/0009-unmatchedcppelif.c b/tests/error/0009-unmatchedcppelif.c
new file mode 100644
index 0000000..17c5791
--- /dev/null
+++ b/tests/error/0009-unmatchedcppelif.c
_AT_@ -0,0 +1,7 @@
+
+/*
+PATTERN: elif
+*/
+
+#elif 1
+
diff --git a/tests/error/0010-extraelif.c b/tests/error/0010-extraelif.c
new file mode 100644
index 0000000..acfb7c5
--- /dev/null
+++ b/tests/error/0010-extraelif.c
_AT_@ -0,0 +1,12 @@
+
+/*
+PATTERN: elif
+*/
+
+#if 1
+
+#else
+
+#elif 0
+
+#endif
diff --git a/tests/error/0011-extraelse.c b/tests/error/0011-extraelse.c
new file mode 100644
index 0000000..3fac326
--- /dev/null
+++ b/tests/error/0011-extraelse.c
_AT_@ -0,0 +1,12 @@
+
+/*
+PATTERN: else
+*/
+
+#if 1
+
+#else
+
+#else
+
+#endif
diff --git a/tests/error/0012-ifnoexpr.c b/tests/error/0012-ifnoexpr.c
new file mode 100644
index 0000000..a43836d
--- /dev/null
+++ b/tests/error/0012-ifnoexpr.c
_AT_@ -0,0 +1,7 @@
+/*
+PATTERN: expression
+*/
+
+#if
+#endif
+
diff --git a/tests/error/0013-macro.c b/tests/error/0013-macro.c
new file mode 100644
index 0000000..d892a8e
--- /dev/null
+++ b/tests/error/0013-macro.c
_AT_@ -0,0 +1,8 @@
+/*
+PATTERN: macro
+*/
+
+#define X(A, ...) 0
+
+X()
+
diff --git a/tests/error/0014-macro.c b/tests/error/0014-macro.c
new file mode 100644
index 0000000..1cf645a
--- /dev/null
+++ b/tests/error/0014-macro.c
_AT_@ -0,0 +1,8 @@
+/*
+PATTERN: macro
+*/
+
+#define X() 0
+
+X(A)
+
diff --git a/tests/error/0015-macro.c b/tests/error/0015-macro.c
new file mode 100644
index 0000000..7317859
--- /dev/null
+++ b/tests/error/0015-macro.c
_AT_@ -0,0 +1,6 @@
+/*
+PATTERN: macro argument
+*/
+
+#define X(A, A) 0
+
diff --git a/tests/error/0016-arrayinitsize.c b/tests/error/0016-arrayinitsize.c
new file mode 100644
index 0000000..c739cef
--- /dev/null
+++ b/tests/error/0016-arrayinitsize.c
_AT_@ -0,0 +1,5 @@
+/*
+PATTERN: incorrect
+*/
+
+int x[2] = {1, 2, 3};
diff --git a/tests/error/0017-duplicatefunc.c b/tests/error/0017-duplicatefunc.c
new file mode 100644
index 0000000..81d3d19
--- /dev/null
+++ b/tests/error/0017-duplicatefunc.c
_AT_@ -0,0 +1,13 @@
+
+int
+main()
+{
+ return 0;
+}
+
+int
+main()
+{
+ return 0;
+}
+
diff --git a/tests/error/0018-voidparam.c b/tests/error/0018-voidparam.c
new file mode 100644
index 0000000..1f927e5
--- /dev/null
+++ b/tests/error/0018-voidparam.c
_AT_@ -0,0 +1,12 @@
+
+int
+foo(void, int x)
+{
+ return 0;
+}
+
+int
+main()
+{
+ return foo();
+}
diff --git a/tests/error/README b/tests/error/README
new file mode 100644
index 0000000..aca0de8
--- /dev/null
+++ b/tests/error/README
_AT_@ -0,0 +1,2 @@
+These tests are taken from
https://github.com/andrewchambers/qc.
+All the credits for this test suite are for Andrew Chambers.
Received on Thu Jan 12 2017 - 12:03:34 CET