#!/bin/bash

##
## Usage: modular_multipricate.sh < modular_multiplicate.dat
##

PROG="./modular_multiplicate"

while read line ; do
    LINE=`echo $line | grep "^TEST"`
    if [ -n "${LINE}" ]; then
	set $LINE
	STMT="${PROG} ${3} ${5} ${7}"
	RET=`${STMT} | awk '{print $7}'`
	if [ $RET != ${9} ]; then
	    echo "ERROR:${2}"
	else
	    echo ${2} ${STMT}
	    RET=`${STMT}`
	    echo "$RET"
	fi
    fi
done

exit 0

