From 890e85c8d1badedf4922260d369ba629fd4327ff Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 21 Mar 2016 13:42:16 -0400 Subject: add abitest.sh tool --- lisc/tools/abitest.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 lisc/tools/abitest.sh (limited to 'lisc/tools/abitest.sh') diff --git a/lisc/tools/abitest.sh b/lisc/tools/abitest.sh new file mode 100755 index 0000000..164aff2 --- /dev/null +++ b/lisc/tools/abitest.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +OCAML=/usr/bin/ocaml +QBE=lisc +TMP=`mktemp -d abifuzz.XXXXXX` + +failure() { + echo "Failure at stage:" $1 >&2 + exit 1 +} + +if ! test -x $QBE +then + echo "error: I must run in the directory containing $QBE." >&2 + exit 1 +fi + + $OCAML tools/abi.ml $TMP c ssa + ./$QBE -o $TMP/callee.s $TMP/callee.ssa || failure "qbe" + c99 -o $TMP/abitest $TMP/caller.c $TMP/callee.s || failure "cc + linking" + $TMP/abitest || failure "runtime" + +rm -fr $TMP -- cgit 1.4.1