1 ##===- TEST.nightly.Makefile ------------------------------*- Makefile -*--===##
3 # This test is used in conjunction with the llvm/utils/NightlyTest* stuff to
4 # generate information about program status for the nightly report.
6 ##===----------------------------------------------------------------------===##
8 CURDIR := $(shell cd .; pwd)
9 PROGDIR := $(PROJ_SRC_ROOT)
10 RELDIR := $(subst $(PROGDIR),,$(CURDIR))
13 REPORT_DEPENDENCIES :=
15 REPORTS_TO_GEN += llc compile
16 REPORT_DEPENDENCIES += $(LLC) $(LOPT)
19 REPORTS_TO_GEN += jit compile
20 REPORT_DEPENDENCIES += $(LLI) $(LOPT)
23 REPORTS_TO_GEN += cbe compile
24 REPORT_DEPENDENCIES += $(CBE) $(LOPT)
27 REPORTS_TO_GEN += llc-beta compile
28 REPORT_DEPENDENCIES += $(LLC) $(LOPT)
31 REPORTS_TO_GEN += opt-beta compile
32 REPORT_DEPENDENCIES += $(LOPT)
34 REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN))
37 $(PROGRAMS_TO_TEST:%=Output/%.nightly.compile.report.txt): \
38 Output/%.nightly.compile.report.txt: Output/%.llvm.bc
40 @-if test -f Output/$*.linked.bc.info; then \
41 echo "TEST-PASS: compile $(RELDIR)/$*" >> $@;\
42 printf "TEST-RESULT-compile: " >> $@;\
43 grep "Total Execution Time" Output/$*.linked.bc.info | tail -n 1 >> $@;\
45 printf "TEST-RESULT-compile: " >> $@;\
49 echo "TEST-FAIL: compile $(RELDIR)/$*" >> $@;\
53 $(PROGRAMS_TO_TEST:%=Output/%.nightly.nat.report.txt): \
54 Output/%.nightly.nat.report.txt: Output/%.out-nat
56 @printf "TEST-RESULT-nat-time: " >> $@
57 -grep "^program" Output/$*.out-nat.time >> $@
60 $(PROGRAMS_TO_TEST:%=Output/%.nightly.llc.report.txt): \
61 Output/%.nightly.llc.report.txt: Output/%.exe-llc
63 @-if test -f Output/$*.exe-llc; then \
64 head -n 100 Output/$*.exe-llc >> $@; \
65 echo "TEST-PASS: llc $(RELDIR)/$*" >> $@;\
66 printf "TEST-RESULT-llc: " >> $@;\
67 grep "Total Execution Time" Output/$*.llc.s.info | tail -n 1 >> $@;\
68 printf "TEST-RESULT-llc-time: " >> $@;\
69 grep "^program" Output/$*.out-llc.time >> $@;\
72 echo "TEST-FAIL: llc $(RELDIR)/$*" >> $@;\
75 # LLC experimental tests
76 $(PROGRAMS_TO_TEST:%=Output/%.nightly.llc-beta.report.txt): \
77 Output/%.nightly.llc-beta.report.txt: Output/%.llvm.bc Output/%.exe-llc-beta
79 @-if test -f Output/$*.exe-llc-beta; then \
80 head -n 100 Output/$*.exe-llc-beta >> $@; \
81 echo "TEST-PASS: llc-beta $(RELDIR)/$*" >> $@;\
82 printf "TEST-RESULT-llc-beta: " >> $@;\
83 grep "Total Execution Time" Output/$*.llc-beta.s.info | tail -n 1 >> $@;\
84 printf "TEST-RESULT-llc-beta-time: " >> $@;\
85 grep "^program" Output/$*.out-llc-beta.time >> $@;\
88 echo "TEST-FAIL: llc-beta $(RELDIR)/$*" >> $@;\
91 # OPT experimental tests
92 $(PROGRAMS_TO_TEST:%=Output/%.nightly.opt-beta.report.txt): \
93 Output/%.nightly.opt-beta.report.txt: Output/%.exe-opt-beta
95 @-if test -f Output/$*.exe-opt-beta; then \
96 head -n 100 Output/$*.exe-opt-beta >> $@; \
97 echo "TEST-PASS: opt-beta $(RELDIR)/$*" >> $@;\
98 printf "TEST-RESULT-opt-beta: " >> $@;\
99 grep "Total Execution Time" Output/$*.opt-beta.s.info | tail -n 1 >> $@;\
100 printf "TEST-RESULT-opt-beta-time: " >> $@;\
101 grep "^program" Output/$*.out-opt-beta.time >> $@;\
104 echo "TEST-FAIL: opt-beta $(RELDIR)/$*" >> $@;\
108 $(PROGRAMS_TO_TEST:%=Output/%.nightly.cbe.report.txt): \
109 Output/%.nightly.cbe.report.txt: Output/%.exe-cbe
111 @-if test -f Output/$*.exe-cbe; then \
112 head -n 100 Output/$*.exe-cbe >> $@; \
113 echo "TEST-PASS: cbe $(RELDIR)/$*" >> $@;\
114 printf "TEST-RESULT-cbe-time: " >> $@;\
115 grep "^program" Output/$*.out-cbe.time >> $@;\
118 echo "TEST-FAIL: cbe $(RELDIR)/$*" >> $@;\
122 $(PROGRAMS_TO_TEST:%=Output/%.nightly.jit.report.txt): \
123 Output/%.nightly.jit.report.txt: Output/%.exe-jit
125 @-if test -f Output/$*.exe-jit; then \
126 head -n 100 Output/$*.exe-jit >> $@; \
127 echo "TEST-PASS: jit $(RELDIR)/$*" >> $@;\
128 printf "TEST-RESULT-jit-time: " >> $@;\
129 grep "^program" Output/$*.out-jit.time >> $@;\
131 printf "TEST-RESULT-jit-comptime: " >> $@;\
132 grep "Total Execution Time" Output/$*.out-jit.info | tail -n 1 >> $@;\
135 echo "TEST-FAIL: jit $(RELDIR)/$*" >> $@;\
138 # Overall tests: just run subordinate tests
139 $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
140 Output/%.$(TEST).report.txt: $(addprefix Output/%.nightly., $(REPORTS_SUFFIX))
142 @echo "---------------------------------------------------------------" >> $@
143 @echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
144 @echo "---------------------------------------------------------------" >> $@
145 -cat $(addprefix Output/$*.nightly., $(REPORTS_SUFFIX)) >> $@
149 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
150 test.$(TEST).%: Output/%.$(TEST).report.txt