From 8af3174b04f18d858653ad70669dced71f5eaa99 Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 23:10:49 +0330 Subject: destructors: heap(v), drop(v, f) / v.drop(f) / v.drop = f, struct drop methods, collector drops after the sweep (once, resurrection), freed blocks forget their drop, temporaries drop at statement end with a hint, actor send check; o3: no collection inside a region (pending until the outermost exit), no drops set or ended inside o3; spec 3.11.6, 4.10.3-4, 6.15 --- tests/test.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test.sh') diff --git a/tests/test.sh b/tests/test.sh index 1be4557..bd731ed 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -578,6 +578,7 @@ s_lsp() { case "$h" in *"$w"*) chk 1 1 "lsp hint: $w";; *) chk 0 1 "lsp hint: $w";; esac done chk "$($lsp < examples/struct_closure_opt.zc | grep -c error)" "0" "lsp: methods and closures check clean" + case "$($lsp < tests/data/drop_hint.zc)" in *"value with drop is never bound; it drops at the end of this statement"*) chk 1 1 "lsp hint: a value with drop that is never bound";; *) chk 0 1 "lsp hint: a value with drop that is never bound";; esac # a file of a larger build checks on its own: its bodyless declarations are not errors in check mode for f in src/runtime/rt.zc src/runtime/run.zc src/lsp/server.zc; do chk "$($lsp < $f | grep -c ': error:')" "0" "lsp: $f checks alone"; done # the compiler is several files that only make sense together: check them as one document -- cgit v1.2.3 From 3e6ff515045a5072bf823a60ca1a873f546d1fb7 Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 00:41:08 +0330 Subject: test.sh: the small map's collector check rewrites gc.zc's reclaim bound whatever its number (it was 990 when the sed was written, gc.zc says 950 now, so the small map was held to the default map's count) --- tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test.sh') diff --git a/tests/test.sh b/tests/test.sh index bd731ed..a3370f2 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -347,7 +347,7 @@ s_small() { # code literals can look like pointers on a compact map. test collection and # the retained root without assuming the default map's exact reclaim count. for vm in $T/zyms $T/zys; do - out=$(sed 's/f >= 990/f > 0/' tests/programs/gc.zc | $vm | tr '\n' '/') + out=$(sed -E 's/f >= [0-9]+/f > 0/' tests/programs/gc.zc | $vm | tr '\n' '/') chk "$out" "1000 1 900 1 199900/" "small collector makes progress and preserves its root" done -- cgit v1.2.3