#!/bin/sh

# Compile regtest.c with the specified register name and invoke
# the resulting executable.

if [ $# -ne 1 ]; then
    echo "Usage: `basename $0` register-name" 1>&2
    exit 1
fi

if ../../scripts/mgnuc "-DREG=\"$1\"" regtest.c -o /tmp/regtest$$ -lm &&
   [ -x /tmp/regtest$$ ] && /tmp/regtest$$
then
	true
else
	echo "Register $1 can't be used"
fi
rm -f /tmp/regtest$$
