From e22e9c403c7bbbb99c46ff961d91d46a5ab03221 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 22 Jul 2020 14:57:40 +0200 Subject: [PATCH] added testcase for issue #1098 --- test/misc/Makefile | 18 ++++++++++++++++++ test/misc/bug1098.c | 13 +++++++++++++ test/misc/bug1098a.c | 13 +++++++++++++ test/misc/bug1098b.c | 13 +++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 test/misc/bug1098.c create mode 100644 test/misc/bug1098a.c create mode 100644 test/misc/bug1098b.c diff --git a/test/misc/Makefile b/test/misc/Makefile index 7e19d6360..19768d5aa 100644 --- a/test/misc/Makefile +++ b/test/misc/Makefile @@ -93,6 +93,24 @@ $(WORKDIR)/bug1048.$1.$2.prg: bug1048.c | $(WORKDIR) $(if $(QUIET),echo misc/bug1048.$1.$2.prg) $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) +# this should fail to compile, because there are errors in the code +$(WORKDIR)/bug1098.$1.$2.prg: bug1098.c | $(WORKDIR) + @echo "FIXME: " $$@ "compiles but should give an error." + $(if $(QUIET),echo misc/bug1098.$1.$2.prg) + $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) + +# this should fail to compile, because there are errors in the code +$(WORKDIR)/bug1098a.$1.$2.prg: bug1098a.c | $(WORKDIR) + @echo "FIXME: " $$@ "compiles but should give an error." + $(if $(QUIET),echo misc/bug1098a.$1.$2.prg) + $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) + +# this should fail to compile, because there are errors in the code +$(WORKDIR)/bug1098b.$1.$2.prg: bug1098b.c | $(WORKDIR) + @echo "FIXME: " $$@ "compiles but should give an error." + $(if $(QUIET),echo misc/bug1098b.$1.$2.prg) + $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) + # should compile, but then hangs in an endless loop $(WORKDIR)/endless.$1.$2.prg: endless.c | $(WORKDIR) $(if $(QUIET),echo misc/endless.$1.$2.prg) diff --git a/test/misc/bug1098.c b/test/misc/bug1098.c new file mode 100644 index 000000000..c49296245 --- /dev/null +++ b/test/misc/bug1098.c @@ -0,0 +1,13 @@ + +/* bug #1098 Empty enumerator-list */ + +/* The C Standard requires that something exists between the braces for + * enum, struct, and union. */ + +enum { +}; + +int main(void) +{ + return 0; +} diff --git a/test/misc/bug1098a.c b/test/misc/bug1098a.c new file mode 100644 index 000000000..63c1c8da0 --- /dev/null +++ b/test/misc/bug1098a.c @@ -0,0 +1,13 @@ + +/* bug #1098 Empty enumerator-list */ + +/* The C Standard requires that something exists between the braces for + * enum, struct, and union. */ + +struct { +}; + +int main(void) +{ + return 0; +} diff --git a/test/misc/bug1098b.c b/test/misc/bug1098b.c new file mode 100644 index 000000000..ebd3e94c8 --- /dev/null +++ b/test/misc/bug1098b.c @@ -0,0 +1,13 @@ + +/* bug #1098 Empty enumerator-list */ + +/* The C Standard requires that something exists between the braces for + * enum, struct, and union. */ + +union { +}; + +int main(void) +{ + return 0; +}