blob: 0520625fcf29f850a47fe9e095adfabd2ced6810 [file] [log] [blame]
Daniel Dunbar5ce61572009-01-28 02:01:23 +00001# Usage: make test.N.report
2#
3# COUNT can be over-ridden to change the number of tests generated per
4# file, and TESTARGS is used to change the type generation. Make sure
5# to 'make clean' after changing either of these parameters.
6
7ABITESTGEN := ../ABITestGen.py
Daniel Dunbar59ebd282009-01-29 20:36:50 +00008TESTARGS := --max-args 0 --test-layout
Daniel Dunbar5ce61572009-01-28 02:01:23 +00009COUNT := 1000
10TIMEOUT := 5
11
12CFLAGS := -std=gnu99
13
Anders Carlsson7b3817d2009-07-25 00:26:00 +000014X_COMPILER := llvm-gcc
Eli Friedmand9d38c42009-05-25 22:07:09 +000015Y_COMPILER := clang
Daniel Dunbar5ce61572009-01-28 02:01:23 +000016CC := gcc
17
Anders Carlsson7b3817d2009-07-25 00:26:00 +000018ifeq (0, 0)
Daniel Dunbar5ce61572009-01-28 02:01:23 +000019X_CFLAGS := -m32
20Y_CFLAGS := -m32
21CC_CFLAGS := -m32
22else
23X_CFLAGS := -m64
24Y_CFLAGS := -m64
25CC_CFLAGS := -m64
26endif
27
28.PHONY: test.%.report
29test.%.report: test.%.x.diff test.%.y.diff
30 @for t in $^; do \
31 if [ -s $$t ]; then \
32 echo "TEST $*: $$t failed"; \
33 fi; \
34 done
35
36.PHONY: test.%.build
37test.%.build: test.%.ref test.%.x test.%.y
38 @true
39
40###
41
42.PRECIOUS: test.%.x.diff
43test.%.x.diff: test.%.ref.out test.%.x.out
44 -diff $^ > $@
45.PRECIOUS: test.%.y.diff
46test.%.y.diff: test.%.ref.out test.%.y.out
47 -diff $^ > $@
48
49.PRECIOUS: test.%.out
50test.%.out: test.%
51 -./$< > $@
52
53.PRECIOUS: test.%.ref
54test.%.ref: test.%.c
55 $(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
56.PRECIOUS: test.%.x
57test.%.x: test.%.c
58 $(X_COMPILER) $(CFLAGS) $(X_CFLAGS) -o $@ $^
59.PRECIOUS: test.%.y
60test.%.y: test.%.c
61 $(Y_COMPILER) $(CFLAGS) $(Y_CFLAGS) -o $@ $^
62
63.PRECIOUS: test.%.c
64test.%.c: $(ABITESTGEN)
65 $(ABITESTGEN) $(TESTARGS) -o $@ --min=$(shell expr $* '*' $(COUNT)) --count=$(COUNT)
66
67clean:
68 rm -f test.* *~