From a1c12b9fb9bd2452a90d3cf504574b3605c09702 Mon Sep 17 00:00:00 2001 From: grischka Date: Sun, 18 Dec 2016 22:05:42 +0100 Subject: 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 --- tests/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/Makefile') 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 -- cgit v1.3.1