Skip to content

Commit

Permalink
Add report for optllcdbg test. rdar://8212016
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@109118 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Jim Grosbach committed Jul 22, 2010
1 parent 9c9ac29 commit b873fa9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
26 changes: 24 additions & 2 deletions TEST.optllcdbg.Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,14 +14,32 @@
#
##===----------------------------------------------------------------------===##

CURDIR := $(shell cd .; pwd)
PROGDIR := $(PROJ_SRC_ROOT)
RELDIR := $(subst $(PROGDIR),,$(CURDIR))

TESTNAME = $*
TEST_TARGET_FLAGS = -g -O0
LLC_DEBUG_FLAGS = -O3 $(LLCFLAGS)
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 $@
Expand Down Expand Up @@ -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 $^ > $@

20 changes: 20 additions & 0 deletions TEST.optllcdbg.report
Original file line number Diff line number Diff line change
@@ -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-(.*)'],
[]
);

0 comments on commit b873fa9

Please sign in to comment.