2023-09-29 15:17:45 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Requires at least one argument"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-10-04 11:18:49 +08:00
|
|
|
declare -a nac3args
|
|
|
|
while [ $# -gt 1 ]; do
|
|
|
|
nac3args+=("$1")
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
demo="$1"
|
2023-09-29 15:17:45 +08:00
|
|
|
|
2024-07-26 10:42:40 +08:00
|
|
|
echo "### Checking $demo..."
|
|
|
|
|
|
|
|
# Get reference output
|
|
|
|
echo ">>>>>> Running $demo with the Python interpreter"
|
2023-09-29 15:17:45 +08:00
|
|
|
./interpret_demo.py "$demo" > interpreted.log
|
2023-09-29 16:43:48 +08:00
|
|
|
|
2024-07-26 10:42:40 +08:00
|
|
|
echo "...... Trying NAC3's 32-bit code generator output"
|
|
|
|
./run_demo.sh -m32 --out run_32.log "${nac3args[@]}" "$demo"
|
|
|
|
diff -Nau interpreted.log run_32.log
|
|
|
|
|
|
|
|
echo "...... Trying NAC3's 64-bit code generator output"
|
|
|
|
./run_demo.sh --out run_64.log "${nac3args[@]}" "$demo"
|
|
|
|
diff -Nau interpreted.log run_64.log
|
|
|
|
|
|
|
|
echo "...... OK"
|
|
|
|
|
|
|
|
rm -f interpreted.log \
|
|
|
|
run_32.log run_64.log
|