diff options
| author | 2026-10-14 17:22:33 +0330 | |
|---|---|---|
| committer | 2026-10-14 17:22:33 +0330 | |
| commit | 090973596163c073ada4dea6d06edd2ff74f615c (patch) | |
| tree | b2cd243c91ed592abc8eec58178c4a91dee5e549 /tests | |
| parent | Merge branch 'main' into work/bench (diff) | |
| parent | merge work/jit2: compiled o3 regions on x86-64 (diff) | |
Merge branch 'main' into work/bench
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bench/bench.sh | 2 | ||||
| -rwxr-xr-x | tests/test.sh | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/bench/bench.sh b/tests/bench/bench.sh index 4ef2ca5..0a9acef 100644 --- a/tests/bench/bench.sh +++ b/tests/bench/bench.sh @@ -6,7 +6,7 @@ CC=${CC:-$(sh src/tools/findcc.sh)} || exit 1 make -s build/core/genome.bin || exit 1 $CC -O2 -w -DJTYPE=int -DZYINTERP src/core/core.c src/core/io_linux.c -Isrc/core -Ibuild/core/map --embed-dir=build/core -o $T/zy vms=("$T/zy"); names=("interp") -# the host's own jit, where there is one (x86-64 linux: blocks are translated, o3 regions run on the region interpreter) +# the host's own jit, where there is one (x86-64 linux: blocks are translated, o3 regions compiled; ZYO3INTERP=1 runs them on the region interpreter) if [ "$(uname -s)" = Linux ] && [ "$(uname -m)" = x86_64 ]; then $CC -O2 -w -DJTYPE=int src/core/core.c src/core/io_linux.c -Isrc/core -Ibuild/core/map --embed-dir=build/core -o $T/zyn && { vms+=("$T/zyn"); names+=("x86-64 jit"); } fi diff --git a/tests/test.sh b/tests/test.sh index bc199e1..9dd04a8 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -54,7 +54,7 @@ CC=${CC:-$(sh src/tools/findcc.sh)} || exit 1 export CC # the language server runs on the interpreter unless the host has a jit (arm64, or x86-64 # linux), and a check of a large document then takes many seconds: stretch the drivers' -# deadlines. the x86-64 jit gets a little room, since it does not compile o3 regions +# deadlines. the x86-64 jit gets a little room if [ -z "${ZC_TEST_TIMEOUT_SCALE:-}" ]; then case "$(uname -s)-$(uname -m)" in *-arm64|*-aarch64) ZC_TEST_TIMEOUT_SCALE=1;; Linux-x86_64) ZC_TEST_TIMEOUT_SCALE=2;; *) ZC_TEST_TIMEOUT_SCALE=8;; esac; fi export ZC_TEST_TIMEOUT_SCALE # the default map, generated as make does it, and the tools built against it @@ -511,6 +511,10 @@ s_jit() { grep '^DIFF' $T/jit_x64.out 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 "$($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 } |
