#!/bin/bash
#
# run one test, check errors and verify assembly
#
# $1        = fast, full or test name
# $2        = test name
# $3        = noopt or opt or -386
# $4        = -ox or -oX
# $5        = target
# $6 .. $9  = jal command line arguments
#

if [ x$1 != xfast ]; then
   echo "   $3"
fi

rm -rf $2.asm
rm -rf $2.hex
rm -rf $2.dif
e=-1
jal -rc -slib -stest -sdoc $4 $5 $6 $7 $8 $9 > $2.out && e=1
if [ $e = -1 ]; then
   echo JAL ERROR in $2 $3 $5
   echo     JAL ERROR in $2 $3 $5 >>errors.out
   echo >stop.flg
fi

rm -rf error.flg
