From 90b9438b48647f573464aede78e7b6e40263cb1d Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 27 Aug 2022 01:15:06 +0200 Subject: [PATCH] added testcase related to issue #1768 --- test/misc/Makefile | 6 ++++++ test/misc/bug1768.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/misc/bug1768.c diff --git a/test/misc/Makefile b/test/misc/Makefile index e6c58c5a4..e77d37b29 100644 --- a/test/misc/Makefile +++ b/test/misc/Makefile @@ -58,6 +58,12 @@ $(ISEQUAL): ../isequal.c | $(WORKDIR) define PRG_template +# should compile, but gives an error +$(WORKDIR)/bug1768.$1.$2.prg: bug1768.c | $(WORKDIR) + @echo "FIXME: " $$@ "currently does not compile." + $(if $(QUIET),echo misc/bug1768.$1.$2.prg) + $(NOT) $(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) + # should compile, but gives an error $(WORKDIR)/bug760.$1.$2.prg: bug760.c | $(WORKDIR) @echo "FIXME: " $$@ "currently does not compile." diff --git a/test/misc/bug1768.c b/test/misc/bug1768.c new file mode 100644 index 000000000..916aa64bc --- /dev/null +++ b/test/misc/bug1768.c @@ -0,0 +1,14 @@ + +#include + +int a = 1 || (8 / 0); +int b = 0 && (8 % 0); +int c = 1 ? 42 : (0 % 0); +int d = 1 || a / 0; +int e = 0 && b % 0; +int f = 1 ? 42 : (a %= 0, b /= 0); + +int main(void) +{ + return EXIT_SUCCESS; +}