5dc7ffe2392226f5549fffd83ba9b506f79baf66
[oota-llvm.git] / test / CBackend / Makefile
1 #                    test/Regression/CBackend/Makefile
2 #
3 # This directory contains regression tests for the C backend for LLVM.  
4 # These testcases are assembled with the LLVM assembler, then disassembled into
5 # C code.  The C code should be compilable with the standard C compiler.
6 #
7 LEVEL = ../../..
8 include $(LEVEL)/test/Makefile.tests
9
10 .PRECIOUS: Output/%.c
11
12 TESTS := $(wildcard *.ll)
13 FTESTS := $(wildcard *.llx)   # Freeform tests
14
15 all:: $(addprefix Output/, $(TESTS:%.ll=%.to)) $(addprefix Output/, $(FTESTS:%.llx=%.llx.out))
16
17 Output/%.to: Output/%.c
18         $(CC) -c -Werror $< -o $@ || \
19                 (rm -f $@; $(FAILURE) $@ )
20
21 Output/%.c: %.ll Output/.dir $(LAS) $(LDIS)
22         $(LAS) < $< | $(LDIS) -c > $@ || \
23                 (rm -f $@; $(FAILURE) $@ )
24
25 Output/%.llx.out: %.llx Output/.dir $(LAS) $(LDIS)
26         -$(TESTRUNR) $<
27