[llvm-commits] CVS: llvm-test/RunSafely.sh

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 6 10:07:19 PST 2004



Changes in directory llvm-test:

RunSafely.sh updated: 1.13 -> 1.14
---
Log message:

"optimize" runsafely.  Only call shift once instead of 4 times, only execute
'uname' to compute $GDB if we will need it.



---
Diffs of the changes:  (+15 -20)

Index: llvm-test/RunSafely.sh
diff -u llvm-test/RunSafely.sh:1.13 llvm-test/RunSafely.sh:1.14
--- llvm-test/RunSafely.sh:1.13	Sat Jun 26 12:01:12 2004
+++ llvm-test/RunSafely.sh	Sat Nov  6 12:07:06 2004
@@ -14,13 +14,10 @@
 # Syntax:  ./RunSafely.sh <ulimit> <stdinfile> <stdoutfile> <program> <args...>
 #
 ULIMIT=$1
-shift
-INFILE=$1
-shift
-OUTFILE=$1
-shift
-PROGRAM=$1
-shift
+INFILE=$2
+OUTFILE=$3
+PROGRAM=$4
+shift 4
 
 ulimit -t $ULIMIT
 rm -f core core.*
@@ -30,18 +27,6 @@
 ulimit -f 10485760
 
 #
-# If we are on a sun4u machine (UltraSparc), then the code we're generating
-# is 64 bit code.  In that case, use gdb-64 instead of gdb.
-#
-myarch=`uname -m`
-if [ "$myarch" = "sun4u" ]
-then
-	GDB="gdb-64"
-else
-	GDB=gdb
-fi
-
-#
 # Run the command, timing its execution.
 # The standard output and standard error of $PROGRAM should go in $OUTFILE,
 # and the standard error of time should go in $OUTFILE.time.
@@ -55,11 +40,21 @@
 
 if test $? -eq 0
 then
-  touch $OUTFILE.exitok
+    touch $OUTFILE.exitok
 fi
 
 if ls | egrep "^core" > /dev/null
 then
+    # If we are on a sun4u machine (UltraSparc), then the code we're generating
+    # is 64 bit code.  In that case, use gdb-64 instead of gdb.
+    myarch=`uname -m`
+    if [ "$myarch" = "sun4u" ]
+    then
+	GDB="gdb-64"
+    else
+	GDB=gdb
+    fi
+
     corefile=`ls core* | head -n 1`
     echo "where" > StackTrace.$$
     $GDB -q -batch --command=StackTrace.$$ --core=$corefile $PROGRAM < /dev/null






More information about the llvm-commits mailing list