From f6d123457646f3ae6bca4cd2dcdebc9b40217b5e Mon Sep 17 00:00:00 2001 From: Greg King Date: Thu, 25 Jun 2015 13:57:17 -0400 Subject: [PATCH] Added some names to the list of test-suite programs that need the --all-cdecl work-around. Added a work-around for a cc65 bug that made the yacc tests fail. --- test/ref/Makefile | 14 ++++++++++++++ test/val/Makefile | 6 +++--- test/val/ptrfunc.c | 3 ++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/ref/Makefile b/test/ref/Makefile index 3e7a5ad6c..dbe0b0f75 100644 --- a/test/ref/Makefile +++ b/test/ref/Makefile @@ -36,6 +36,20 @@ $(WORKDIR)/%.ref: %.c $(CC) $(CFLAGS) $< -o $(WORKDIR)/$*.host $(WORKDIR)/$*.host > $@ +# Some files have "K & R"-style syntax. Therefore, some forward +# function-declarations don't match the later function definitions. +# Those programs fail when fastcall is used; but, the cdecl calling convention +# tolerates those conflicts. Therefore, make their functions default to cdecl. +# +$(WORKDIR)/init%prg: CC65FLAGS += -Wc --all-cdecl +$(WORKDIR)/switch.%rg: CC65FLAGS += -Wc --all-cdecl + +# Also, yacc.c does some things that fail when stack operations are optimized. +# Therefore, don't optimize them. +# +$(WORKDIR)/yacc.%rg: CC65FLAGS += -Wc --all-cdecl,--disable-opt,OptStackOps +$(WORKDIR)/yaccdbg%prg: CC65FLAGS += -Wc --all-cdecl,--disable-opt,OptStackOps + $(WORKDIR)/%.prg: %.c $(WORKDIR)/%.ref $(CL65) $(CC65FLAGS) $< -o $@ $(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/$*.out diff --git a/test/val/Makefile b/test/val/Makefile index cb954a307..b2a2481b4 100644 --- a/test/val/Makefile +++ b/test/val/Makefile @@ -26,12 +26,12 @@ TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c= all: $(TESTS) -# cq71.c and cq84.c have "K & R"-style syntax. And, some local forward -# function-declarations don't match the later global function definitions. +# Some files have "K & R"-style syntax. Therefore, some forward +# function-declarations don't match the later function definitions. # Those programs fail when fastcall is used; but, the cdecl calling convention # tolerates those conflicts. Therefore, make their functions default to cdecl. # -$(WORKDIR)/cq71%prg $(WORKDIR)/cq84%prg: CC65FLAGS += -Wc --all-cdecl +$(WORKDIR)/cq4%prg $(WORKDIR)/cq71.%rg $(WORKDIR)/cq81%prg $(WORKDIR)/cq84%prg: CC65FLAGS += -Wc --all-cdecl $(WORKDIR)/%.prg: %.c $(CL65) $(CC65FLAGS) $< -o $@ diff --git a/test/val/ptrfunc.c b/test/val/ptrfunc.c index e1682507a..55503e176 100644 --- a/test/val/ptrfunc.c +++ b/test/val/ptrfunc.c @@ -5,7 +5,8 @@ */ #include -#include + +#define NO_IMPLICIT_FUNCPTR_CONV unsigned char success=0; unsigned char failures=0;