Skip to content

Commit b873fa9

Browse files
author
Jim Grosbach
committed
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
1 parent 9c9ac29 commit b873fa9

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

TEST.optllcdbg.Makefile

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##===- TEST.optllcdbg.Makefile -----------------------------*- Makefile -*-===##
22
#
33
# This test checks whether presence of debug declarations influences
4-
# the code generator or not.
4+
# the code generator or not.
55
#
66
# If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then
77
# the code in first.s and second.s should match. Otherwise debugging information
@@ -14,14 +14,32 @@
1414
#
1515
##===----------------------------------------------------------------------===##
1616

17+
CURDIR := $(shell cd .; pwd)
18+
PROGDIR := $(PROJ_SRC_ROOT)
19+
RELDIR := $(subst $(PROGDIR),,$(CURDIR))
20+
1721
TESTNAME = $*
1822
TEST_TARGET_FLAGS = -g -O0
1923
LLC_DEBUG_FLAGS = -O3 $(LLCFLAGS)
2024
OPT_FLAGS = -std-compile-opts
2125
.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
2226

2327
$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
24-
test.$(TEST).%: Output/%.diff
28+
test.$(TEST).%: Output/%.$(TEST).report.txt
29+
@-cat $<
30+
31+
$(PROGRAMS_TO_TEST:%=Output/%.optllcdbg.report.txt): \
32+
Output/%.optllcdbg.report.txt: Output/%.report.diff
33+
@echo > $@
34+
@echo "---------------------------------------------------------------" >> $@
35+
@echo ">>> ========= '$(RELDIR)/$*' Program" >> $@
36+
@echo "---------------------------------------------------------------" >> $@
37+
@echo >> $@
38+
@-if test -s Output/$^ ; then \
39+
echo "TEST-FAIL" >> $@;\
40+
else \
41+
echo "TEST-PASS" >> $@;\
42+
fi
2543

2644
Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
2745
$(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@
@@ -103,3 +121,7 @@ Output/%.diff: Output/%.first.s Output/%.second.s
103121
else \
104122
echo "--------- TEST-FAIL: $*"; \
105123
fi
124+
125+
Output/%.report.diff: Output/%.first.s Output/%.second.s
126+
@diff $^ > $@
127+

TEST.optllcdbg.report

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
##=== TEST.optllcdbg.report - Compare codegen w/ dbg info ------*- perl -*-===##
2+
#
3+
# This file defines a report to be generated for the optllcdbg test.
4+
#
5+
##===----------------------------------------------------------------------===##
6+
7+
# Sort by name
8+
$SortCol = 1;
9+
$TrimRepeatedPrefix = 1;
10+
11+
# These are the columns for the report. The first entry is the header for the
12+
# column, the second is the regex to use to match the value. Empty list create
13+
# seperators, and closures may be put in for custom processing.
14+
(
15+
# Name
16+
["Name:" , '\'([^\']+)\' Program'],
17+
[],
18+
["Result:", 'TEST-(.*)'],
19+
[]
20+
);

0 commit comments

Comments
 (0)