blob: a5222b25a94a6bd5e9550668c806060d6d981730 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
OCAML=/usr/bin/ocaml
QBE=lisc
TMP=`mktemp -d abifuzz.XXXXXX`
failure() {
echo "Failure at stage:" $1 >&2
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
then
echo "error: I must run in the directory containing $QBE." >&2
exit 1
fi
once "$1"
rm -fr $TMP
|