[llvm-commits] CVS: reopt/test/run-tests

Brian Gaeke gaeke at cs.uiuc.edu
Wed May 26 04:34:02 PDT 2004


Changes in directory reopt/test:

run-tests added (r1.1)

---
Log message:

This is the script that I use to test the trace optimizer.


---
Diffs of the changes:  (+92 -0)

Index: reopt/test/run-tests
diff -c /dev/null reopt/test/run-tests:1.1
*** /dev/null	Wed May 26 04:32:33 2004
--- reopt/test/run-tests	Wed May 26 04:32:22 2004
***************
*** 0 ****
--- 1,92 ----
+ #!/usr/bin/ksh
+ # reoptimizer test script
+ 
+ warn () {
+   echo ${1+"$@"} 1>&2
+ }
+ 
+ die () {
+   warn ${1+"$@"}
+   exit 1
+ }
+ 
+ # sanity check to make sure that the reoptimizer args are set
+ if [ -z "$LLVM_REOPT" ]; then
+     warn "Warning: \$LLVM_REOPT is not set."
+ fi
+ 
+ # parse arguments
+ outputonly=0
+ action=test
+ for arg in $@; do
+   case $arg in
+     -output) outputonly=1 ;;
+     -clean) action=clean ;;
+     -debug) action=debug ;;
+     -test) action=test ;;
+     *) benchmk=$arg ;;
+   esac
+ done
+ 
+ # sanity check arguments
+ if [ -z "$benchmk" ]; then
+     die "Error: You must specify a benchmark."
+ fi
+ if [ \( $outputonly -ne 0 \) -a \( "$action" != "clean" \) ]; then
+   die "Error: -output only meaningful w/ -clean"
+ fi
+ 
+ # choose from among the programs we know of (sets SUBDIR)
+ case $benchmk in
+   burg) SUBDIR=MultiSource/Applications/Burg ;;
+   siod) SUBDIR=MultiSource/Applications/siod ;;
+   ary3) SUBDIR=SingleSource/Reoptimizer/Ary3 ;;
+   sieve) SUBDIR=SingleSource/Reoptimizer/Sieve ;;
+   lists) SUBDIR=SingleSource/Reoptimizer/Lists ;;
+   shootout) SUBDIR=SingleSource/Benchmarks/Shootout ;;
+   mynestedloop) SUBDIR=SingleSource/Reoptimizer/MyNestedLoop ;;
+   *) die "Error: Unknown benchmark $arg" ;;
+ esac
+ echo "Starting ${action} on $benchmk"
+ 
+ # get full path to test/Programs subdirectory
+ objroot=`gmake prdirs | egrep 'LLVM.*Object Root' |cut -d: -f2-`
+ fullsubdirpath="${objroot}/test/Programs/${SUBDIR}"
+ 
+ do_debug () {
+   cd $fullsubdirpath
+   reoptllcbinary=`echo Output/*.reopt-llc`
+   case $reoptllcbinary in
+     *\**) die "Error: $benchmk reoptimizer binary is not built yet" ;;
+   esac
+   set -- $reoptllcbinary
+   reoptllcbinary=$1
+   grep STDIN_FILENAME Makefile
+   grep RUN_OPTIONS Makefile
+   prog_args=`grep RUN_OPTIONS Makefile | cut -d= -f2-`
+   gdbcmd="exec gdb --args $reoptllcbinary $prog_args"
+   echo "running '$gdbcmd' in $fullsubdirpath"
+   eval $gdbcmd
+ }
+ 
+ do_clean () {
+   echo "cleaning in $fullsubdirpath"
+   rm $fullsubdirpath/Output/*.out-reopt-llc
+   if [ $outputonly -eq 0 ]; then
+     find $fullsubdirpath -name "*reopt*" -print |xargs rm
+   fi
+ }
+ 
+ do_test () {
+   exec gmake SUBDIR=$SUBDIR
+ }
+ 
+ case $action in
+   debug) do_debug ;;
+   clean) do_clean ;;
+   test) do_test ;;
+   *) die "Unknown action $action" ;;
+ esac
+ 
+ # we're done
+ exit 0





More information about the llvm-commits mailing list