From 41b29d5c81f26879b79d2093295e2764387951d5 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 27 Aug 2022 02:10:02 +0200 Subject: [PATCH] add testcase related to issue #1252 --- test/misc/Makefile | 8 ++++++++ test/misc/bug1252.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/misc/bug1252.c diff --git a/test/misc/Makefile b/test/misc/Makefile index e77d37b29..e761b1e3e 100644 --- a/test/misc/Makefile +++ b/test/misc/Makefile @@ -58,6 +58,14 @@ $(ISEQUAL): ../isequal.c | $(WORKDIR) define PRG_template +# should compile, but gives an error +$(WORKDIR)/bug1252.$1.$2.prg: bug1252.c | $(WORKDIR) + @echo "FIXME: " $$@ "currently does not compile." + $(if $(QUIET),echo misc/bug1252.$1.$2.prg) + $(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLERR) + $(NOT) $(CA65) -t sim$2 -o $$(@:.prg=.o) $$(@:.prg=.s) $(NULLERR) +# $(NOT) $(LD65) -t sim$2 -o $$@ $$(@:.prg=.o) sim$2.lib $(NULLERR) + # should compile, but gives an error $(WORKDIR)/bug1768.$1.$2.prg: bug1768.c | $(WORKDIR) @echo "FIXME: " $$@ "currently does not compile." diff --git a/test/misc/bug1252.c b/test/misc/bug1252.c new file mode 100644 index 000000000..c94508d7d --- /dev/null +++ b/test/misc/bug1252.c @@ -0,0 +1,19 @@ + +#include + +int main(void) +{ +// this works +c_label: + asm("inx\n" + "bne %g\n", + c_label); + +// this does not work +c_label2: + asm("inx\n" + "bne %g \n", + c_label2); + + return EXIT_SUCCESS; +}