[llvm-commits] [test-suite] r93920 - /test-suite/trunk/TEST.llcdbg.Makefile

Dale Johannesen dalej at apple.com
Tue Jan 19 13:51:55 PST 2010


Author: johannes
Date: Tue Jan 19 15:51:55 2010
New Revision: 93920

URL: http://llvm.org/viewvc/llvm-project?rev=93920&view=rev
Log:
Add a test harness for testing debug declarations
do not affect codegen.


Added:
    test-suite/trunk/TEST.llcdbg.Makefile

Added: test-suite/trunk/TEST.llcdbg.Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.llcdbg.Makefile?rev=93920&view=auto

==============================================================================
--- test-suite/trunk/TEST.llcdbg.Makefile (added)
+++ test-suite/trunk/TEST.llcdbg.Makefile Tue Jan 19 15:51:55 2010
@@ -0,0 +1,48 @@
+##===- TEST.llcdbg.Makefile --------------------------------*- Makefile -*-===##
+#
+# This test checks whether presence of debug declarations influences
+# the code generator or not. 
+#
+# If input.bc includes llvm.dbg intrinsics and llvm.dbg variables then
+# the code in first.s and second.s should match. Otherwise debugging information
+# is influencing the code generator.  The Dwarf info in first.s and second.s is
+# normally quite different, so the data directives that appear in Dwarf are
+# stripped out before comparison.
+#
+# This has only been used on Darwin; the data directives to strip and grep magic
+# might be different elsewhere.
+#
+##===----------------------------------------------------------------------===##
+
+TESTNAME = $*
+TARGET_FLAGS = -g -O0
+LLC_DEBUG_FLAGS = -O0 -regalloc=local
+.PRECIOUS: Output/%.first.s Output/%.second.s Output/%.t2b.s Output/%.t1b.s
+
+$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+test.$(TEST).%: Output/%.diff
+
+Output/%.t1a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
+	$(LOPT) -strip-debug-declare -strip-nondebug $< -f -o $@
+
+Output/%.t1b.s: Output/%.t1a.bc Output/.dir $(LLC)
+	$(LLC) $(LLC_DEBUG_FLAGS) $< -f -o $@
+
+Output/%.first.s: Output/%.t1b.s Output/.dir $(LLC)
+	grep -v '.long' < $< | grep -v '.byte' | grep -v '.asciz' | grep -v '^$$' > $@
+
+Output/%.t2a.bc: Output/%.linked.rbc Output/.dir $(LOPT)
+	$(LOPT) -strip-nondebug $< -f -o $@
+
+Output/%.t2b.s: Output/%.t2a.bc Output/.dir $(LLC)
+	$(LLC) $(LLC_DEBUG_FLAGS) $< -f -o $@
+
+Output/%.second.s: Output/%.t2b.s Output/.dir
+	grep -v DEBUG_VALUE < $< | grep -v '.long' | grep -v '.byte' | grep -v '.asciz' | grep -v '^$$' > $@
+
+Output/%.diff: Output/%.first.s Output/%.second.s
+	@-if diff $^ > $@; then \
+	 echo "--------- TEST-PASS: $*"; \
+	else \
+	 echo "--------- TEST-FAIL: $*"; \
+	fi





More information about the llvm-commits mailing list