blob: a3aef4a4b88954a54260c1e6e6151f266b9352e0 [file] [log] [blame]
##===- TEST.beta-compare.Makefile --------------------------*- Makefile -*-===##
#
# This test runs llc and llc-beta and generates numbers to compare their static
# values produced by -stats.
#
##===----------------------------------------------------------------------===##
LLC_OPTS = $(LLCFLAGS) -f -o=/dev/null -stats -time-passes
CURDIR := $(shell cd .; pwd)
PROGDIR := $(PROJ_SRC_ROOT)
RELDIR := $(subst $(PROGDIR),,$(CURDIR))
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).llc-info.txt): \
Output/%.$(TEST).llc-info.txt: Output/%.llvm.bc $(LLC)
- $(LLC) $(LLC_OPTS) $< -info-output-file=$@
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).llc-beta-info.txt): \
Output/%.$(TEST).llc-beta-info.txt: Output/%.llvm.bc $(LLC)
- $(LLC) $(LLC_OPTS) $(LLCBETAOPTION) $< -info-output-file=$@
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
Output/%.$(TEST).report.txt: Output/%.$(TEST).llc-info.txt Output/%.$(TEST).llc-beta-info.txt
$(VERB) $(RM) -f $@
@echo "---------------------------------------------------------------" >> $@
@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
@echo "---------------------------------------------------------------" >> $@
-@printf "LLC: " >> $@
-grep 'Number of machine instrs printed' Output/$*.$(TEST).llc-info.txt >> $@
-@printf "LLCBETA: " >> $@
-grep 'Number of machine instrs printed' Output/$*.$(TEST).llc-beta-info.txt >> $@
$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
test.$(TEST).%: Output/%.$(TEST).report.txt
@cat $<
# Define REPORT_DEPENDENCIES so that the report is regenerated if llc changes
#
REPORT_DEPENDENCIES := $(LLC)