diff --git a/tests/Makefile b/tests/Makefile index 85657bde..9fe213e9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -77,7 +77,7 @@ hello-run: ../examples/ex1.c libtes%: libtcc_tes%$(EXESUF) @echo ------------ $@ ------------ - ./libtcc_tes$*$(EXESUF) $(TCCFLAGS) + ./libtcc_tes$*$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) libtcc_tes%$(EXESUF): libtcc_tes%.c $(LIBTCC) $(CC) -o $@ $^ $(CFLAGS) $(LIBS) diff --git a/tests/libtcc_test_mt.c b/tests/libtcc_test_mt.c index cebdec36..56294e4c 100644 --- a/tests/libtcc_test_mt.c +++ b/tests/libtcc_test_mt.c @@ -102,6 +102,14 @@ void parse_args(TCCState *s) tcc_add_include_path(s, a+2); else if (a[1] == 'L') tcc_add_library_path(s, a+2); + else if (a[1] == 'D') { + char *eq = strchr(a+2, '='); + if (eq) { + *eq = 0; + tcc_define_symbol(s, a+2, eq+1); + *eq = '='; + } + } } } }