@@ -467,12 +467,17 @@ tcov-tes% : tcc_c$(EXESUF)
467467 @$(MAKE ) --no-print-directory TCC_LOCAL=$(CURDIR ) /$< tes$*
468468tcc_c$(EXESUF ) : $($T_FILES )
469469 $S $(TCC ) tcc.c -o $@ -ftest-coverage $(DEFINES ) $(LIBS )
470+ # run tests with sanitize option
471+ sani-tes% : tcc_s$(EXESUF )
472+ @$(MAKE ) --no-print-directory TCC_LOCAL=$(CURDIR ) /$< tes$*
473+ tcc_s$(EXESUF ) : $($T_FILES )
474+ $S $(CC ) tcc.c -o $@ -fsanitize=address,undefined $(DEFINES ) $(CFLAGS ) $(LIBS )
470475# test the installed tcc instead
471476test-install : $(TCCDEFS_H )
472477 @$(MAKE ) -C tests TESTINSTALL=yes # _all
473478
474479clean :
475- @rm -f tcc * -tcc tcc_p tcc_c
480+ @rm -f tcc * -tcc tcc_p tcc_c tcc_s
476481 @rm -f tags ETAGS * .o * .a * .so* * .out * .log lib* .def * .exe * .dll
477482 @rm -f a.out * .dylib * _.h * .pod * .tcov
478483 @$(MAKE ) -s -C lib $@
@@ -501,8 +506,10 @@ help:
501506 @echo " run all/single test(s) from tests2, optionally update .expect"
502507 @echo " make testspp.all / make testspp.17"
503508 @echo " run all/single test(s) from tests/pp"
504- @echo " make tcov-test / tcov-tests2... / tcov-testspp... "
509+ @echo " make tcov-test / tcov-tests2.37 / tcov-testspp.17 "
505510 @echo " run tests as above with code coverage. After test(s) see tcc_c$( EXESUF) .tcov"
511+ @echo " make sani-test / sani-tests2.37 / sani-testspp.17"
512+ @echo " run tests as above with sanitize option."
506513 @echo " make test-install"
507514 @echo " run tests with the installed tcc"
508515 @echo " Other supported make targets:"
0 commit comments