standalone: Fix several issues post script refactoring
- Add helptext for check_demos.sh - Add back support for using debug NAC3 for running tests - Output error message when argument is not recognized - Fixed last non-demo script argument being ignored - Add back SSE2 requirement to NAC3 (required for mandelbrot)
This commit is contained in:
parent
6fb8939179
commit
b3891b9a0d
@ -8,12 +8,15 @@ if [ -z "$1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
declare -a nac3args
|
declare -a nac3args
|
||||||
while [ $# -ge 2 ]; do
|
while [ $# -gt 1 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help)
|
--help)
|
||||||
echo "Usage: check_demo.sh [-i686] -- demo [NAC3ARGS...]"
|
echo "Usage: check_demo.sh [--debug] [-i686] -- [NAC3ARGS...] demo"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
--debug)
|
||||||
|
debug=1
|
||||||
|
;;
|
||||||
-i686)
|
-i686)
|
||||||
i686=1
|
i686=1
|
||||||
;;
|
;;
|
||||||
@ -22,18 +25,18 @@ while [ $# -ge 2 ]; do
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
echo "Unrecognized argument \"$1\""
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
demo="$1"
|
|
||||||
shift
|
|
||||||
while [ $# -gt 1 ]; do
|
while [ $# -gt 1 ]; do
|
||||||
nac3args+=("$1")
|
nac3args+=("$1")
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
demo="$1"
|
||||||
|
|
||||||
|
|
||||||
echo "### Checking $demo..."
|
echo "### Checking $demo..."
|
||||||
@ -43,12 +46,20 @@ echo ">>>>>> Running $demo with the Python interpreter"
|
|||||||
|
|
||||||
if [ -n "$i686" ]; then
|
if [ -n "$i686" ]; then
|
||||||
echo "...... Trying NAC3's 32-bit code generator output"
|
echo "...... Trying NAC3's 32-bit code generator output"
|
||||||
./run_demo.sh -i686 --out run_32.log "${nac3args[@]}" "$demo"
|
if [ -n "$debug" ]; then
|
||||||
|
./run_demo.sh --debug -i686 --out run_32.log -- "${nac3args[@]}" "$demo"
|
||||||
|
else
|
||||||
|
./run_demo.sh -i686 --out run_32.log -- "${nac3args[@]}" "$demo"
|
||||||
|
fi
|
||||||
diff -Nau interpreted.log run_32.log
|
diff -Nau interpreted.log run_32.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "...... Trying NAC3's 64-bit code generator output"
|
echo "...... Trying NAC3's 64-bit code generator output"
|
||||||
./run_demo.sh --out run_64.log "${nac3args[@]}" "$demo"
|
if [ -n "$debug" ]; then
|
||||||
|
./run_demo.sh --debug --out run_64.log -- "${nac3args[@]}" "$demo"
|
||||||
|
else
|
||||||
|
./run_demo.sh --out run_64.log -- "${nac3args[@]}" "$demo"
|
||||||
|
fi
|
||||||
diff -Nau interpreted.log run_64.log
|
diff -Nau interpreted.log run_64.log
|
||||||
|
|
||||||
echo "...... OK"
|
echo "...... OK"
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" == "--help" ]; then
|
||||||
|
echo "Usage: check_demos.sh [CHECKARGS...] [--] [NAC3ARGS...]"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
for demo in src/*.py; do
|
for demo in src/*.py; do
|
||||||
./check_demo.sh "$@" "$demo"
|
./check_demo.sh "$@" "$demo"
|
||||||
|
@ -14,7 +14,7 @@ declare -a nac3args
|
|||||||
while [ $# -ge 1 ]; do
|
while [ $# -ge 1 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help)
|
--help)
|
||||||
echo "Usage: run_demo.sh [--help] [--out OUTFILE] [--debug] [-i686] -- [NAC3ARGS...]"
|
echo "Usage: run_demo.sh [--help] [--out OUTFILE] [--debug] [-i686] -- [NAC3ARGS...] demo"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
--out)
|
--out)
|
||||||
@ -32,7 +32,8 @@ while [ $# -ge 1 ]; do
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
echo "Unrecognized argument \"$1\""
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
@ -59,7 +60,7 @@ if [ -z "$i686" ]; then
|
|||||||
clang -c -std=gnu11 -Wall -Wextra -O3 -o demo.o demo.c
|
clang -c -std=gnu11 -Wall -Wextra -O3 -o demo.o demo.c
|
||||||
clang -o demo module.o demo.o $DEMO_LINALG_STUB -lm -Wl,--no-warn-search-mismatch
|
clang -o demo module.o demo.o $DEMO_LINALG_STUB -lm -Wl,--no-warn-search-mismatch
|
||||||
else
|
else
|
||||||
$nac3standalone --triple i686-unknown-linux-gnu "${nac3args[@]}"
|
$nac3standalone --triple i686-unknown-linux-gnu --target-features +sse2 "${nac3args[@]}"
|
||||||
clang -m32 -c -std=gnu11 -Wall -Wextra -O3 -msse2 -o demo.o demo.c
|
clang -m32 -c -std=gnu11 -Wall -Wextra -O3 -msse2 -o demo.o demo.c
|
||||||
clang -m32 -o demo module.o demo.o $DEMO_LINALG_STUB32 -lm -Wl,--no-warn-search-mismatch
|
clang -m32 -o demo module.o demo.o $DEMO_LINALG_STUB32 -lm -Wl,--no-warn-search-mismatch
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user