[llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec

Reid Spencer reid at x10sys.com
Mon Dec 4 14:08:01 PST 2006



Changes in directory llvm-test/External/SPEC:

Makefile.spec updated: 1.59 -> 1.60
---
Log message:

Implement a new feature: output file filtering. A makefile can override
the default filter (cat) to contort the test's output. This is necessary
for things like 183.equake that put out the program name in its output
messages.


---
Diffs of the changes:  (+21 -8)

 Makefile.spec |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)


Index: llvm-test/External/SPEC/Makefile.spec
diff -u llvm-test/External/SPEC/Makefile.spec:1.59 llvm-test/External/SPEC/Makefile.spec:1.60
--- llvm-test/External/SPEC/Makefile.spec:1.59	Sat Dec  2 07:40:36 2006
+++ llvm-test/External/SPEC/Makefile.spec	Mon Dec  4 16:07:46 2006
@@ -19,6 +19,11 @@
 REF_OUT_DIR := $(SPEC_BENCH_DIR)/data/$(RUN_TYPE)/output/
 LOCAL_OUTPUTS := $(notdir $(wildcard $(REF_OUT_DIR)/*))
 
+# Sometimes a test will output its program name or some other gunk that
+# we don't want to diff against. Tests can override this definition to
+# provide a filter for the output files.
+SPEC_OUTPUT_FILE_FILTER = cat
+
 
 # Specify how to generate output from the SPEC programs.  Basically we just run
 # the program in a sandbox (a special directory we create), then we cat all of
@@ -29,7 +34,8 @@
 	-$(SPEC_SANDBOX) nat-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   ../$*.native $(RUN_OPTIONS)
-	-(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/nat-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-lli): \
@@ -37,7 +43,8 @@
 	-$(SPEC_SANDBOX) lli-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   $(LLI) $(LLI_OPTS) ../$*.llvm.bc $(RUN_OPTIONS)
-	-(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/lli-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-jit): \
@@ -45,7 +52,8 @@
 	-$(SPEC_SANDBOX) jit-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   $(LLI) $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS)
-	-(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-jit-beta): \
@@ -53,7 +61,8 @@
 	-$(SPEC_SANDBOX) jit-beta-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   $(LLI) $(LLCBETAOPTION) $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS)
-	-(cd Output/jit-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/jit-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/jit-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \
@@ -61,7 +70,8 @@
 	-$(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   ../$*.llc $(RUN_OPTIONS)
-	-(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-llc-beta): \
@@ -69,7 +79,8 @@
 	-$(SPEC_SANDBOX) llc-beta-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   ../$*.llc-beta $(RUN_OPTIONS)
-	-(cd Output/llc-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/llc-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/llc-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \
@@ -77,7 +88,8 @@
 	-$(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
              $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \
                   ../$*.cbe $(RUN_OPTIONS)
-	-(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+	-(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > $@
 	-cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 
 # The RunSafely.sh script puts an "exit <retval>" line at the end of
@@ -159,7 +171,8 @@
 	$(SPEC_SANDBOX) profile-$(RUN_TYPE) Output/$*.out-prof $(REF_IN_DIR) \
 	  $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) $(LLI) $(JIT_OPTS)\
             -fake-argv0 '../$*.llvm.bc' -load $(LIBPROFILESO) ../../$< -llvmprof-output ../../$@ $(RUN_OPTIONS)
-	-(cd Output/profile-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > Output/$*.out-prof
+	-(cd Output/profile-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \
+	  $(SPEC_OUTPUT_FILE_FILTER) > Output/$*.out-prof
 	-cp Output/profile-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time
 	-cp Output/profile-$(RUN_TYPE)/llvmprof.out $@
 	@cmp -s Output/$*.out-prof Output/$*.out-nat || \






More information about the llvm-commits mailing list