1 Star 0 Fork 14

OlshevskyVladimir/llvm-test-suite

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TEST.dbgopt.Makefile 4.75 KB
一键复制 编辑 原始数据 按行查看 历史
Devang Patel 提交于 2011-10-18 17:03 . Add report description for dbgopt.
##===- TEST.dbgopt.Makefile --------------------------------*- Makefile -*-===##
#
# This test checks whether presense of debugging information influences
# the optimizer or not.
#
# $ clang -fno-verbose-asm -g -mllvm --disable-debug-info-print -Os \
# -S foo.c -o foo.first.s
# $ clang -fno-verbose-asm -Os -S foo.c -o foo.second.s
# $ diff foo.first.s foo.second.s
#
##===----------------------------------------------------------------------===##
TESTNAME = $*
.PRECIOUS: Output/%.first.s Output/%.second.s
$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
test.$(TEST).%: Output/%.diff
Output/%.s: %.c Output/.dir $(INCLUDES)
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
-fno-verbose-asm -mllvm --disable-debug-info-print \
-S ${PROJ_SRC_DIR}/$*.c -o Output/$*.first.s
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os \
-fno-verbose-asm -S ${PROJ_SRC_DIR}/$*.c -o Output/$*.second.s
echo "---------------------------------------------------------------" \
> Output/$*.dbgopt.report.txt; \
echo ">>> ========= '$*' Program" >> Output/$*.dbgopt.report.txt; \
echo "---------------------------------------------------------------\n"\
>> Output/$*.dbgopt.report.txt;
@-if diff Output/$*.first.s Output/$*.second.s > $@; then \
echo "TEST: PASS" >> Output/$*.dbgopt.report.txt; \
else \
echo "TEST: FAIL" >> Output/$*.dbgopt.report.txt; \
fi
Output/%.s: %.cpp Output/.dir $(INCLUDES)
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
-fno-verbose-asm -mllvm --disable-debug-info-print \
-S ${PROJ_SRC_DIR}/$*.cpp -o Output/$*.first.s
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
-fno-verbose-asm ${PROJ_SRC_DIR}/$*.cpp -o Output/$*.second.s
echo "---------------------------------------------------------------" \
> Output/$*.dbgopt.report.txt; \
echo ">>> ========= '$*' Program" >> Output/$*.dbgopt.report.txt; \
echo "---------------------------------------------------------------\n"\
>> Output/$*.dbgopt.report.txt;
@-if diff Output/$*.first.s Output/$*.second.s > $@; then \
echo "TEST: PASS" >> Output/$*.dbgopt.report.txt; \
else \
echo "TEST: FAIL" >> Output/$*.dbgopt.report.txt; \
fi
Output/%.s: %.cc Output/.dir $(INCLUDES)
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
-fno-verbose-asm -mllvm -disable-debug-info-print \
-S ${PROJ_SRC_DIR}/$*.cc -o Output/$*.first.s
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
-fno-verbose-asm ${PROJ_SRC_DIR}/$*.cc -o Output/$*.second.s
echo "---------------------------------------------------------------" \
> Output/$*.dbgopt.report.txt; \
echo ">>> ========= '$*' Program" >> Output/$*.dbgopt.report.txt; \
echo "---------------------------------------------------------------\n"\
>> Output/$*.dbgopt.report.txt;
@-if diff Output/$*.first.s Output/$*.second.s > $@; then \
echo "TEST: PASS" >> Output/$*.dbgopt.report.txt; \
else \
echo "TEST: FAIL" >> Output/$*.dbgopt.report.txt; \
fi
Output/%.s: %.m Output/.dir $(INCLUDES)
-$(LLVMCC) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
-fno-verbose-asm -mllvm --disable-debug-info-print \
-S ${PROJ_SRC_DIR}/$*.m -o Output/$*.first.s
-$(LLVMCC) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
-fno-verbose-asm ${PROJ_SRC_DIR}/$*.m -o Output/$*.second.s
echo "---------------------------------------------------------------" \
> Output/$*.dbgopt.report.txt; \
echo ">>> ========= '$*' Program" >> Output/$*.dbgopt.report.txt; \
echo "---------------------------------------------------------------\n"\
>> Output/$*.dbgopt.report.txt;
@-if diff Output/$*.first.s Output/$*.second.s > $@; then \
echo "TEST: PASS" >> Output/$*.dbgopt.report.txt; \
else \
echo "TEST: FAIL" >> Output/$*.dbgopt.report.txt; \
fi
Output/%.s: %.mm Output/.dir $(INCLUDES)
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -g -Os \
-fno-verbose-asm -mllvm --disable-debug-info-print \
-S ${PROJ_SRC_DIR}/$*.mm -o Output/$*.first.s
-$(LLVMCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(X_TARGET_FLAGS) -Os -S \
-fno-verbose-asm ${PROJ_SRC_DIR}/$*.mm -o Output/$*.second.s
echo "---------------------------------------------------------------" \
> Output/$*.dbgopt.report.txt; \
echo ">>> ========= '$*' Program" >> Output/$*.dbgopt.report.txt; \
echo "---------------------------------------------------------------\n"\
>> Output/$*.dbgopt.report.txt;
@-if diff Output/$*.first.s Output/$*.second.s > $@; then \
echo "TEST: PASS" >> Output/$*.dbgopt.report.txt; \
else \
echo "TEST: FAIL" >> Output/$*.dbgopt.report.txt; \
fi
Asms := $(sort $(addsuffix .s, $(notdir $(basename $(Source)))))
AllAsms := $(addprefix Output/,$(Asms))
Output/%.diff: $(AllAsms)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/OlshevskyVladimir/llvm-test-suite.git
git@gitee.com:OlshevskyVladimir/llvm-test-suite.git
OlshevskyVladimir
llvm-test-suite
llvm-test-suite
main

搜索帮助