]> git.sur5r.net Git - cc65/commitdiff
Add regression test for #204.
authorPiotr Fusik <fox@scene.pl>
Thu, 9 Mar 2017 19:40:20 +0000 (20:40 +0100)
committerPiotr Fusik <fox@scene.pl>
Thu, 9 Mar 2017 19:40:20 +0000 (20:40 +0100)
test/val/static-fwd-decl.c [new file with mode: 0644]

diff --git a/test/val/static-fwd-decl.c b/test/val/static-fwd-decl.c
new file mode 100644 (file)
index 0000000..420640d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  !!DESCRIPTION!! static forward declarations
+  !!ORIGIN!!      cc65 regression tests
+  !!LICENCE!!     Public Domain
+  !!AUTHOR!!      Bob Andrews
+*/
+
+/*
+  see: https://github.com/cc65/cc65/issues/204
+*/
+
+#pragma warn(error, on)
+
+typedef struct _DIRMENU
+{
+    const char *name;
+    struct _DIRMENU *dest;
+} DIRMENU; 
+
+static DIRMENU rmenu;
+
+static DIRMENU lmenu = {
+    "left",
+    &rmenu
+};
+
+static DIRMENU rmenu = {
+    "right",
+    &lmenu
+};
+
+int main(void)
+{
+    return lmenu.dest == &rmenu && rmenu.dest == &lmenu ? 0 : 1;
+}