[llvm-commits] [test-suite] r121080 - in /test-suite/trunk: Makefile.rules SingleSource/Makefile.singlesrc TEST.dbg.Makefile

Devang Patel dpatel at apple.com
Mon Dec 6 16:35:56 PST 2010


Author: dpatel
Date: Mon Dec  6 18:35:56 2010
New Revision: 121080

URL: http://llvm.org/viewvc/llvm-project?rev=121080&view=rev
Log:
Add test harness to measure quality of debug info in optimized code.
MultiSource support is not yet ready.

Added:
    test-suite/trunk/TEST.dbg.Makefile
Modified:
    test-suite/trunk/Makefile.rules
    test-suite/trunk/SingleSource/Makefile.singlesrc

Modified: test-suite/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=121080&r1=121079&r2=121080&view=diff
==============================================================================
--- test-suite/trunk/Makefile.rules (original)
+++ test-suite/trunk/Makefile.rules Mon Dec  6 18:35:56 2010
@@ -123,7 +123,7 @@
 # which are marked as Phony.
 #
 .PHONY: all dynamic bytecodelib install-bytecode-library
-.PHONY: clean distclean install test bytecode native prdirs
+.PHONY: clean distclean install test bytecode native prdirs dbg
 
 ###########################################################################
 # Miscellaneous paths and commands:

Modified: test-suite/trunk/SingleSource/Makefile.singlesrc
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Makefile.singlesrc?rev=121080&r1=121079&r2=121080&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Makefile.singlesrc (original)
+++ test-suite/trunk/SingleSource/Makefile.singlesrc Mon Dec  6 18:35:56 2010
@@ -85,6 +85,30 @@
 Output/%.native: $(SourceDir)/%.mm Output/.dir
 	-$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
 
+Output/%.dbg: $(SourceDir)/%.c Output/.dir
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg: $(SourceDir)/%.cpp Output/.dir
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg: $(SourceDir)/%.m Output/.dir
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg: $(SourceDir)/%.mm Output/.dir
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg.opt: $(SourceDir)/%.c Output/.dir
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg.opt: $(SourceDir)/%.cpp Output/.dir
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg.opt: $(SourceDir)/%.m Output/.dir
+	-$(LCC) -g $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
+Output/%.dbg.opt: $(SourceDir)/%.mm Output/.dir
+	-$(LCXX) -g $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS)
+
 bugpoint-gccas bugpoint-opt bugpoint-llvm-ld bugpoint-gccld bugpoint-jit bugpoint-llc bugpoint-llc-beta:
 	@echo "The $@ target doesn't work in SingleSource.  Try:"
 	@echo "  'make Output/[programname].$@' instead."

Added: test-suite/trunk/TEST.dbg.Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.dbg.Makefile?rev=121080&view=auto
==============================================================================
--- test-suite/trunk/TEST.dbg.Makefile (added)
+++ test-suite/trunk/TEST.dbg.Makefile Mon Dec  6 18:35:56 2010
@@ -0,0 +1,34 @@
+##===- TEST.dbg.Makefile ----------------------------------*- Makefile -*--===##
+#
+# This test is used to measure quality of debugging information.
+#
+##===----------------------------------------------------------------------===##
+
+#----------------------------------------------------------------------
+# Be sure to add the python path that points to the LLDB shared library.
+# On MacOSX csh, tcsh:
+#   setenv PYTHONPATH /Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Python
+# On MacOSX sh, bash:
+#   export PYTHONPATH=/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Python
+#----------------------------------------------------------------------
+
+CURDIR  := $(shell cd .; pwd)
+PROGDIR := $(PROJ_SRC_ROOT)
+RELDIR  := $(subst $(PROGDIR),,$(CURDIR))
+
+REPORTS_TO_GEN := dbg
+REPORTS_SUFFIX := $(addsuffix .report.txt, $(REPORTS_TO_GEN))
+
+Output/%.bp: %.c Output/.dir
+	$(LCC) $(CPPFLAGS) $(CFLAGS) -g -c -emit-llvm $< -o $@.bc
+	$(LOPT) -print-breakpoints-for-testing $@.bc -o $@
+
+$(PROGRAMS_TO_TEST:%=test.$(TEST).%): \
+test.$(TEST).%: Output/%.bp Output/%.dbg Output/%.dbg.opt
+	echo $@
+	echo $*
+	mv *.dSYM Output/.
+	$(LLVM_SRC_ROOT)/utils/CollectDebugInfoUsingLLDB.py Output/$*.dbg Output/$*.bp Output/$*.dbg.out
+	$(LLVM_SRC_ROOT)/utils/CollectDebugInfoUsingLLDB.py Output/$*.dbg.opt Output/$*.bp Output/$*.dbg.opt.out
+	$(LLVM_SRC_ROOT)/utils/CompareDebugInfo.py Output/$*.dbg.out Output/$*.dbg.opt.out $* 
+





More information about the llvm-commits mailing list