issue #2607, enable '\e' character escape for --standard cc65
This commit is contained in:
@@ -25,6 +25,7 @@ continue:
|
||||
@$(MAKE) -C ref all
|
||||
@$(MAKE) -C err all
|
||||
@$(MAKE) -C standard all
|
||||
@$(MAKE) -C standard_err all
|
||||
@$(MAKE) -C misc all
|
||||
@$(MAKE) -C todo all
|
||||
|
||||
@@ -35,6 +36,7 @@ mostlyclean:
|
||||
@$(MAKE) -C ref clean
|
||||
@$(MAKE) -C err clean
|
||||
@$(MAKE) -C standard clean
|
||||
@$(MAKE) -C standard_err clean
|
||||
@$(MAKE) -C misc clean
|
||||
@$(MAKE) -C todo clean
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ compiler is working as expected (when the tests behave as described):
|
||||
/val - The bulk of tests are contained here, individual tests should exit with
|
||||
an exit code of EXIT_SUCCESS when they pass, or EXIT_FAILURE on error.
|
||||
|
||||
/err - contains tests that MUST NOT compile
|
||||
|
||||
/standard - like the tests in /val, the tests must exit with EXIT_SUCCESS on
|
||||
success. Unlike the tests in /val these are not compiled for every
|
||||
combination of optimizer options, but instead always with -Osir and then
|
||||
@@ -19,6 +21,10 @@ compiler is working as expected (when the tests behave as described):
|
||||
to check for regressions in standard conformance of the compiler and the
|
||||
library.
|
||||
|
||||
/standard_err - like the tests in /err, these tests MUST NOT compile, and like
|
||||
the tests in /standard, these are compiled -Osir and then for each
|
||||
supported C-Standard.
|
||||
|
||||
/ref - These tests produce output that must be compared with reference output.
|
||||
Normally the reference output is produced by compiling the program on the
|
||||
host (using gcc mostly) and then running them on the host. Tests should
|
||||
@@ -43,8 +49,6 @@ compiler is working as expected (when the tests behave as described):
|
||||
only ever use this as a last resort when something can not be tested by
|
||||
other means.
|
||||
|
||||
/err - contains tests that MUST NOT compile
|
||||
|
||||
|
||||
/todo and /misc generally contain the tests that fail because of known bugs:
|
||||
|
||||
|
||||
14
test/standard/issue2607_cc65.c
Normal file
14
test/standard/issue2607_cc65.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* this should succeed on all three standards
|
||||
* yet use only \e on CC65
|
||||
*/
|
||||
int main(void) {
|
||||
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
printf("\e");
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
55
test/standard_err/Makefile
Normal file
55
test/standard_err/Makefile
Normal file
@@ -0,0 +1,55 @@
|
||||
# Makefile for the tests that MUST NOT compile
|
||||
|
||||
ifneq ($(shell echo),)
|
||||
CMD_EXE = 1
|
||||
endif
|
||||
|
||||
ifdef CMD_EXE
|
||||
S = $(subst /,\,/)
|
||||
NOT = - # Hack
|
||||
NULLDEV = nul:
|
||||
MKDIR = mkdir $(subst /,\,$1)
|
||||
RMDIR = -rmdir /s /q $(subst /,\,$1)
|
||||
else
|
||||
S = /
|
||||
NOT = !
|
||||
NULLDEV = /dev/null
|
||||
MKDIR = mkdir -p $1
|
||||
RMDIR = $(RM) -r $1
|
||||
endif
|
||||
|
||||
ifdef QUIET
|
||||
.SILENT:
|
||||
NULLERR = 2>$(NULLDEV)
|
||||
endif
|
||||
|
||||
CC65 := $(if $(wildcard ../../bin/cc65*),..$S..$Sbin$Scc65,cc65)
|
||||
|
||||
WORKDIR = ../../testwrk/standard_err
|
||||
|
||||
OPTIONS = c89 c99 cc65
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
SOURCES := $(wildcard *.c)
|
||||
TESTS = $(foreach option,$(OPTIONS),$(SOURCES:%.c=$(WORKDIR)/%.$(option).6502.prg))
|
||||
|
||||
all: $(TESTS)
|
||||
|
||||
$(WORKDIR):
|
||||
$(call MKDIR,$(WORKDIR))
|
||||
|
||||
define PRG_template
|
||||
|
||||
$(WORKDIR)/%.$1.$2.prg: %.c | $(WORKDIR)
|
||||
$(if $(QUIET),echo standard_err/$$*.$1.$2.prg)
|
||||
$(NOT) $(CC65) -t sim$2 $$(CC65FLAGS) -Osir --add-source --standard $1 -o $$(@:.prg=.s) $$< $(NULLERR)
|
||||
|
||||
endef # PRG_template
|
||||
|
||||
$(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),6502)))
|
||||
|
||||
#$(foreach option,$(OPTIONS),$(eval $(call PRG_template,$(option),65c02)))
|
||||
|
||||
clean:
|
||||
@$(call RMDIR,$(WORKDIR))
|
||||
14
test/standard_err/issue2607_not_cc65.c
Normal file
14
test/standard_err/issue2607_not_cc65.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* this should fail on all three standards
|
||||
*/
|
||||
int main(void) {
|
||||
|
||||
#if __CC65_STD__ != __CC65_STD_CC65__
|
||||
printf("\e");
|
||||
#else
|
||||
#error "this needs to error on CC65 to make it through validation"
|
||||
#endif
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user