[llvm-commits] [test-suite] r166904 - in /test-suite/trunk: Makefile.programs RunToolSafely.sh

Daniel Dunbar daniel at zuster.org
Sun Oct 28 17:17:12 PDT 2012


Author: ddunbar
Date: Sun Oct 28 19:17:12 2012
New Revision: 166904

URL: http://llvm.org/viewvc/llvm-project?rev=166904&view=rev
Log:
test-suite: Replace RunToolSafely with just another use of RunSafely (local).

 - We don't need multiple ways to run sandboxed tools.

Removed:
    test-suite/trunk/RunToolSafely.sh
Modified:
    test-suite/trunk/Makefile.programs

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=166904&r1=166903&r2=166904&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Sun Oct 28 19:17:12 2012
@@ -61,10 +61,6 @@
 endif
 
 # DIFFPROG - The program used to diff the output
-#
-# We run this under RunToolSafely because 'fpcmp' at one point would infinite
-# loop on some inputs, which blocks testing some historical revisions. We can
-# remove this once we build our own test tools.
 DIFFPROG := $(PROGDIR)/DiffOutput.sh "$(FPCMP) $(TOLERANCEOPT)"
 
 # RUNTIMELIMIT - The number of seconds we should wait before certain events
@@ -142,8 +138,6 @@
 RUNSAFELY := $(RUNSAFELY) -u 'env $(EXECUTION_ENVIRONMENT_OVERRIDES)' $(RUNSAFELY)
 endif
 
-RUNTOOLSAFELY := $(PROGDIR)/RunToolSafely.sh $(RUNTIMELIMIT)
-
 ifndef STDIN_FILENAME
 STDIN_FILENAME := /dev/null
 endif
@@ -271,16 +265,19 @@
 $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \
 Output/%.linked.bc: Output/%.linked.rbc $(LOPT)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LOPT) -std-compile-opts -info-output-file=$(CURDIR)/$@.info $(STATS) $(EXTRA_LOPT_OPTIONS) $< -o $@
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) -std-compile-opts -info-output-file=$(CURDIR)/$@.info $(STATS) $(EXTRA_LOPT_OPTIONS) $< -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm.stripped.bc): \
 Output/%.llvm.stripped.bc: Output/%.llvm.bc $(LOPT)
-	$(RUNTOOLSAFELY) $(LOPT) -mstrip $< -o $@
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) -mstrip $< -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.linked.optbeta.bc): \
 Output/%.linked.optbeta.bc: Output/%.linked.rbc $(LOPT)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LOPT) $(OPTBETAOPTIONS) -info-output-file=$(CURDIR)/$@.info $(STATS)  $< -o $@
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) $(OPTBETAOPTIONS) -info-output-file=$(CURDIR)/$@.info $(STATS)  $< -o $@
 
 
 ifndef DISABLE_FOR_LLVM_PROGRAMS
@@ -290,19 +287,22 @@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm.bc): \
 Output/%.llvm.bc: Output/%.linked.bc $(LOPT)
-	$(RUNTOOLSAFELY) $(LOPT) -std-link-opts $(OPTPASSES) \
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) -std-link-opts $(OPTPASSES) \
 		-info-output-file=$(CURDIR)/$@.info \
 			$(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm.optbeta.bc): \
 Output/%.llvm.optbeta.bc: Output/%.linked.optbeta.bc $(LOPT)
-	$(RUNTOOLSAFELY) $(LOPT) -std-link-opts \
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) -std-link-opts \
 		-info-output-file=$(CURDIR)/$@.info \
 			$(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm.bc): \
 Output/%.noopt-llvm.bc: Output/%.linked.rbc $(LOPT)
-	$(RUNTOOLSAFELY) $(LOPT) \
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) \
 		-info-output-file=$(CURDIR)/$@.info \
 			$(STATS) $< -o $@
 
@@ -356,11 +356,13 @@
 $(PROGRAMS_TO_TEST:%=Output/%.cbe.c): \
 Output/%.cbe.c: Output/%.llvm.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) -march=c $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) -march=c $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.cbe): \
 Output/%.cbe: Output/%.cbe.c
-	-$(RUNTOOLSAFELY) $(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) $(OPTFLAGS) -fno-strict-aliasing -fno-inline $(X_TARGET_FLAGS) $(LIBS)
+	$(RUNSAFELYLOCAL) /dev/null $@.cc \
+	  $(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) $(OPTFLAGS) -fno-strict-aliasing -fno-inline $(X_TARGET_FLAGS) $(LIBS)
 
 #
 # Compile a linked program to machine code with LLC.
@@ -368,17 +370,20 @@
 $(PROGRAMS_TO_TEST:%=Output/%.llc.s): \
 Output/%.llc.s: Output/%.llvm.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) $(LLCOPTION) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) $(LLCOPTION) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.llc-beta.s): \
 Output/%.llc-beta.s: Output/%.llvm.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) $(LLCBETAOPTION) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) $(LLCBETAOPTION) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.opt-beta.s): \
 Output/%.opt-beta.s: Output/%.llvm.optbeta.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 # On darwin, pass -force_cpusubtype_ALL to allow all ppc instructions.
 ifeq ($(ARCH),PowerPC)
@@ -393,17 +398,20 @@
 $(PROGRAMS_TO_TEST:%=Output/%.llc.o): \
 Output/%.llc.o: Output/%.llvm.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) -filetype=obj $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) -filetype=obj $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.llc-beta.o): \
 Output/%.llc-beta.o: Output/%.llvm.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) $(LLCBETAOPTION) -filetype=obj $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) $(LLCBETAOPTION) -filetype=obj $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 $(PROGRAMS_TO_TEST:%=Output/%.opt-beta.o): \
 Output/%.opt-beta.o: Output/%.llvm.optbeta.bc $(LLC)
 	$(VERB) $(RM) -f $(CURDIR)/$@.info
-	$(RUNTOOLSAFELY) $(LLC) $(LLCFLAGS) -filetype=obj  $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
+	$(RUNSAFELYLOCAL) /dev/null $@.llc \
+	  $(LLC) $(LLCFLAGS) -filetype=obj  $< -o $@ -info-output-file=$(CURDIR)/$@.info $(STATS)
 
 
 ifdef TEST_INTEGRATED_ASSEMBLER
@@ -683,11 +691,13 @@
 #
 $(PROGRAMS_TO_TEST:%=Output/%.llvm-prof.bc): \
 Output/%.llvm-prof.bc: Output/%.llvm.bc
-	$(RUNTOOLSAFELY) $(LOPT) -insert-edge-profiling $< -o $@
+	$(RUNSAFELYLOCAL) /dev/null $@.opt \
+	  $(LOPT) -insert-edge-profiling $< -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.printprof): \
 Output/%.printprof: Output/%.llvm.bc Output/%.prof $(LPROF)
-	$(RUNTOOLSAFELY) $(LPROF) $< Output/$*.prof
+	$(RUNSAFELYLOCAL) /dev/null $@.prof \
+	  $(LPROF) $< Output/$*.prof
 
 
 #

Removed: test-suite/trunk/RunToolSafely.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunToolSafely.sh?rev=166903&view=auto
==============================================================================
--- test-suite/trunk/RunToolSafely.sh (original)
+++ test-suite/trunk/RunToolSafely.sh (removed)
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-if [ $# -lt 2 ]; then
-  echo "usage: $0 <timeout> <program> <args...>"
-  echo
-  echo "  This script simply runs another program under ulimit and always"
-  echo "  returns true. It is used for invoking tools from the LLVM test suite"
-  echo "  Makefiles, where we need them to always return true so that we don't"
-  echo "  abort the test run."
-  exit 1
-fi
-
-# Save a copy of the original arguments in a string before we
-# clobber them with the shift command.
-TIMEOUT=$1
-shift
-PROGRAM=$1
-shift
-
-SYSTEM=`uname -s`
-
-ULIMITCMD=""
-case $SYSTEM in
-  CYGWIN*) 
-    ;;
-  Darwin*)
-    # Disable core file emission, the script doesn't find it anyway because it
-    # is put into /cores.
-    ULIMITCMD="$ULIMITCMD ulimit -c 0;"
-    ULIMITCMD="$ULIMITCMD ulimit -t $TIMEOUT;"
-    # To prevent infinite loops which fill up the disk, specify a limit on size
-    # of files being output by the tests. 10 MB should be enough for anybody. ;)
-    ULIMITCMD="$ULIMITCMD ulimit -f 10485760;"
-    ;;
-  *)
-    ULIMITCMD="$ULIMITCMD ulimit -t $TIMEOUT;"
-    ULIMITCMD="$ULIMITCMD ulimit -c unlimited;"
-    # To prevent infinite loops which fill up the disk, specify a limit on size
-    # of files being output by the tests. 10 MB should be enough for anybody. ;)
-    ULIMITCMD="$ULIMITCMD ulimit -f 10485760;"
-
-    # virtual memory: 600 MB should be enough for anybody. ;)
-    ULIMITCMD="$ULIMITCMD ulimit -v 600000;"
-esac
-
-if ( ! sh -c "$ULIMITCMD sh -c '$PROGRAM $*'" ); then
-    echo "warning: command failed: '$PROGRAM $*'"
-fi
-
-# Always return "successful" so that tests will continue to be run.
-exit 0





More information about the llvm-commits mailing list