Initial checkin
[oota-llvm.git] / test / Feature / Makefile
1 #                              test/Feature/Makefile
2 #
3 # This makefile runs a moderate number of tests against LLVM source "feature"
4 # tests, which are designed to test individual components of the LLVM language.
5 # This runs through three sets of tests, designed to test to (dis)assembler,
6 # the optimizer, and the code generator for support for the more esoteric LLVM
7 # features.
8 #
9
10 LEVEL = ../..
11 include ../Makefile.tests
12
13 TESTS  := $(wildcard *.ll)
14 OTESTS := $(addprefix Output/, $(TESTS))  # Tests in output directory
15
16 test all :: testasmdis testopt testcbe testsparc
17         @echo "All tests completed!"
18
19 testasmdis  : $(addsuffix .asmdis, $(OTESTS))
20 testopt     : $(addsuffix .opt   , $(OTESTS))
21
22 testcodegen : $(OTESTS:%.ll=%.mc)
23 testsparc   : $(OTESTS:%.ll=%.s)
24 testcbe     : $(OTESTS:%.ll=%.tc)
25
26 Output/%.asmdis: % $(LAS) $(LDIS) Output/.dir
27         @./TestAsmDisasm.sh $< $(LLVMTOOLCURRENT)
28
29 Output/%.opt: % $(LAS) $(LDIS) $(LOPT) Output/.dir
30         @./TestOptimizer.sh $< $(LLVMTOOLCURRENT)
31
32 Output/%.tc: Output/%.bc $(LDIS)
33         @echo "======== Generating C code for $<"
34         $(LDIS) -c < $< > $@    || \
35                  ( rm -f $@; $(FAILURE) $@ )
36
37 Output/%.mc: Output/%.bc $(LLC)
38         @echo "======== Generating machine instructions for $<"
39         $(LLC) -f $(LLCFLAGS) $< > $@ || \
40                  ( rm -f $@; $(FAILURE) $@ )
41
42 Output/%.s: Output/%.bc $(LLC)
43         @echo "======== Generating assembly code for $<"
44         $(LLC) -f $(LLCFLAGS) $< -o $@ || \
45                  ( rm -f $@; $(FAILURE) $@ )
46