qsym

A symbolic executor for the QBE intermediate language

git clone https://git.8pit.net/qsym.git

 1#!/bin/sh
 2set -e
 3
 4cd "$(dirname "$0")"
 5. common.sh
 6
 7if ! command -v qbe 1>/dev/null; then
 8	echo "Error: Couldn't find qbe in \$PATH'" 1>&2
 9	exit 1
10fi
11
12for test in *; do
13	[ -d "${test}" ] || continue
14
15	# Ensure that qbe(1) considers the input to be syntactically valid.
16	qbe "${test}"/input.qbe 1>/dev/null 2>&1 || (
17		echo "File '${test}/input.qbe' is not valid QBE IL"
18		exit 1
19	)
20
21	qsym "${test}"/input.qbe "${ENTRY_FUNC}" \
22		1>"${test}"/expected 2>&1
23done