From afe455238c17b0796365e4de5eb777be362798d2 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 22 Jul 2020 15:55:55 +0200 Subject: [PATCH] added test related to issue #1113 --- test/misc/Makefile | 7 +++++++ test/misc/bug1113.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/misc/bug1113.c diff --git a/test/misc/Makefile b/test/misc/Makefile index 19768d5aa..9045e4e4f 100644 --- a/test/misc/Makefile +++ b/test/misc/Makefile @@ -111,6 +111,13 @@ $(WORKDIR)/bug1098b.$1.$2.prg: bug1098b.c | $(WORKDIR) $(if $(QUIET),echo misc/bug1098b.$1.$2.prg) $(CL65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) +# this should fail to compile, because there are errors in the code +# instead, the compiler crashes +$(WORKDIR)/bug1113.$1.$2.prg: bug1113.c | $(WORKDIR) + @echo "FIXME: " $$@ "compiler crashes but should give an error." + $(if $(QUIET),echo misc/bug1113.$1.$2.prg) + $(NOT) $(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/bug1113.c b/test/misc/bug1113.c new file mode 100644 index 000000000..d1aecaa0b --- /dev/null +++ b/test/misc/bug1113.c @@ -0,0 +1,12 @@ + +/* bug #1113 - Compiler crashes when calling functions "redefined" as other types */ + +void f() {} + +int f; + +int main(void) +{ + f(); + return 0; +}