1 ##===- TEST.llcdbg.Makefile --------------------------------*- Makefile -*-===##
3 # This test checks whether presence of debug declarations influences
4 # the code generator or not.
6 # If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then
7 # the code in first.s and second.s should match. Otherwise debugging information
8 # is influencing the code generator. The Dwarf info in first.s and second.s is
9 # normally quite different, so the data directives that appear in Dwarf are
10 # stripped out before comparison.
12 # This has only been used on Darwin; the data directives to strip and grep magic
13 # might be different elsewhere.
15 ##===----------------------------------------------------------------------===##
18 TEST_TARGET_FLAGS = -g -O0
19 LLC_DEBUG_FLAGS = -O0 -regalloc=local $(LLCFLAGS)
20 .PRECIOUS: Output/%.first.s Output/%.second.s Output/%.t2b.s Output/%.t1b.s
22 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
23 test.$(TEST).%: Output/%.diff
25 Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
26 $(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@
28 Output/%.t1b.s: Output/%.t1a.bc Output/.dir $(LLC)
29 $(LLC) $(LLC_DEBUG_FLAGS) $< -o $@
31 Output/%.first.s: Output/%.t1b.s Output/.dir $(LLC)
32 grep -v '.long' < $< | grep -v '.byte' | grep -v '.short' | grep -v '.asci' | grep -v '.quad' | grep -v '## DW_AT' | grep -v '## Abbrev' | grep -v '## End Of Children' | grep -v '## DIE' | grep -v '## $$' | grep -v '^$$' > $@
34 Output/%.t2a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
35 $(LOPT) -strip-nondebug $< -f -o $@
37 Output/%.t2b.s: Output/%.t2a.bc Output/.dir $(LLC)
38 $(LLC) $(LLC_DEBUG_FLAGS) $< -o $@
40 Output/%.second.s: Output/%.t2b.s Output/.dir
41 grep -v DEBUG_VALUE < $< | grep -v '.long' | grep -v '.byte' | grep -v '.short' | grep -v '.asci' | grep -v '## DW_AT' | grep -v '## Abbrev' | grep -v '## End Of Children' | grep -v '## DIE' | grep -v '## $$' | grep -v '.quad' | grep -v '^$$' > $@
43 Output/%.diff: Output/%.first.s Output/%.second.s
44 @-if diff $^ > $@; then \
45 echo "--------- TEST-PASS: $*"; \
47 echo "--------- TEST-FAIL: $*"; \