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

Chris Lattner lattner at cs.uiuc.edu
Wed May 14 18:25:29 PDT 2003


Changes in directory llvm/test/Programs/External/SPEC:

Makefile.spec added (r1.1)
Sandbox.sh added (r1.1)

---
Log message:

Initial checkin


---
Diffs of the changes:

Index: llvm/test/Programs/External/SPEC/Makefile.spec
diff -c /dev/null llvm/test/Programs/External/SPEC/Makefile.spec:1.1
*** /dev/null	Wed May 14 18:21:21 2003
--- llvm/test/Programs/External/SPEC/Makefile.spec	Wed May 14 18:21:11 2003
***************
*** 0 ****
--- 1,85 ----
+ ##===- Makefile.spec ---------------------------------------*- Makefile -*-===##
+ #
+ # This makefile contains information for building SPEC as an external test.
+ #
+ ##===----------------------------------------------------------------------===##
+ 
+ # Configuration item: Where to find the spec CD-ROM
+ SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec
+ 
+ # RUN_TYPE - Either ref, test, or train.  May be specified on the command line.
+ RUN_TYPE  := test
+ 
+ ## Information the test should have provided...
+ ifndef STDOUT_FILENAME
+ STDOUT_FILENAME := standard.out
+ endif
+ ifndef LIBS
+ LIBS = -lm
+ endif
+ 
+ # Get the current directory, the name of the benchmark, and the current
+ # subdirectory of the SPEC directory we are in (ie, CINT2000/164.gzip)
+ #
+ CURRENT_DIR := $(shell cd .; pwd)
+ BENCH_NAME  := $(subst $(shell cd ..   ; pwd),,$(CURRENT_DIR))
+ SPEC_SUBDIR := $(subst $(shell cd ../..; pwd),,$(CURRENT_DIR))
+ 
+ # Remove any leading /'s from the paths
+ BENCH_NAME  := $(patsubst /%,%,$(BENCH_NAME))
+ SPEC_SUBDIR := $(patsubst /%,%,$(SPEC_SUBDIR))
+ 
+ SPEC_BENCH_DIR := $(SPEC_ROOT)/$(SPEC_SUBDIR)
+ 
+ PROG := $(BENCH_NAME)
+ Source := $(wildcard $(SPEC_BENCH_DIR)/src/*.c)
+ 
+ SourceDir := $(SPEC_BENCH_DIR)/src/
+ LCCFLAGS := -DSYS_IS_USG -O2
+ CFLAGS := -DSYS_IS_USG -DSPEC_CPU2000 -O2
+ 
+ # Disable the default Output/%.out-* targets...
+ PROGRAMS_HAVE_CUSTOM_RUN_RULES := 1
+ 
+ include $(LEVEL)/test/Programs/MultiSource/Makefile.multisrc
+ 
+ SPEC_SANDBOX := $(LEVEL)/test/Programs/External/SPEC/Sandbox.sh
+ 
+ # Information about testing the program...
+ REF_IN_DIR  := $(SPEC_BENCH_DIR)/data/$(RUN_TYPE)/input/
+ REF_OUT_DIR := $(SPEC_BENCH_DIR)/data/$(RUN_TYPE)/output/
+ LOCAL_OUTPUTS := $(notdir $(wildcard $(REF_OUT_DIR)/*))
+ 
+ # 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
+ # the outputs together.
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.out-nat): \
+ Output/%.out-nat: Output/%.native
+ 	$(SPEC_SANDBOX) nat-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              ../../$(RUNSAFELY) $(STDOUT_FILENAME) ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.out-lli): \
+ Output/%.out-lli: Output/%.llvm.bc $(LLI)
+ 	$(SPEC_SANDBOX) lli-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              ../../$(RUNSAFELY) $(STDOUT_FILENAME) $(LLI) $(LLI_OPTS) ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.out-jit): \
+ Output/%.out-jit: Output/%.llvm.bc $(LLI)
+ 	$(SPEC_SANDBOX) jit-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              ../../$(RUNSAFELY) $(STDOUT_FILENAME) $(LLI) $(JIT_OPTS) ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \
+ Output/%.out-llc: Output/%.llc
+ 	$(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              ../../$(RUNSAFELY) $(STDOUT_FILENAME) ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@
+ 
+ $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \
+ Output/%.out-cbe: Output/%.cbe
+ 	$(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \
+              ../../$(RUNSAFELY) $(STDOUT_FILENAME) ../../$< $(RUN_OPTIONS)
+ 	-(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@


Index: llvm/test/Programs/External/SPEC/Sandbox.sh
diff -c /dev/null llvm/test/Programs/External/SPEC/Sandbox.sh:1.1
*** /dev/null	Wed May 14 18:21:22 2003
--- llvm/test/Programs/External/SPEC/Sandbox.sh	Wed May 14 18:21:11 2003
***************
*** 0 ****
--- 1,29 ----
+ #!/bin/sh
+ #
+ # Program:  Sandbox.sh
+ #
+ # Synopsis: This script is used to provide a sandbox for SPEC programs to
+ #           execute in.  It provides an isolated environment, the input files
+ #           necessary, and then finally runs the program.
+ #
+ # Syntax:  ./Sandbox.sh <uid> <output_file> <ref input>   <program> <arguments>
+ #
+ 
+ TEST_UID=$1
+ OUTPUT_FILE=$2
+ INPUT_DIR=$3
+ shift;shift;shift
+ 
+ mkdir Output/$TEST_UID 2> /dev/null
+ cd Output/$TEST_UID
+ rm -f *
+ 
+ # Copy all of the test input files into the current directory...
+ cp $INPUT_DIR/* .
+ 
+ # Run the program now...
+ echo Running: $*
+ $*
+ 
+ # This script is always successful...
+ exit 0
\ No newline at end of file





More information about the llvm-commits mailing list