arm64: Fix largeptr test
[tinycc.git] / tests / tests2 / Makefile
blob2434215af0c5fed7cb1247a955a126883322de10
1 TOP = ../..
2 include $(TOP)/config.mak
3 SRC = $(TOPSRC)/tests/tests2
4 VPATH = $(SRC)
6 # run local version of tcc with local libraries and includes
7 TCCFLAGS = -B$(TOP) -I$(TOPSRC)/include
8 ifdef CONFIG_WIN32
9 TCCFLAGS = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -L$(TOP)
10 endif
11 TCC = $(TOP)/tcc $(TCCFLAGS)
13 TESTS = $(patsubst %.c,%.test,$(sort $(notdir $(wildcard $(SRC)/*.c))))
15 # 34_array_assignment.test -- array assignment is not in C standard
16 SKIP = 34_array_assignment.test
18 # some tests do not pass on all platforms, remove them for now
19 ifeq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
20 SKIP += 22_floating_point.test
21 endif
22 ifeq ($(TARGETOS),Darwin)
23 SKIP += 40_stdio.test
24 endif
25 ifeq ($(ARCH),x86-64)
26 SKIP += 73_arm64.test
27 endif
28 ifeq (,$(filter i386 x86-64,$(ARCH)))
29 SKIP += 85-asm-outside-function.test
30 endif
32 # Some tests might need arguments
33 ARGS =
34 31_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
35 46_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
37 # Some tests might need different flags
38 76_dollars_in_identifiers.test : TCCFLAGS += -fdollars-in-identifiers
40 # Filter source directory in warnings/errors (out-of-tree builds)
41 FILTER = 2>&1 | sed 's,$(SRC)/,,g'
42 # Filter some always-warning
43 ifeq (-$(findstring arm,$(ARCH))-,-arm-)
44 FILTER += 2>&1 | grep -v 'warning: soft float ABI currently not supported'
45 endif
47 all test: $(filter-out $(SKIP),$(TESTS))
49 %.test: %.c %.expect
50 @echo Test: $*...
51 # test -run
52 @$(TCC) -run $< $(ARGS) $(FILTER) >$*.output 2>&1 || true
53 @diff -Nbu $(SRC)/$*.expect $*.output && rm -f $*.output
55 # automatically generate .expect files with gcc:
56 %.expect : %.c
57 (gcc -w $*.c -o a.exe && ./a.exe $(ARGS)) >$*.expect 2>&1; rm -f a.exe
59 # tell make not to delete
60 .PRECIOUS: %.expect
62 clean:
63 rm -f fred.txt *.output a.exe