aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2/Makefile
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-12-18 05:18:19 +0100
committerMichael Matz <matz@suse.de>2016-12-18 05:20:14 +0100
commit77d7ea04acb56f839031993c102366e30cad5c25 (patch)
tree0e31c78f0462ff78b43a5bcb488984fb3ed4d5e3 /tests/tests2/Makefile
parentcd9514abc4f4d7d90acce108b98ea2af58a1b80a (diff)
downloadtinycc-77d7ea04acb56f839031993c102366e30cad5c25.tar.gz
tinycc-77d7ea04acb56f839031993c102366e30cad5c25.tar.bz2
Fix gawk miscompile
See testcase. Function pointer use was hosed when the destination function wasn't also called normally by the program.
Diffstat (limited to 'tests/tests2/Makefile')
-rw-r--r--tests/tests2/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 2434215..166fb2a 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -34,6 +34,10 @@ ARGS =
31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
+# And some tests don't test the right thing with -run
+NORUN =
+42_function_pointer.test : NORUN = true
+
# Some tests might need different flags
76_dollars_in_identifiers.test : TCCFLAGS += -fdollars-in-identifiers
@@ -49,7 +53,12 @@ all test: $(filter-out $(SKIP),$(TESTS))
%.test: %.c %.expect
@echo Test: $*...
# test -run
- @$(TCC) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true
+ @if test -z "$(NORUN)"; then \
+ $(TCC) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true; \
+ else \
+ $(TCC) $< -o ./$*.exe $(FILTER) 2>&1 && \
+ ./$*.exe $(ARGS) >$*.output 2>&1 || true; \
+ fi
@diff -Nbu $(SRC)/$*.expect $*.output && rm -f $*.output
# automatically generate .expect files with gcc: