1 ##===- TEST.dbgopt.Makefile --------------------------------*- Makefile -*-===##
3 # This test checks whether presense of debugging information influences
4 # the optimizer or not.
6 # $ clang -fno-verbose-asm -g -mllvm --disable-debug-info-print -Os \
7 # -S foo.c -o foo.first.s
8 # $ clang -fno-verbose-asm -Os -S foo.c -o foo.second.s
9 # $ diff foo.first.s foo.second.s
11 ##===----------------------------------------------------------------------===##
14 .PRECIOUS: Output/%.first.s Output/%.second.s
16 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
17 test.$(TEST).%: Output/%.diff
19 Output/%.s: %.c Output/.dir $(INCLUDES)
20 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
21 -fno-verbose-asm -mllvm --disable-debug-info-print \
22 -S ${PROJ_SRC_DIR}/$*.c -o Output/$*.first.s
23 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os \
24 -fno-verbose-asm -S ${PROJ_SRC_DIR}/$*.c -o Output/$*.second.s
25 @-if diff Output/$*.first.s Output/$*.second.s > $@; then \
26 echo "--------- TEST-PASS: $*" > Output/$*.dbgopt.report.txt; \
28 echo "--------- TEST-FAIL: $*" > Output/$*.dbgopt.report.txt; \
31 Output/%.s: %.cpp Output/.dir $(INCLUDES)
32 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
33 -fno-verbose-asm -mllvm --disable-debug-info-print \
34 -S ${PROJ_SRC_DIR}/$*.cpp -o Output/$*.first.s
35 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
36 -fno-verbose-asm ${PROJ_SRC_DIR}/$*.cpp -o Output/$*.second.s
37 @-if diff Output/$*.first.s Output/$*.second.s > $@; then \
38 echo "--------- TEST-PASS: $*" > Output/$*.dbgopt.report.txt; \
40 echo "--------- TEST-FAIL: $*" > Output/$*.dbgopt.report.txt; \
43 Output/%.s: %.cc Output/.dir $(INCLUDES)
44 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
45 -fno-verbose-asm -mllvm -disable-debug-info-print \
46 -S ${PROJ_SRC_DIR}/$*.cc -o Output/$*.first.s
47 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
48 -fno-verbose-asm ${PROJ_SRC_DIR}/$*.cc -o Output/$*.second.s
49 @-if diff Output/$*.first.s Output/$*.second.s > $@; then \
50 echo "--------- TEST-PASS: $*" > Output/$*.dbgopt.report.txt; \
52 echo "--------- TEST-FAIL: $*" > Output/$*.dbgopt.report.txt; \
55 Output/%.s: %.m Output/.dir $(INCLUDES)
56 -$(LLVMCC) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
57 -fno-verbose-asm -mllvm --disable-debug-info-print \
58 -S ${PROJ_SRC_DIR}/$*.m -o Output/$*.first.s
59 -$(LLVMCC) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
60 -fno-verbose-asm ${PROJ_SRC_DIR}/$*.m -o Output/$*.second.s
61 @-if diff Output/$*.first.s Output/$*.second.s > $@; then \
62 echo "--------- TEST-PASS: $*" > Output/$*.dbgopt.report.txt; \
64 echo "--------- TEST-FAIL: $*" > Output/$*.dbgopt.report.txt; \
67 Output/%.s: %.mm Output/.dir $(INCLUDES)
68 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
69 -fno-verbose-asm -mllvm --disable-debug-info-print \
70 -S ${PROJ_SRC_DIR}/$*.mm -o Output/$*.first.s
71 -$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
72 -fno-verbose-asm ${PROJ_SRC_DIR}/$*.mm -o Output/$*.second.s
73 @-if diff Output/$*.first.s Output/$*.second.s > $@; then \
74 echo "--------- TEST-PASS: $*" > Output/$*.dbgopt.report.txt; \
76 echo "--------- TEST-FAIL: $*" > Output/$*.dbgopt.report.txt; \
79 Asms := $(sort $(addsuffix .s, $(notdir $(basename $(Source)))))
80 AllAsms := $(addprefix Output/,$(Asms))
82 Output/%.diff: $(AllAsms)