]> git.sur5r.net Git - cc65/commitdiff
Added regression tests of diagnostics for conflicts between extern/public and static... 197/head
authorGreg King <gregdk@users.sf.net>
Thu, 13 Aug 2015 07:39:35 +0000 (03:39 -0400)
committerGreg King <gregdk@users.sf.net>
Thu, 13 Aug 2015 07:39:35 +0000 (03:39 -0400)
test/err/static-2.c [new file with mode: 0644]
test/err/static-3.c [new file with mode: 0644]
test/err/static-4.c [new file with mode: 0644]
test/val/static-1.c [new file with mode: 0644]

diff --git a/test/err/static-2.c b/test/err/static-2.c
new file mode 100644 (file)
index 0000000..c890978
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+  !!DESCRIPTION!! global non-static and static conflicts
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Greg King
+*/
+
+/*
+  see: https://github.com/cc65/cc65/issues/191
+*/
+
+#pragma warn(error, on)
+
+int n;
+static int n;           /* should give an error */
+
+int main(void)
+{
+    return n;
+}
diff --git a/test/err/static-3.c b/test/err/static-3.c
new file mode 100644 (file)
index 0000000..5b6839a
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+  !!DESCRIPTION!! global non-static and static conflicts
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Greg King
+*/
+
+/*
+  see: https://github.com/cc65/cc65/issues/191
+*/
+
+#pragma warn(error, on)
+
+extern int n;
+static int n;           /* should give an error */
+
+int main(void)
+{
+    return n;
+}
diff --git a/test/err/static-4.c b/test/err/static-4.c
new file mode 100644 (file)
index 0000000..a2cdeb7
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+  !!DESCRIPTION!! global non-static and static conflicts
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Greg King
+*/
+
+/*
+  see: https://github.com/cc65/cc65/issues/191
+*/
+
+#pragma warn(error, on)
+
+static int n;
+int n;                  /* should give an error */
+
+int main(void)
+{
+    return n;
+}
diff --git a/test/val/static-1.c b/test/val/static-1.c
new file mode 100644 (file)
index 0000000..ae2ba62
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+  !!DESCRIPTION!! global non-static and static conflicts
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Greg King
+*/
+
+/*
+  see: https://github.com/cc65/cc65/issues/191
+*/
+
+#pragma warn(error, on)
+
+static int n = 0;
+extern int n;           /* should not give an error */
+
+int main(void)
+{
+    return n;
+}