From 77d7ea04acb56f839031993c102366e30cad5c25 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sun, 18 Dec 2016 05:18:19 +0100 Subject: Fix gawk miscompile See testcase. Function pointer use was hosed when the destination function wasn't also called normally by the program. --- tests/tests2/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/tests2/Makefile') 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: -- cgit v1.3.1