#!/bin/bash
#
# run the indicated test with and without optimizations
#
# $1       = fast, full, or name of one test
# $2       = test name
# $3       = target
# $4 .. $7 = jal command line arguments
#

# must we do this tes?
if [ x$1 != xfast ]; then 
   if [ x$1 != xfull ]; then 
      if [ x$1 != x$2 ]; then 
         exit
      fi
   fi
fi

# quit immediately?
if [ x$1 = xfast ]; then
   if [ -f stop.flg ]; then
      exit
   fi
fi

# echo the test case
echo $2 $3
# without optimizations (not when fast)
rm -rf error.flg
if [ $1 != fast ]; then 
   test4 $1 $2 noopt -oX $3 $4 $5 $6 $7
fi

# -386 (not when fast)
if [ ! -f error.flg ]; then
   if [ $1 != fast ]; then
      test4 $1 $2 -386 -oX $3 $4 $5 $6 $7
   fi
fi

# with optimization (always)
if [ ! -f error.flg ]; then
   test4 $1 $2 opt -ox $3 $4 $5 $6 $7
fi

