|
1 | 1 | ##===- TEST.optllcdbg.Makefile -----------------------------*- Makefile -*-===##
|
2 | 2 | #
|
3 | 3 | # This test checks whether presence of debug declarations influences
|
4 |
| -# the code generator or not. |
| 4 | +# the code generator or not. |
5 | 5 | #
|
6 | 6 | # If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then
|
7 | 7 | # the code in first.s and second.s should match. Otherwise debugging information
|
|
14 | 14 | #
|
15 | 15 | ##===----------------------------------------------------------------------===##
|
16 | 16 |
|
| 17 | +CURDIR := $(shell cd .; pwd) |
| 18 | +PROGDIR := $(PROJ_SRC_ROOT) |
| 19 | +RELDIR := $(subst $(PROGDIR),,$(CURDIR)) |
| 20 | + |
17 | 21 | TESTNAME = $*
|
18 | 22 | TEST_TARGET_FLAGS = -g -O0
|
19 | 23 | LLC_DEBUG_FLAGS = -O3 $(LLCFLAGS)
|
20 | 24 | OPT_FLAGS = -std-compile-opts
|
21 | 25 | .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
|
22 | 26 |
|
23 | 27 | $(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 |
25 | 43 |
|
26 | 44 | Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
|
27 | 45 | $(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@
|
@@ -103,3 +121,7 @@ Output/%.diff: Output/%.first.s Output/%.second.s
|
103 | 121 | else \
|
104 | 122 | echo "--------- TEST-FAIL: $*"; \
|
105 | 123 | fi
|
| 124 | + |
| 125 | +Output/%.report.diff: Output/%.first.s Output/%.second.s |
| 126 | + @diff $^ > $@ |
| 127 | + |
0 commit comments