aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-18 22:05:42 +0100
committergrischka <grischka>2016-12-18 22:05:42 +0100
commita1c12b9fb9bd2452a90d3cf504574b3605c09702 (patch)
tree3166ee219d1463f5ed5bfc00aada753502fbe706 /tests/Makefile
parentf7fc4f02cf15e061b98b2224332b1739c69ef9db (diff)
downloadtinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.gz
tinycc-a1c12b9fb9bd2452a90d3cf504574b3605c09702.tar.bz2
tests: add memory leak test
Also ... tcctest.c: - exclude stuff that gcc doesn't compile on windows. libtcc.c/tccpp.c: - use unsigned for memory sizes to avoid printf format warnings - use "file:line: message" to make IDE error parsers happy. tccgen.c: fix typo
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/Makefile b/tests/Makefile
index a86e8a2..0cdca35 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -5,7 +5,7 @@
TOP = ..
include $(TOP)/Makefile
VPATH = $(TOPSRC)/tests $(TOPSRC) $(TOP)
-CFLAGS = -I$(TOPSRC) -I$(TOP)
+CFLAGS := $(filter-out -W% -g% -O%,$(CFLAGS)) -I$(TOPSRC)
# what tests to run
TESTS = \
@@ -13,6 +13,7 @@ TESTS = \
hello-run \
libtest \
test3 \
+ memtest \
dlltest \
abitest \
vla_test-run \
@@ -145,6 +146,12 @@ ifndef CONFIG_WIN32
endif
@rm tcc2$(EXESUF) libtcc2$(DLLSUF)
+memtest:
+ @echo ------------ $@ ------------
+ $(CC) $(CFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE -DMEM_DEBUG=2 ../tcc.c $(LIBS) -o memtest-tcc$(EXESUF)
+ ./memtest-tcc$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE ../tcc.c $(LIBS)
+ ./memtest-tcc$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE -run ../tcc.c $(TCCFLAGS) tcctest.c
+
# memory and bound check auto test
BOUNDS_OK = 1 4 8 10 14