aboutsummaryrefslogtreecommitdiff
path: root/final/TEST.llcdbg.Makefile
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2019-04-11 23:41:27 +0000
committerTom Stellard <tstellar@redhat.com>2019-04-11 23:41:27 +0000
commit4cca198ab96ea1bb96378ef20edd5681293e1479 (patch)
tree5ddbccd0b02cd866764b384c76034f6815434665 /final/TEST.llcdbg.Makefile
parenteb6b57c6b14ab8608a36d8a39389039481cda5cb (diff)
Creating release candidate final from release_710 branchsvn-tags/RELEASE_710
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/tags/RELEASE_710@358242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'final/TEST.llcdbg.Makefile')
-rw-r--r--final/TEST.llcdbg.Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/final/TEST.llcdbg.Makefile b/final/TEST.llcdbg.Makefile
new file mode 100644
index 00000000..dae54883
--- /dev/null
+++ b/final/TEST.llcdbg.Makefile
@@ -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 = $*
+TEST_TARGET_FLAGS = -g -O0
+LLC_DEBUG_FLAGS = -O0 -regalloc=local $(LLCFLAGS)
+.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) $< -o $@
+
+Output/%.first.s: Output/%.t1b.s Output/.dir $(LLC)
+ 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 '^$$' > $@
+
+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) $< -o $@
+
+Output/%.second.s: Output/%.t2b.s Output/.dir
+ 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 '^$$' > $@
+
+Output/%.diff: Output/%.first.s Output/%.second.s
+ @-if diff $^ > $@; then \
+ echo "--------- TEST-PASS: $*"; \
+ else \
+ echo "--------- TEST-FAIL: $*"; \
+ fi