Allow local redefinition of enumerator
[tinycc.git] / tests / tests2 / Makefile
blobbd6f2c1dcb9c66947422c8074059d225afab8f59
1 TOP = ../..
2 include $(TOP)/Makefile
3 VPATH = $(top_srcdir)/tests/tests2
5 TCCFLAGS = -B$(TOP) -I$(top_srcdir)/include
6 ifdef CONFIG_WIN32
7 TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
8 endif
10 ifeq ($(TARGETOS),Darwin)
11 CFLAGS += -Wl,-flat_namespace,-undefined,warning
12 TCCFLAGS += -D_ANSI_SOURCE
13 export MACOSX_DEPLOYMENT_TARGET:=10.2
14 endif
16 TCC = $(TOP)/tcc $(TCCFLAGS)
18 TESTS = \
19 00_assignment.test \
20 01_comment.test \
21 02_printf.test \
22 03_struct.test \
23 04_for.test \
24 05_array.test \
25 06_case.test \
26 07_function.test \
27 08_while.test \
28 09_do_while.test \
29 10_pointer.test \
30 11_precedence.test \
31 12_hashdefine.test \
32 13_integer_literals.test \
33 14_if.test \
34 15_recursion.test \
35 16_nesting.test \
36 17_enum.test \
37 18_include.test \
38 19_pointer_arithmetic.test \
39 20_pointer_comparison.test \
40 21_char_array.test \
41 22_floating_point.test \
42 23_type_coercion.test \
43 24_math_library.test \
44 25_quicksort.test \
45 26_character_constants.test \
46 27_sizeof.test \
47 28_strings.test \
48 29_array_address.test \
49 31_args.test \
50 32_led.test \
51 33_ternary_op.test \
52 35_sizeof.test \
53 36_array_initialisers.test \
54 37_sprintf.test \
55 38_multiple_array_index.test \
56 39_typedef.test \
57 40_stdio.test \
58 41_hashif.test \
59 42_function_pointer.test \
60 43_void_param.test \
61 44_scoped_declarations.test \
62 45_empty_for.test \
63 47_switch_return.test \
64 48_nested_break.test \
65 49_bracket_evaluation.test \
66 50_logical_second_arg.test \
67 51_static.test \
68 52_unnamed_enum.test \
69 54_goto.test \
70 55_lshift_type.test \
71 56_btype_excess-1.test \
72 57_btype_excess-2.test \
73 58_function_redefinition.test \
74 59_function_array.test \
75 60_enum_redefinition.test \
76 61_undefined_enum.test \
77 62_enumerator_redefinition.test \
78 63_local_enumerator_redefinition.test
80 # 30_hanoi.test -- seg fault in the code, gcc as well
81 # 34_array_assignment.test -- array assignment is not in C standard
82 # 46_grep.test -- does not compile even with gcc
84 # some tests do not pass on all platforms, remove them for now
85 ifeq ($(TARGETOS),Darwin)
86 TESTS := $(filter-out 40_stdio.test,$(TESTS))
87 endif
88 ifdef CONFIG_WIN32
89 TESTS := $(filter-out 24_math_library.test 28_strings.test,$(TESTS))
90 endif
92 %.test: %.c %.expect
93 @echo Test: $*...
94 @if [ "x`echo $* | grep args`" != "x" ]; \
95 then $(TCC) $< -norunsrc -run $(notdir $<) - arg1 arg2 arg3 arg4 >$*.output 2>&1; \
96 else $(TCC) -run $< >$*.output 2>&1; \
97 fi || true
98 @if diff -bu $(<:.c=.expect) $*.output ; \
99 then rm -f $*.output; \
100 else exit 1; \
103 all test: $(TESTS)
105 clean:
106 rm -vf fred.txt *.output