[llvm-commits] [test-suite] r105210 - in /test-suite/trunk: External/SPEC/Makefile.spec Makefile.programs

Daniel Dunbar daniel at zuster.org
Mon May 31 01:13:05 PDT 2010


Author: ddunbar
Date: Mon May 31 03:13:05 2010
New Revision: 105210

URL: http://llvm.org/viewvc/llvm-project?rev=105210&view=rev
Log:
Add support for having distinct reference outputs for SMALL_PROBLEM_SIZE.

Also, add USE_REFERENCE_OUTPUT and HASH_PROGRAM_OUTPUT support for SPEC.

Also, add an UPDATE_REFERENCE_OUTPUTS make variable, which copies the out-nat
outputs to the reference_output files.

Modified:
    test-suite/trunk/External/SPEC/Makefile.spec
    test-suite/trunk/Makefile.programs

Modified: test-suite/trunk/External/SPEC/Makefile.spec
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/Makefile.spec?rev=105210&r1=105209&r2=105210&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/Makefile.spec (original)
+++ test-suite/trunk/External/SPEC/Makefile.spec Mon May 31 03:13:05 2010
@@ -25,6 +25,8 @@
 # the program in a sandbox (a special directory we create), then we cat all of
 # the outputs together.
 
+ifndef USE_REFERENCE_OUTPUT
+
 $(PROGRAMS_TO_TEST:%=Output/%.out-nat): \
 Output/%.out-nat: Output/%.native
 	$(SPEC_SANDBOX) nat-$(RUN_TYPE) $@ $(REF_IN_DIR) \
@@ -33,6 +35,36 @@
 	-(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/nat-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
+ifdef UPDATE_REFERENCE_OUTPUTS
+ifeq ($(REFERENCE_OUTPUT_KEY),)
+	cp $@ $(PROJ_SRC_DIR)/$*.reference_output
+else
+	if [ ! -f $(PROJ_SRC_DIR)/$*.reference_output ]; then \
+	  echo "error: no normal reference output!"; \
+	  exit 1; \
+	elif (! diff -q $@ $(PROJ_SRC_DIR)/$*.reference_output); then \
+	  cp $@ $(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY); \
+	else \
+	  echo "no need to update $(REFERENCE_OUTPUT_KEY) reference," \
+	       "matches normal reference!"; \
+	fi
+endif
+endif
+
+else
+
+# In this case, we opt out of generating the native output and just copy it from
+# a reference output. We accept either a generic reference output, or one
+# specific to the current test configuration (i.e., SMALL_PROBLEM_SIZE).
+Output/%.out-nat: $(KEYED_REFERENCE_OUTPUT_FILE) Output/.dir
+	cp $< $@
+
+Output/%.out-nat: $(REFERENCE_OUTPUT_FILE) Output/.dir
+	cp $< $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-simple): \
 Output/%.out-simple: Output/%.simple
@@ -42,6 +74,9 @@
 	-(cd Output/simple-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/simple-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-lli): \
 Output/%.out-lli: Output/%.llvm.bc $(LLI)
@@ -51,6 +86,9 @@
 	-(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/lli-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-jit): \
 Output/%.out-jit: Output/%.llvm.bc $(LLI)
@@ -60,6 +98,9 @@
 	-(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-jit-beta): \
 Output/%.out-jit-beta: Output/%.llvm.bc $(LLI)
@@ -69,6 +110,9 @@
 	-(cd Output/jit-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/jit-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \
 Output/%.out-llc: Output/%.llc
@@ -78,6 +122,9 @@
 	-(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-llc-beta): \
 Output/%.out-llc-beta: Output/%.llc-beta
@@ -87,6 +134,9 @@
 	-(cd Output/llc-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/llc-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-opt-beta): \
 Output/%.out-opt-beta: Output/%.opt-beta
@@ -96,6 +146,9 @@
 	-(cd Output/opt-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/opt-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \
 Output/%.out-cbe: Output/%.cbe
@@ -105,6 +158,9 @@
 	-(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
 	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
+ifdef PROGRAM_OUTPUT_FILTER
+	$(PROGRAM_OUTPUT_FILTER) $@
+endif
 
 # The RunSafely.sh script puts an "exit <retval>" line at the end of
 # the program's output. We have to make bugpoint do the same thing

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=105210&r1=105209&r2=105210&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Mon May 31 03:13:05 2010
@@ -79,6 +79,31 @@
 USE_REFERENCE_OUTPUT := 1
 endif
 
+# Figure out what kind of configuration specific reference output file to look
+# for.
+ifdef SMALL_PROBLEM_SIZE
+REFERENCE_OUTPUT_KEY := small
+else
+ifdef LARGE_PROBLEM_SIZE
+REFERENCE_OUTPUT_KEY := large
+else
+REFERENCE_OUTPUT_KEY :=
+endif
+endif
+
+# If the app wants to USE_REFERENCE_OUTPUT, but hasn't specified a file
+# containing the reference output, default to programname.reference_output.
+ifndef REFERENCE_OUTPUT_FILE
+REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output
+ifeq ($(REFERENCE_OUTPUT_KEY),)
+KEYED_REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output
+else
+KEYED_REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output.$(REFERENCE_OUTPUT_KEY)
+endif
+else
+KEYED_REFERENCE_OUTPUT_FILE = $(REFERENCE_OUTPUT_FILE)
+endif
+
 # RUNSAFELY - This program simply runs another program.  If the program works
 # correctly, this script has no effect, otherwise it will do things like print a
 # stack trace of a core dump.  It always returns "successful" so that tests will
@@ -514,12 +539,29 @@
 # Rules to build the test output...
 ifndef USE_PRECOMPILED_BYTECODE
 ifndef USE_REFERENCE_OUTPUT
+
 $(PROGRAMS_TO_TEST:%=Output/%.out-nat): \
 Output/%.out-nat: Output/%.native
 	$(RUNSAFELY) $(STDIN_FILENAME) $@ $< $(RUN_OPTIONS)
 ifdef PROGRAM_OUTPUT_FILTER
 	$(PROGRAM_OUTPUT_FILTER) $@
 endif
+ifdef UPDATE_REFERENCE_OUTPUTS
+ifeq ($(REFERENCE_OUTPUT_KEY),)
+	cp $@ $(PROJ_SRC_DIR)/$*.reference_output
+else
+	if [ ! -f $(PROJ_SRC_DIR)/$*.reference_output ]; then \
+	  echo "error: no normal reference output!"; \
+	  exit 1; \
+	elif (! diff -q $@ $(PROJ_SRC_DIR)/$*.reference_output); then \
+	  cp $@ $(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY); \
+	else \
+	  echo "no need to update $(REFERENCE_OUTPUT_KEY) reference," \
+	       "matches normal reference!"; \
+	fi
+endif
+endif
+
 endif
 endif
 
@@ -815,15 +857,12 @@
 else 
 ifdef USE_REFERENCE_OUTPUT
 
-# If the app wants to USE_REFERENCE_OUTPUT, but hasn't specified a file
-# containing the reference output, default to programname.reference_output.
-ifndef REFERENCE_OUTPUT_FILE
-REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output
-endif
+# In this case, we opt out of generating the native output and just copy it from
+# a reference output. We accept either a generic reference output, or one
+# specific to the current test configuration (i.e., SMALL_PROBLEM_SIZE).
+Output/%.out-nat: $(KEYED_REFERENCE_OUTPUT_FILE) Output/.dir
+	cp $< $@
 
-# In this case, we opt out of generating the native output and just
-# copy it from a reference output
-$(PROGRAMS_TO_TEST:%=Output/%.out-nat): \
 Output/%.out-nat: $(REFERENCE_OUTPUT_FILE) Output/.dir
 	cp $< $@
 endif





More information about the llvm-commits mailing list