add the ability to run with a seed
This commit is contained in:
parent
453baf68e0
commit
6b58aaa7ea
1 changed files with 20 additions and 12 deletions
|
@ -9,21 +9,29 @@ failure() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
once() {
|
||||||
|
if test -z "$1"
|
||||||
|
then
|
||||||
|
$OCAML tools/abi.ml $TMP c ssa
|
||||||
|
else
|
||||||
|
$OCAML tools/abi.ml -s $1 $TMP c ssa
|
||||||
|
fi
|
||||||
|
|
||||||
|
./$QBE -o $TMP/callee.s $TMP/callee.ssa ||
|
||||||
|
failure "qbe"
|
||||||
|
|
||||||
|
c99 -g -o $TMP/abitest $TMP/caller.c $TMP/callee.s ||
|
||||||
|
failure "cc + linking"
|
||||||
|
|
||||||
|
$TMP/abitest ||
|
||||||
|
failure "runtime"
|
||||||
|
}
|
||||||
|
|
||||||
if ! test -x $QBE
|
if ! test -x $QBE
|
||||||
then
|
then
|
||||||
echo "error: I must run in the directory containing $QBE." >&2
|
echo "error: I must run in the directory containing $QBE." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$OCAML tools/abi.ml $TMP c ssa
|
once "$1"
|
||||||
|
#rm -fr $TMP
|
||||||
./$QBE -o $TMP/callee.s $TMP/callee.ssa
|
|
||||||
|| failure "qbe"
|
|
||||||
|
|
||||||
c99 -g -o $TMP/abitest $TMP/caller.c $TMP/callee.s
|
|
||||||
|| failure "cc + linking"
|
|
||||||
|
|
||||||
$TMP/abitest
|
|
||||||
|| failure "runtime"
|
|
||||||
|
|
||||||
rm -fr $TMP
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue