2015-07-29 23:53:57 +03:00
|
|
|
TOP = ../..
|
2012-06-18 21:27:32 +04:00
|
|
|
include $(TOP)/Makefile
|
|
|
|
|
2014-09-07 19:05:58 +04:00
|
|
|
# clear CFLAGS and LDFLAGS
|
|
|
|
CFLAGS :=
|
|
|
|
LDFLAGS :=
|
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
ifdef CONFIG_WIN32
|
2015-07-29 23:53:57 +03:00
|
|
|
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
|
2014-04-07 13:13:19 +04:00
|
|
|
else
|
2015-07-29 23:53:57 +03:00
|
|
|
TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include -lm
|
2012-06-18 21:27:32 +04:00
|
|
|
endif
|
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
ifeq ($(TARGETOS),Darwin)
|
|
|
|
CFLAGS += -Wl,-flat_namespace,-undefined,warning
|
|
|
|
TCCFLAGS += -D_ANSI_SOURCE
|
|
|
|
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
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-04-22 16:57:23 +03:00
|
|
|
TESTS = $(patsubst %.c,%.test,$(sort $(wildcard *.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
|
|
|
|
ifdef CONFIG_WIN32
|
2014-04-07 13:20:45 +04:00
|
|
|
SKIP += 24_math_library.test # don't have round()
|
|
|
|
SKIP += 28_strings.test # don't have r/index() / strings.h
|
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)))
|
|
|
|
SKIP += 85-asm-outside-function.test
|
|
|
|
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
|
2014-04-12 22:04:10 +04:00
|
|
|
46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c
|
2014-04-07 13:20:45 +04:00
|
|
|
|
2015-04-20 03:44:08 +03:00
|
|
|
# Some tests might need different flags
|
|
|
|
FLAGS =
|
|
|
|
76_dollars_in_identifiers.test : FLAGS = -fdollars-in-identifiers
|
|
|
|
|
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
|
|
|
|
FILTER =
|
|
|
|
ifeq (-$(findstring arm,$(ARCH))-,-arm-)
|
|
|
|
FILTER = 2>&1 | grep -v 'warning: soft float ABI currently not supported'
|
|
|
|
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
|
|
|
|
@$(TCC) $(FLAGS) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true
|
2015-02-18 07:22:25 +03:00
|
|
|
@diff -Nbu $*.expect $*.output && rm -f $*.output
|
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 exe (disabled for speed)
|
|
|
|
# @($(TCC) $(FLAGS) $< -o $*.exe && ./$*.exe $(ARGS)) $(FiLTER) >$*.output2 2>&1 ; \
|
|
|
|
# diff -Nbu $*.expect $*.output2 && rm -f $*.output2 $*.exe
|
|
|
|
|
|
|
|
# automatically generate .expect files with gcc:
|
|
|
|
%.expect :
|
|
|
|
(gcc $*.c -o a.exe && ./a.exe $(ARGS)) >$*.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:
|
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
|
|
|
rm -vf fred.txt *.output a.exe
|