qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 890e85c8d1badedf4922260d369ba629fd4327ff
parent e004f1dd48527bf6e46a5c3a72ee4d1ff8c1d18e
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Mon, 21 Mar 2016 13:42:16 -0400

add abitest.sh tool

Diffstat:
Alisc/tools/abitest.sh | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/lisc/tools/abitest.sh 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