From b873fa9a68218ae9cc47e07ae1b2db265683c21b Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 22 Jul 2010 16:54:56 +0000 Subject: [PATCH] Add report for optllcdbg test. rdar://8212016 git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@109118 91177308-0d34-0410-b5e6-96231b3b80d8 --- TEST.optllcdbg.Makefile | 26 ++++++++++++++++++++++++-- TEST.optllcdbg.report | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 TEST.optllcdbg.report diff --git a/TEST.optllcdbg.Makefile b/TEST.optllcdbg.Makefile index 53c28414..2719d4e0 100644 --- a/TEST.optllcdbg.Makefile +++ b/TEST.optllcdbg.Makefile @@ -1,7 +1,7 @@ ##===- TEST.optllcdbg.Makefile -----------------------------*- Makefile -*-===## # # This test checks whether presence of debug declarations influences -# the code generator or not. +# the code generator or not. # # If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then # the code in first.s and second.s should match. Otherwise debugging information @@ -14,6 +14,10 @@ # ##===----------------------------------------------------------------------===## +CURDIR := $(shell cd .; pwd) +PROGDIR := $(PROJ_SRC_ROOT) +RELDIR := $(subst $(PROGDIR),,$(CURDIR)) + TESTNAME = $* TEST_TARGET_FLAGS = -g -O0 LLC_DEBUG_FLAGS = -O3 $(LLCFLAGS) @@ -21,7 +25,21 @@ OPT_FLAGS = -std-compile-opts .PRECIOUS: Output/%.first.s Output/%.second.s Output/%.t2c.s Output/%.t1c.s Output/%.t2b.bc Output/%.t1b.bc Output/%.t1a.bc Output/%.t2a.bc $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ -test.$(TEST).%: Output/%.diff +test.$(TEST).%: Output/%.$(TEST).report.txt + @-cat $< + +$(PROGRAMS_TO_TEST:%=Output/%.optllcdbg.report.txt): \ +Output/%.optllcdbg.report.txt: Output/%.report.diff + @echo > $@ + @echo "---------------------------------------------------------------" >> $@ + @echo ">>> ========= '$(RELDIR)/$*' Program" >> $@ + @echo "---------------------------------------------------------------" >> $@ + @echo >> $@ + @-if test -s Output/$^ ; then \ + echo "TEST-FAIL" >> $@;\ + else \ + echo "TEST-PASS" >> $@;\ + fi Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT) $(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@ @@ -103,3 +121,7 @@ Output/%.diff: Output/%.first.s Output/%.second.s else \ echo "--------- TEST-FAIL: $*"; \ fi + +Output/%.report.diff: Output/%.first.s Output/%.second.s + @diff $^ > $@ + diff --git a/TEST.optllcdbg.report b/TEST.optllcdbg.report new file mode 100644 index 00000000..e7857345 --- /dev/null +++ b/TEST.optllcdbg.report @@ -0,0 +1,20 @@ +##=== TEST.optllcdbg.report - Compare codegen w/ dbg info ------*- perl -*-===## +# +# This file defines a report to be generated for the optllcdbg test. +# +##===----------------------------------------------------------------------===## + +# Sort by name +$SortCol = 1; +$TrimRepeatedPrefix = 1; + +# These are the columns for the report. The first entry is the header for the +# column, the second is the regex to use to match the value. Empty list create +# seperators, and closures may be put in for custom processing. +( +# Name + ["Name:" , '\'([^\']+)\' Program'], + [], + ["Result:", 'TEST-(.*)'], + [] + );