fix UB in constant folding of double -> signed integer conversion
[tinycc.git] / tests / pp / Makefile
blob7e989c99fbf6c5b5abb654d1d57465a41004b0de
2 # credits: 01..13.c from the pcc cpp-tests suite
5 TOP = ../..
6 include $(TOP)/Makefile
7 SRC = $(TOPSRC)/tests/pp
8 VPATH = $(SRC)
10 files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1)))
11 TESTS = $(call files,c) $(call files,S)
13 all test testspp.all: $(sort $(TESTS))
15 DIFF_OPTS = -Nu -b
17 # Filter source directory in warnings/errors (out-of-tree builds)
18 FILTER = 2>&1 | sed 's,$(SRC)/,,g'
20 %.test: %.c %.expect
21 @echo PPTest $* ...
22 -@$(TCC) -E -P $< $(FILTER) >$*.output 2>&1 ; \
23 diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
24 && rm -f $*.output
26 %.test: %.S %.expect
27 @echo PPTest $* ...
28 -@$(TCC) -E -P $< $(FILTER) >$*.output 2>&1 ; \
29 diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
30 && rm -f $*.output
32 testspp.%: %.test ;
34 # generate .expect file with tcc, e.g. "make testspp.17+"
35 testspp.%+: %.c
36 $(TCC) -E -P $*.[cS] -o $*.expect
38 # automatically generate .expect files with gcc:
39 %.expect: # %.c
40 gcc -E -P $*.[cS] >$*.expect 2>&1
42 # tell make not to delete
43 .PRECIOUS: %.expect
45 clean:
46 rm -f *.output
48 02.test : DIFF_OPTS += -w
49 # 15.test : DIFF_OPTS += -I"^XXX:"
51 # diff options:
52 # -b ighore space changes
53 # -w ighore all whitespace
54 # -B ignore blank lines
55 # -I <RE> ignore lines matching RE