2009-04-18 16:31:35 +04:00
|
|
|
#
|
|
|
|
# Tiny C Compiler Makefile - tests
|
|
|
|
#
|
|
|
|
|
2015-07-29 23:53:57 +03:00
|
|
|
TOP = ..
|
2012-06-27 21:04:27 +04:00
|
|
|
include $(TOP)/Makefile
|
2013-04-17 23:32:07 +04:00
|
|
|
SRCDIR = $(top_srcdir)/tests
|
2014-01-21 16:25:14 +04:00
|
|
|
VPATH = $(SRCDIR) $(top_srcdir)
|
2012-06-27 21:04:27 +04:00
|
|
|
|
2014-09-07 19:05:58 +04:00
|
|
|
# clear CFLAGS and LDFLAGS
|
|
|
|
CFLAGS :=
|
|
|
|
LDFLAGS :=
|
|
|
|
|
2009-04-18 16:31:35 +04:00
|
|
|
# what tests to run
|
2013-02-05 17:27:38 +04:00
|
|
|
TESTS = \
|
2013-02-10 03:38:40 +04:00
|
|
|
hello-exe \
|
|
|
|
hello-run \
|
2013-02-05 17:27:38 +04:00
|
|
|
libtest \
|
|
|
|
test3 \
|
2013-04-18 20:27:34 +04:00
|
|
|
abitest \
|
2013-04-27 23:39:34 +04:00
|
|
|
vla_test-run \
|
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
|
|
|
tests2-dir pp-dir
|
2014-01-21 16:25:14 +04:00
|
|
|
|
|
|
|
BTESTS = test1b test3b btest
|
|
|
|
|
2014-01-09 13:15:08 +04:00
|
|
|
ifdef CONFIG_CROSS
|
2014-01-21 16:25:14 +04:00
|
|
|
TESTS += hello-cross
|
2014-01-09 13:15:08 +04:00
|
|
|
endif
|
2013-02-05 17:27:38 +04:00
|
|
|
|
|
|
|
# test4 -- problem with -static
|
|
|
|
# asmtest -- minor differences with gcc
|
|
|
|
# btest -- works on i386 (including win32)
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2012-11-21 09:47:23 +04:00
|
|
|
# bounds-checking is supported only on i386
|
|
|
|
ifneq ($(ARCH),i386)
|
2014-01-21 16:25:14 +04:00
|
|
|
TESTS := $(filter-out $(BTESTS),$(TESTS))
|
2012-11-21 09:47:23 +04:00
|
|
|
endif
|
2013-02-05 17:27:38 +04:00
|
|
|
ifdef CONFIG_WIN32
|
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
|
|
|
TESTS := $(filter-out $(BTESTS),$(TESTS))
|
2012-06-27 21:04:27 +04:00
|
|
|
endif
|
|
|
|
ifeq ($(TARGETOS),Darwin)
|
2014-01-21 16:25:14 +04:00
|
|
|
TESTS := $(filter-out hello-exe test3 $(BTESTS),$(TESTS))
|
2012-06-27 21:04:27 +04:00
|
|
|
endif
|
2015-10-31 14:04:52 +03:00
|
|
|
ifeq (,$(filter arm64 i386 x86-64,$(ARCH)))
|
2013-04-27 23:39:34 +04:00
|
|
|
TESTS := $(filter-out vla_test-run,$(TESTS))
|
|
|
|
endif
|
2015-03-04 09:52:47 +03:00
|
|
|
ifeq ($(CONFIG_arm_eabi),yes)
|
|
|
|
TESTS := $(filter-out test3,$(TESTS))
|
|
|
|
endif
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2010-12-04 18:47:08 +03:00
|
|
|
ifdef DISABLE_STATIC
|
2013-02-05 17:27:38 +04:00
|
|
|
export LD_LIBRARY_PATH:=$(CURDIR)/..
|
2010-12-04 18:47:08 +03:00
|
|
|
endif
|
|
|
|
|
2012-03-06 22:26:36 +04:00
|
|
|
ifeq ($(TARGETOS),Darwin)
|
2013-02-05 17:27:38 +04:00
|
|
|
CFLAGS+=-Wl,-flat_namespace,-undefined,warning
|
|
|
|
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
|
|
|
NATIVE_DEFINES+=-D_ANSI_SOURCE
|
2012-03-06 22:26:36 +04:00
|
|
|
endif
|
|
|
|
|
2009-04-18 16:31:35 +04:00
|
|
|
# run local version of tcc with local libraries and includes
|
2015-07-29 23:53:57 +03:00
|
|
|
TCCFLAGS = -B$(TOP) -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP)
|
2012-06-27 21:04:27 +04:00
|
|
|
ifdef CONFIG_WIN32
|
2015-07-29 23:53:57 +03:00
|
|
|
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir) -I$(top_srcdir)/include -L$(TOP)
|
2012-06-27 21:04:27 +04:00
|
|
|
endif
|
2015-07-29 23:53:57 +03:00
|
|
|
XTCCFLAGS = -B$(TOP) -B$(top_srcdir)/win32 -I$(TOP) -I$(top_srcdir) -I$(top_srcdir)/include
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
TCC = $(TOP)/tcc $(TCCFLAGS)
|
2013-04-17 23:32:07 +04:00
|
|
|
RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(top_srcdir)/tcc.c $(TCCFLAGS)
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
DISAS = objdump -d
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# libtcc test
|
2011-05-14 18:21:45 +04:00
|
|
|
ifdef LIBTCC1
|
2015-07-29 23:53:57 +03:00
|
|
|
LIBTCC1:=$(TOP)/$(LIBTCC1)
|
2011-05-14 18:21:45 +04:00
|
|
|
endif
|
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
all test : $(TESTS)
|
|
|
|
|
2013-02-10 03:38:40 +04:00
|
|
|
hello-exe: ../examples/ex1.c
|
|
|
|
@echo ------------ $@ ------------
|
|
|
|
$(TCC) $< -o hello$(EXESUF) || ($(TOP)/tcc -vv; exit 1) && ./hello$(EXESUF)
|
|
|
|
|
2014-01-09 13:15:08 +04:00
|
|
|
hello-cross: ../examples/ex1.c
|
|
|
|
@echo ------------ $@ ------------
|
|
|
|
for XTCC in $(PROGS_CROSS) ; \
|
|
|
|
do echo -n "Test of $$XTCC... "; \
|
|
|
|
out=$$($(TOP)/$$XTCC $(XTCCFLAGS) -c $< 2>&1); \
|
|
|
|
test $$? -ne 0 && { echo "Failed\n$$out\n" ; $(TOP)/$$XTCC -vv; exit 1; } ; \
|
|
|
|
echo "Success"; \
|
|
|
|
done
|
|
|
|
|
2013-02-10 03:38:40 +04:00
|
|
|
hello-run: ../examples/ex1.c
|
2013-02-05 17:27:38 +04:00
|
|
|
@echo ------------ $@ ------------
|
|
|
|
$(TCC) -run $<
|
|
|
|
|
2011-05-14 18:21:45 +04:00
|
|
|
libtest: libtcc_test$(EXESUF) $(LIBTCC1)
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
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
|
|
|
./libtcc_test$(EXESUF) $(TCCFLAGS)
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2012-12-14 20:18:03 +04:00
|
|
|
libtcc_test$(EXESUF): libtcc_test.c $(top_builddir)/$(LIBTCC)
|
2013-04-17 23:32:07 +04:00
|
|
|
$(CC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC) $(LDFLAGS) -I$(top_srcdir)
|
2009-04-18 16:31:35 +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
|
|
|
%-dir:
|
2013-02-05 17:27:38 +04:00
|
|
|
@echo ------------ $@ ------------
|
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
|
|
|
$(MAKE) -k -C $*
|
2014-01-06 22:56:26 +04:00
|
|
|
|
2014-03-09 18:54:48 +04:00
|
|
|
# test.ref - generate using cc
|
2009-04-18 16:31:35 +04:00
|
|
|
test.ref: tcctest.c
|
2014-03-09 18:54:48 +04:00
|
|
|
$(CC) -o tcctest.cc $< -I$(top_srcdir) $(CPPFLAGS) -w $(CFLAGS) $(NATIVE_DEFINES) -std=gnu99 -O0 -fno-omit-frame-pointer $(LDFLAGS)
|
|
|
|
./tcctest.cc > $@
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# auto test
|
2014-01-21 16:25:14 +04:00
|
|
|
test1 test1b: tcctest.c test.ref
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) -run $< > test.out1
|
2014-01-21 16:25:14 +04:00
|
|
|
@diff -u test.ref test.out1 && echo "Auto Test OK"
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# iterated test2 (compile tcc then compile tcctest.c !)
|
2014-01-21 16:25:14 +04:00
|
|
|
test2 test2b: tcctest.c test.ref
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out2
|
2014-01-21 16:25:14 +04:00
|
|
|
@diff -u test.ref test.out2 && echo "Auto Test2 OK"
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
2014-01-21 16:25:14 +04:00
|
|
|
test3 test3b: tcctest.c test.ref
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run $< > test.out3
|
2014-01-21 16:25:14 +04:00
|
|
|
@diff -u test.ref test.out3 && echo "Auto Test3 OK"
|
|
|
|
|
|
|
|
test%b : TCCFLAGS += -b
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# binary output test
|
2014-01-06 22:56:26 +04:00
|
|
|
test4: tcctest.c test.ref
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
|
|
|
# object + link output
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) -c -o tcctest3.o $<
|
2009-04-18 16:31:35 +04:00
|
|
|
$(TCC) -o tcctest3 tcctest3.o
|
|
|
|
./tcctest3 > test3.out
|
|
|
|
@if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
|
2013-02-05 17:27:38 +04:00
|
|
|
# dynamic output
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) -o tcctest1 $<
|
2013-02-05 17:27:38 +04:00
|
|
|
./tcctest1 > test1.out
|
|
|
|
@if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
|
2009-04-18 16:31:35 +04:00
|
|
|
# dynamic output + bound check
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) -b -o tcctest4 $<
|
2009-04-18 16:31:35 +04:00
|
|
|
./tcctest4 > test4.out
|
|
|
|
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
|
2013-02-05 17:27:38 +04:00
|
|
|
# static output
|
2014-01-06 22:56:26 +04:00
|
|
|
$(TCC) -static -o tcctest2 $<
|
2013-02-05 17:27:38 +04:00
|
|
|
./tcctest2 > test2.out
|
|
|
|
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# memory and bound check auto test
|
2009-07-19 00:06:54 +04:00
|
|
|
BOUNDS_OK = 1 4 8 10 14
|
|
|
|
BOUNDS_FAIL= 2 5 7 9 11 12 13 15
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2013-02-05 17:27:38 +04:00
|
|
|
btest: boundtest.c
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
|
|
|
@for i in $(BOUNDS_OK); do \
|
2009-07-06 23:10:14 +04:00
|
|
|
echo ; echo --- boundtest $$i ---; \
|
2014-01-21 16:25:14 +04:00
|
|
|
if $(TCC) -b -run $< $$i ; then \
|
2014-04-07 15:31:00 +04:00
|
|
|
echo succeeded as expected; \
|
2009-04-18 16:31:35 +04:00
|
|
|
else\
|
|
|
|
echo Failed positive test $$i ; exit 1 ; \
|
|
|
|
fi ;\
|
|
|
|
done ;\
|
|
|
|
for i in $(BOUNDS_FAIL); do \
|
2009-07-06 23:10:14 +04:00
|
|
|
echo ; echo --- boundtest $$i ---; \
|
2014-01-21 16:25:14 +04:00
|
|
|
if $(TCC) -b -run $< $$i ; then \
|
2009-04-18 16:31:35 +04:00
|
|
|
echo Failed negative test $$i ; exit 1 ;\
|
|
|
|
else\
|
2009-07-06 23:10:14 +04:00
|
|
|
echo failed as expected; \
|
2009-04-18 16:31:35 +04:00
|
|
|
fi ;\
|
|
|
|
done ;\
|
2009-07-06 23:10:14 +04:00
|
|
|
echo; echo Bound test OK
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# speed test
|
2009-07-06 23:11:19 +04:00
|
|
|
speedtest: ex2 ex3
|
2009-04-18 16:31:35 +04:00
|
|
|
@echo ------------ $@ ------------
|
|
|
|
time ./ex2 1238 2 3 4 10 13 4
|
2012-12-14 20:18:03 +04:00
|
|
|
time $(TCC) -run $(top_srcdir)/examples/ex2.c 1238 2 3 4 10 13 4
|
2009-04-18 16:31:35 +04:00
|
|
|
time ./ex3 35
|
2012-12-14 20:18:03 +04:00
|
|
|
time $(TCC) -run $(top_srcdir)/examples/ex3.c 35
|
2009-04-18 16:31:35 +04:00
|
|
|
|
2014-01-06 22:56:26 +04:00
|
|
|
weaktest: tcctest.c test.ref
|
|
|
|
$(TCC) -c $< -o weaktest.tcc.o $(CPPFLAGS) $(CFLAGS)
|
2014-03-09 18:54:48 +04:00
|
|
|
$(CC) -c $< -o weaktest.cc.o -I. $(CPPFLAGS) -w $(CFLAGS)
|
2011-02-01 20:41:03 +03:00
|
|
|
objdump -t weaktest.tcc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.tcc.o.txt
|
2014-03-09 18:54:48 +04:00
|
|
|
objdump -t weaktest.cc.o | grep ' w ' | sed -e 's/.* \([a-zA-Z0-9_]*\)$$/\1/' | LC_ALL=C sort > weaktest.cc.o.txt
|
|
|
|
diff weaktest.cc.o.txt weaktest.tcc.o.txt && echo "Weak Auto Test OK"
|
2011-02-01 20:41:03 +03:00
|
|
|
|
2012-12-14 20:18:03 +04:00
|
|
|
ex%: $(top_srcdir)/examples/ex%.c
|
2012-10-22 13:11:42 +04:00
|
|
|
$(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
# tiny assembler testing
|
|
|
|
asmtest.ref: asmtest.S
|
2015-04-20 03:44:08 +03:00
|
|
|
$(CC) -m32 -Wa,-W -o asmtest.ref.o -c asmtest.S
|
2009-07-06 23:11:19 +04:00
|
|
|
objdump -D asmtest.ref.o > asmtest.ref
|
2009-04-18 16:31:35 +04:00
|
|
|
|
|
|
|
asmtest: asmtest.ref
|
|
|
|
@echo ------------ $@ ------------
|
|
|
|
$(TCC) -c asmtest.S
|
2009-07-06 23:11:19 +04:00
|
|
|
objdump -D asmtest.o > asmtest.out
|
2009-04-18 16:31:35 +04:00
|
|
|
@if diff -u --ignore-matching-lines="file format" asmtest.ref asmtest.out ; then echo "ASM Auto Test OK"; fi
|
|
|
|
|
2013-04-18 00:51:51 +04:00
|
|
|
# Check that code generated by libtcc is binary compatible with
|
|
|
|
# that generated by CC
|
2013-04-18 20:27:34 +04:00
|
|
|
abitest-cc$(EXESUF): abitest.c $(top_builddir)/$(LIBTCC)
|
|
|
|
$(CC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC) $(LDFLAGS) -I$(top_srcdir)
|
|
|
|
|
2014-01-21 16:25:14 +04:00
|
|
|
abitest-tcc$(EXESUF): abitest.c libtcc.c
|
|
|
|
$(TCC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE $(LIBS) $(LDFLAGS) -I$(top_srcdir)
|
2013-04-18 00:51:51 +04:00
|
|
|
|
2015-03-04 09:52:47 +03:00
|
|
|
ABITESTS := abitest-cc$(EXESUF)
|
|
|
|
ifneq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
|
|
|
|
ABITESTS += abitest-tcc$(EXESUF)
|
|
|
|
endif
|
|
|
|
|
|
|
|
abitest: $(ABITESTS)
|
2013-04-18 00:51:51 +04:00
|
|
|
@echo ------------ $@ ------------
|
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
|
|
|
./abitest-cc$(EXESUF) $(TCCFLAGS)
|
|
|
|
if [ "$(CONFIG_arm_eabi)" != "yes" ]; then ./abitest-tcc$(EXESUF) $(TCCFLAGS); fi
|
2013-04-18 00:51:51 +04:00
|
|
|
|
2013-04-27 23:39:34 +04:00
|
|
|
vla_test$(EXESUF): vla_test.c
|
|
|
|
$(TCC) -o $@ $^ $(CPPFLAGS) $(CFLAGS)
|
|
|
|
vla_test-run: vla_test$(EXESUF)
|
|
|
|
@echo ------------ $@ ------------
|
|
|
|
./vla_test$(EXESUF)
|
|
|
|
|
2009-04-18 16:31:35 +04:00
|
|
|
# targets for development
|
|
|
|
%.bin: %.c tcc
|
|
|
|
$(TCC) -g -o $@ $<
|
|
|
|
$(DISAS) $@
|
|
|
|
|
|
|
|
instr: instr.o
|
|
|
|
objdump -d instr.o
|
|
|
|
|
|
|
|
instr.o: instr.S
|
|
|
|
$(CC) -o $@ -c $< -O2 -Wall -g
|
|
|
|
|
|
|
|
cache: tcc_g
|
|
|
|
cachegrind ./tcc_g -o /tmp/linpack -lm bench/linpack.c
|
|
|
|
vg_annotate tcc.c > /tmp/linpack.cache.log
|
|
|
|
|
|
|
|
# clean
|
|
|
|
clean:
|
2013-02-05 17:27:38 +04:00
|
|
|
$(MAKE) -C tests2 $@
|
2014-03-26 18:19:22 +04:00
|
|
|
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.cc \
|
|
|
|
*-cc *-tcc *.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
|
|
|
hello libtcc_test vla_test tcctest[1234] ex? tcc_g
|