From: Greg King Date: Wed, 22 Apr 2015 14:05:07 +0000 (-0400) Subject: Changed the compiler test-suite to work with the fastcall-default version of cc65. X-Git-Tag: V2.15~3^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b24c87e61fd2c625ecb0b8db357cc04d631f5633;p=cc65 Changed the compiler test-suite to work with the fastcall-default version of cc65. --- diff --git a/test/ref/otccex.c b/test/ref/otccex.c index f3d6c71ec..aa5df158f 100644 --- a/test/ref/otccex.c +++ b/test/ref/otccex.c @@ -126,7 +126,7 @@ mymain(int argc,char **argv) } else { /* why not using a function pointer ? */ f = &fact; - print_num((*(long (*)())f)(n), base); + print_num((*(long (*)(int))f)(n), base); } printf("\n"); return 0; diff --git a/test/val/Makefile b/test/val/Makefile index 2efcbd0de..cb954a307 100644 --- a/test/val/Makefile +++ b/test/val/Makefile @@ -26,6 +26,13 @@ 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. +# 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)/%.prg: %.c $(CL65) $(CC65FLAGS) $< -o $@ $(SIM65) $(SIM65FLAGS) $@