aboutsummaryrefslogtreecommitdiff
path: root/tests/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-xtests/test.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test.sh b/tests/test.sh
index 6992c0d..8bf7a9b 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -103,6 +103,8 @@ run(){ # $1 = vm command, $2 = label
chk "$($vm < examples/typed.zc | tr '\n' '/')" "last: 4/point is 2 words: x int, y int/vec<point*> is 3 words: len int, cap int, items point**/push is bool(vec<T>*, T.d)/the heap says v is a vec<point*>, and v.items[0] is a point/" "$l typed example"
chk "$($vm < examples/wiring.zc)" "16 1234 25 4/9" "$l enhancement example"
chk "$($vm < tests/programs/allocfast.zc)" "0 0 499500 0" "$l constant-size allocation fast path"
+ chk "$($vm < tests/programs/o3_freelist.zc)" "0 0 1 12502500 500 1" "$l o3 new and free: class-list reuse, zeroing, an empty list, untyped neighbours"
+ chk "$(sed 's/^include rt;$/include rt;\nmemdebug on;/' tests/programs/o3_freelist.zc | $vm)" "0 0 1 12502500 500 1" "$l o3 new and free under memdebug take the general path"
chk "$($vm < tests/programs/basics.zc | tr '\n' '/')" "285 610 42 512/hey 65 -3 -2 1024 -8/12456/757/9 100-101/5/ok/" "$l language basics"
chk "$($vm < tests/programs/umd.zc)" "100 6 0 15 99 5 5" "$l u m d lifetimes"
chk "$($vm < tests/programs/names.zc)" "12 1 8" "$l u, m and d are ordinary names"
@@ -523,7 +525,9 @@ s_jit() {
chk $r 0 "x86-64 jit agrees with the interpreter: $(tail -n 1 $T/jit_x64.out)"
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)"
- for p in o3 o3copy o3licm o3push o3bytes fo3 o3call o3deep; do
+ 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"
+ chk "$(ZYNOFASTALLOC=1 $T/zyx < tests/programs/o3_freelist.zc 2>&1)" "$($T/zyx < tests/programs/o3_freelist.zc 2>&1)" "x86-64 o3 inline allocation matches the plain calls (ZYNOFASTALLOC=1)"
+ for p in o3 o3copy o3licm o3push o3bytes fo3 o3call o3deep o3_freelist; do
chk "$($T/zyx < tests/programs/$p.zc 2>&1)" "$(ZYO3INTERP=1 $T/zyx < tests/programs/$p.zc 2>&1)" "x86-64 o3 code matches the region interpreter (ZYO3INTERP=1): $p"
done
fi