Fix initializing members multiple times
[tinycc.git] / tests / pp / Makefile
blob4a770359d3286ccc634d2964a6a3ed49787b3194
2 # credits: 01..13.c from the pcc cpp-tests suite
5 TOP = ../..
6 include $(TOP)/config.mak
7 SRC = $(TOPSRC)/tests/pp
8 VPATH = $(SRC)
10 TCC = ../../tcc
11 files = $(patsubst %.$1,%.test,$(notdir $(wildcard $(SRC)/*.$1)))
12 TESTS = $(call files,c) $(call files,S)
14 all test : $(sort $(TESTS))
16 DIFF_OPTS = -Nu -b -B -I "^\#"
18 %.test: %.c %.expect
19 @echo PPTest $* ...
20 -@$(TCC) -E -P $< >$*.output 2>&1 ; \
21 diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
22 && rm -f $*.output
24 %.test: %.S %.expect
25 @echo PPTest $* ...
26 -@$(TCC) -E -P $< >$*.output 2>&1 ; \
27 diff $(DIFF_OPTS) $(SRC)/$*.expect $*.output \
28 && rm -f $*.output
30 # automatically generate .expect files with gcc:
31 %.expect: %.c
32 gcc -E -P $< >$*.expect 2>&1
34 %.expect: %.S
35 gcc -E -P $< >$*.expect 2>&1
37 # tell make not to delete
38 .PRECIOUS: %.expect
40 clean:
41 rm -f *.output
43 02.test : DIFF_OPTS += -w
44 15.test : DIFF_OPTS += -I"^XXX:"
46 # diff options:
47 # -b ighore space changes
48 # -w ighore all whitespace
49 # -B ignore blank lines
50 # -I <RE> ignore lines matching RE