aboutsummaryrefslogtreecommitdiff
path: root/tests/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-xtests/test.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh
index 6d8453e..3b505fc 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -273,6 +273,9 @@ s_interp() {
python3 tests/drivers/actor_test.py $T/zy > $T/actor.out 2>&1; r=$?
grep -v '^ok' $T/actor.out
chk $r 0 "native isolated actor acceptance, rejection and regression fixtures"
+ python3 tests/drivers/hold_test.py $T/zy > $T/hold.out 2>&1; r=$?
+ grep -v '^ok' $T/hold.out
+ chk $r 0 "native hold blocks: monitors, rejections, a race between actors, rank order"
chk "$(ZC_ARG_TEST=ok $T/zy tests/programs/args.zc alpha beta < tests/programs/args.zc)" "4 <eval> beta 1 1" "interp the command line reaches argv, after <eval>"
chk "$($T/zy < tests/programs/cabi.zc | md5sum)" "$(md5sum < tests/programs/cabi.expected)" "interp native calls and callbacks (extern, cfunc)"
chk "$($T/zy < tests/programs/cabi_o3.zc | md5sum)" "$(md5sum < tests/programs/cabi_o3.expected)" "interp native calls from o3 code, more arguments than registers"
@@ -298,6 +301,9 @@ s_micro() {
python3 tests/drivers/actor_test.py $T/zym > $T/actor.out 2>&1; r=$?
grep -v '^ok' $T/actor.out
chk $r 0 "micro isolated actor acceptance, rejection and regression fixtures"
+ python3 tests/drivers/hold_test.py $T/zym > $T/hold.out 2>&1; r=$?
+ grep -v '^ok' $T/hold.out
+ chk $r 0 "micro hold blocks: monitors, rejections, a race between actors, rank order"
if command -v node >/dev/null && command -v tsc >/dev/null && node src/js/mklayout.js --map $MAP/memmap.h --out $T/jsvm >/dev/null \
&& cp $ROOT/s1/genome.bin $T/jsvm/ && tsc src/js/tinyvm.ts --target es2020 --lib es2020,dom --module commonjs --outDir $T/jsvm; then
python3 tests/drivers/fuzz_compiler.py $ROOT/zy $T/zym --js $T/jsvm/tinyvm.js > $T/fuzz.out 2>&1; r=$?
@@ -526,6 +532,9 @@ s_jit() {
bash tests/drivers/jit_x64_test.sh $T/zyi $T/zyx > $T/jit_x64.out 2>&1; r=$?
grep '^DIFF' $T/jit_x64.out
chk $r 0 "x86-64 jit agrees with the interpreter: $(tail -n 1 $T/jit_x64.out)"
+ python3 tests/drivers/hold_test.py $T/zyx > $T/hold_x64.out 2>&1; r=$?
+ grep -v '^ok' $T/hold_x64.out
+ chk $r 0 "x86-64 jit hold blocks"
chk "$(ZYNOENH=1 $T/zyx < tests/programs/enh_ops.zc | md5sum)" "$(md5sum < tests/programs/enh_ops.expected)" "x86-64 jit with enhancements called through xrun (ZYNOENH=1)"
chk "$(ZYTRACE=1 $T/zyx < tests/programs/o3.zc 2>&1 | grep -c 'bytes of x86-64')" "7" "x86-64 jit compiles the o3 regions it can (one has too many live values)"
chk "$(ZYTRACE=1 $T/zyx < tests/programs/o3_freelist.zc 2>&1 | grep -c ' inline at ')" "11" "x86-64 jit inlines new_k and recycle_leaf in compiled o3 regions"
@@ -546,6 +555,9 @@ s_llvm() {
if [ $llvm_ok = 1 ]; then
run $T/zyl "llvm"
chk "$(ZYTRACE=1 $T/zyl < tests/programs/o3.zc 2>&1 | grep -c 'compiled by llvm')" "8" "llvm compiles every o3 region"
+ python3 tests/drivers/hold_test.py $T/zyl > $T/hold.out 2>&1; r=$?
+ grep -v '^ok' $T/hold.out
+ chk $r 0 "llvm hold blocks"
printf '#!/bin/sh\nZYHOT=1 exec %s "$@"\n' $T/zyl > $T/llall; chmod +x $T/llall
chk "$($T/zyl < tests/programs/structval.zc)" "34 3520 18 325 810 340" "llvm structs by value (the call goes through the interpreter's native call)"
chk "$($T/zyl < tests/programs/structret.zc)" "3 4 3.500000 4.000000 24 8 1.000000 3.500000" "llvm structs returned from a c function"