2015-07-29 23:53:57 +03:00
|
|
|
TOP = ../..
|
2016-10-01 22:06:53 +03:00
|
|
|
include $(TOP)/config.mak
|
|
|
|
SRC = $(TOPSRC)/tests/tests2
|
|
|
|
VPATH = $(SRC)
|
2012-06-18 21:27:32 +04:00
|
|
|
|
2016-10-01 22:06:33 +03:00
|
|
|
# run local version of tcc with local libraries and includes
|
2016-10-01 22:06:53 +03:00
|
|
|
TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include
|
2013-02-05 17:27:38 +04:00
|
|
|
ifdef CONFIG_WIN32
|
2016-10-01 22:06:53 +03:00
|
|
|
TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -L$(TOP)
|
2012-06-18 21:27:32 +04:00
|
|
|
endif
|
2013-04-17 23:32:07 +04:00
|
|
|
TCC = $(TOP)/tcc $(TCCFLAGS)
|
2012-06-18 21:27:32 +04:00
|
|
|
|
2016-10-01 22:06:53 +03:00
|
|
|
TESTS = $(patsubst %.c,%.test,$(sort $(notdir $(wildcard $(SRC)/*.c))))
|
2013-02-05 17:27:38 +04:00
|
|
|
|
|
|
|
# 34_array_assignment.test -- array assignment is not in C standard
|
2014-04-12 22:04:10 +04:00
|
|
|
SKIP = 34_array_assignment.test
|
2014-04-07 13:20:45 +04:00
|
|
|
|
2012-06-27 21:04:27 +04:00
|
|
|
# some tests do not pass on all platforms, remove them for now
|
2015-03-04 09:52:47 +03:00
|
|
|
ifeq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
|
|
|
|
SKIP += 22_floating_point.test
|
|
|
|
endif
|
2012-06-27 21:04:27 +04:00
|
|
|
ifeq ($(TARGETOS),Darwin)
|
2014-04-07 13:20:45 +04:00
|
|
|
SKIP += 40_stdio.test
|
2012-06-27 21:04:27 +04:00
|
|
|
endif
|
2015-03-20 16:01:06 +03:00
|
|
|
ifeq ($(ARCH),x86-64)
|
|
|
|
SKIP += 73_arm64.test
|
|
|
|
endif
|
2016-05-04 23:23:25 +03:00
|
|
|
ifeq (,$(filter i386 x86-64,$(ARCH)))
|
2017-02-15 11:00:38 +03:00
|
|
|
SKIP += 85_asm-outside-function.test
|
2016-05-04 23:23:25 +03:00
|
|
|
endif
|
2012-06-27 21:04:27 +04:00
|
|
|
|
2014-04-07 13:20:45 +04:00
|
|
|
# Some tests might need arguments
|
|
|
|
ARGS =
|
|
|
|
31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
|
2016-10-01 22:06:53 +03:00
|
|
|
46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
|
2014-04-07 13:20:45 +04:00
|
|
|
|
2016-12-18 07:18:19 +03:00
|
|
|
# And some tests don't test the right thing with -run
|
|
|
|
NORUN =
|
|
|
|
42_function_pointer.test : NORUN = true
|
|
|
|
|
2015-04-20 03:44:08 +03:00
|
|
|
# Some tests might need different flags
|
2017-02-18 11:51:23 +03:00
|
|
|
FLAGS =
|
|
|
|
76_dollars_in_identifiers.test : FLAGS += -fdollars-in-identifiers
|
2015-04-20 03:44:08 +03:00
|
|
|
|
2016-10-01 22:06:53 +03:00
|
|
|
# Filter source directory in warnings/errors (out-of-tree builds)
|
|
|
|
FILTER = 2>&1 | sed 's,$(SRC)/,,g'
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
# Filter some always-warning
|
|
|
|
ifeq (-$(findstring arm,$(ARCH))-,-arm-)
|
2016-10-01 22:06:53 +03:00
|
|
|
FILTER += 2>&1 | grep -v 'warning: soft float ABI currently not supported'
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
endif
|
|
|
|
|
2014-04-07 13:20:45 +04:00
|
|
|
all test: $(filter-out $(SKIP),$(TESTS))
|
|
|
|
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
%.test: %.c %.expect
|
2012-06-18 21:27:32 +04:00
|
|
|
@echo Test: $*...
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
# test -run
|
2016-12-18 07:18:19 +03:00
|
|
|
@if test -z "$(NORUN)"; then \
|
2017-02-18 11:51:23 +03:00
|
|
|
$(TCC) $(FLAGS) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true; \
|
2016-12-18 07:18:19 +03:00
|
|
|
else \
|
2017-02-18 11:51:23 +03:00
|
|
|
$(TCC) $(FLAGS) $< -o ./$*.exe $(FILTER) >$*.output 2>&1; \
|
2017-02-11 16:27:21 +03:00
|
|
|
./$*.exe $(ARGS) >>$*.output 2>&1 || true; \
|
2016-12-18 07:18:19 +03:00
|
|
|
fi
|
2016-12-20 06:49:22 +03:00
|
|
|
@diff -Nbu $(SRC)/$*.expect $*.output && rm -f $*.output $*.exe
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
|
|
|
|
# automatically generate .expect files with gcc:
|
2017-02-08 21:56:15 +03:00
|
|
|
%.expect : # %.c
|
2016-12-19 00:05:42 +03:00
|
|
|
(gcc -w $*.c -o a.exe && ./a.exe $(ARGS)) $(FILTER) >$*.expect 2>&1; rm -f a.exe
|
2014-04-07 13:20:45 +04:00
|
|
|
|
tccpp: fix issues, add tests
* fix some macro expansion issues
* add some pp tests in tests/pp
* improved tcc -E output for better diff'ability
* remove -dD feature (quirky code, exotic feature,
didn't work well)
Based partially on ideas / researches from PipCet
Some issues remain with VA_ARGS macros (if used in a
rather tricky way).
Also, to keep it simple, the pp doesn't automtically
add any extra spaces to separate tokens which otherwise
would form wrong tokens if re-read from tcc -E output
(such as '+' '=') GCC does that, other compilers don't.
* cleanups
- #line 01 "file" / # 01 "file" processing
- #pragma comment(lib,"foo")
- tcc -E: forward some pragmas to output (pack, comment(lib))
- fix macro parameter list parsing mess from
a3fc54345949535524d01319e1ca6378b7c2c201
a715d7143d9d17da17e67fec6af1c01409a71a31
(some coffee might help, next time ;)
- introduce TOK_PPSTR - to have character constants as
written in the file (similar to TOK_PPNUM)
- allow '\' appear in macros
- new functions begin/end_macro to:
- fix switching macro levels during expansion
- allow unget_tok to unget more than one tok
- slight speedup by using bitflags in isidnum_table
Also:
- x86_64.c : fix decl after statements
- i386-gen,c : fix a vstack leak with VLA on windows
- configure/Makefile : build on windows (MSYS) was broken
- tcc_warning: fflush stderr to keep output order (win32)
2015-05-09 15:29:39 +03:00
|
|
|
# tell make not to delete
|
|
|
|
.PRECIOUS: %.expect
|
2012-11-07 17:54:43 +04:00
|
|
|
|
|
|
|
clean:
|
2016-10-01 22:06:33 +03:00
|
|
|
rm -f fred.txt *.output a.exe
|