diff --git a/test/ref/Makefile b/test/ref/Makefile index 09dd96d44..6f0bd1bc1 100644 --- a/test/ref/Makefile +++ b/test/ref/Makefile @@ -1,4 +1,3 @@ - # makefile for the regression tests that generate output which has to be # compared with reference output @@ -24,7 +23,7 @@ WORKDIR := ..$S..$Stestwrk DIFF := $(WORKDIR)/bdiff CC := gcc -CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow +CFLAGS := -O2 -Wall -W -Wextra -funsigned-char -fwrapv -fno-strict-overflow .PHONY: all clean @@ -34,6 +33,11 @@ TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c= all: $(REFS) $(TESTS) +# "yaccdbg.c" includes "yacc.c". +# yaccdbg's built files must depend on both of them. + +$(WORKDIR)/yaccdbg.ref: yacc.c + $(WORKDIR)/%.ref: %.c $(CC) $(CFLAGS) $< -o $(WORKDIR)/$*.host $(WORKDIR)$S$*.host > $@ @@ -48,6 +52,8 @@ $(WORKDIR)/switch.%rg: CC65FLAGS += -Wc --all-cdecl $(WORKDIR)/yacc.%rg: CC65FLAGS += -Wc --all-cdecl $(WORKDIR)/yaccdbg%prg: CC65FLAGS += -Wc --all-cdecl +$(WORKDIR)/yaccdbg%prg: yacc.c + $(WORKDIR)/%.prg: %.c $(WORKDIR)/%.ref $(CL65) $(CC65FLAGS) $< -o $@ $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/$*.out diff --git a/test/ref/yacc.c b/test/ref/yacc.c index 5768f80d0..d0b9190e4 100644 --- a/test/ref/yacc.c +++ b/test/ref/yacc.c @@ -562,7 +562,7 @@ yylook() } # ifdef LEXDEBUG - if((*(lsp-1)-yysvec-1)<0) + if (*(lsp-1) < yysvec + 1) { fprintf(yyout,"yylook: stopped (end)\n"); }