[llvm-commits] [test-suite] r103352 - in /test-suite/trunk: Makefile.programs MultiSource/Benchmarks/Olden/treeadd/Makefile MultiSource/Benchmarks/Olden/treeadd/reference-output.normal MultiSource/Benchmarks/Olden/treeadd/reference-output.small

Chris Lattner sabre at nondot.org
Sat May 8 13:39:42 PDT 2010


Author: lattner
Date: Sat May  8 15:39:42 2010
New Revision: 103352

URL: http://llvm.org/viewvc/llvm-project?rev=103352&view=rev
Log:
add the ability for a makefile to specify a custom reference output,
useful when programs have multiple different run-modes.  Convert
treeadd to use this facility as an example.

Added:
    test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.normal
    test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.small
Modified:
    test-suite/trunk/Makefile.programs
    test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/Makefile

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=103352&r1=103351&r2=103352&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Sat May  8 15:39:42 2010
@@ -73,6 +73,12 @@
   RUNTIMELIMIT := 500
 endif
 
+# If the program specified a REFERENCE_OUTPUT_FILE, they obviously want to
+# USE_REFERENCE_OUTPUT.
+ifdef REFERENCE_OUTPUT_FILE
+USE_REFERENCE_OUTPUT := 1
+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
@@ -758,10 +764,17 @@
 	cp $< $@
 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
 $(PROGRAMS_TO_TEST:%=Output/%.out-nat): \
-Output/%.out-nat: $(PROJ_SRC_DIR)/%.reference_output Output/.dir
+Output/%.out-nat: $(REFERENCE_OUTPUT_FILE) Output/.dir
 	cp $< $@
 endif
 endif

Modified: test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/Makefile?rev=103352&r1=103351&r2=103352&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/Makefile (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/Makefile Sat May  8 15:39:42 2010
@@ -6,8 +6,10 @@
 
 ifdef SMALL_PROBLEM_SIZE
 RUN_OPTIONS = 20
+REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/reference-output.small
 else
 RUN_OPTIONS = 22
+REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/reference-output.normal
 endif
 
 include $(LEVEL)/MultiSource/Makefile.multisrc

Added: test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.normal
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.normal?rev=103352&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.normal (added)
+++ test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.normal Sat May  8 15:39:42 2010
@@ -0,0 +1,5 @@
+Treeadd with 22 levels on 4 processors 
+About to enter TreeAlloc
+About to enter TreeAdd
+Received result of 4194303
+exit 0

Added: test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.small
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.small?rev=103352&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.small (added)
+++ test-suite/trunk/MultiSource/Benchmarks/Olden/treeadd/reference-output.small Sat May  8 15:39:42 2010
@@ -0,0 +1,5 @@
+Treeadd with 20 levels on 4 processors 
+About to enter TreeAlloc
+About to enter TreeAdd
+Received result of 1048575
+exit 0





More information about the llvm-commits mailing list