1 ##===- TEST.dbgopt.Makefile --------------------------------*- Makefile -*-===##
3 # This test checks whether presence of debugging information influences
4 # the optimizer or not.
6 # If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then
7 # first.bc and second.bc should match. Otherwise debugging information
8 # is influencing the optimizer.
10 # $ opt input.bc -strip-nondebug -strip-debug -std-compile-output -strip -o first.bc
11 # $ opt input.bc -strip-nondebug -std-compile-output -strip-debug -strip -o second.bc
13 ##===----------------------------------------------------------------------===##
16 TEST_TARGET_FLAGS = -g -O0
17 .PRECIOUS: Output/%.first.ll Output/%.second.ll
19 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
20 test.$(TEST).%: Output/%.diff
22 Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
23 $(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@
25 Output/%.t1b.bc: Output/%.t1a.bc Output/.dir $(LOPT)
26 $(LOPT) -strip-debug $< -f -o $@
28 Output/%.t1c.bc: Output/%.t1b.bc Output/.dir $(LOPT)
29 $(LOPT) -std-compile-opts $< -f -o $@
31 Output/%.t1d.bc: Output/%.t1c.bc Output/.dir $(LOPT)
32 $(LOPT) -strip $< -f -o $@
34 Output/%.first.ll: Output/%.t1d.bc $(LDIS)
35 /bin/cp -f $< Output/$*.t.bc
36 $(LDIS) Output/$*.t.bc -f -o $@
38 Output/%.t2b.bc: Output/%.t1a.bc Output/.dir $(LOPT)
39 $(LOPT) -std-compile-opts $< -f -o $@
41 Output/%.t2c.bc: Output/%.t2b.bc Output/.dir $(LOPT)
42 $(LOPT) -strip-debug $< -f -o $@
44 Output/%.t2d.bc: Output/%.t2c.bc Output/.dir $(LOPT)
45 $(LOPT) -strip $< -f -o $@
47 # force both t's to have the same name to avoid bogus filename difference
48 # force first to be completed before second to avoid race condition copying t
49 Output/%.second.ll: Output/%.t2d.bc Output/%.first.ll $(LDIS)
50 /bin/rm -rf Output/$*.t.bc
51 /bin/cp -f $< Output/$*.t.bc
52 $(LDIS) Output/$*.t.bc -f -o $@
54 Output/%.diff: Output/%.first.ll Output/%.second.ll
55 @-if diff $^ > $@; then \
56 echo "--------- TEST-PASS: $*"; \
58 echo "--------- TEST-FAIL: $*"; \