From 0112fb08f3c317e33c41e131ed6f9cc981a713be Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Mon, 9 Nov 2026 23:31:54 +0000 Subject: [PATCH] README: test skip markers, memory-model runs, libc name clashes The Testing section now shows how to run the tests under one memory model (tests.ps1 -Model, tests.sh , TSLANG_MM), the first-line markers that skip a test (// gc only, // not own, // linux only), and that a test function named like a libc function (read, write) replaces it on Linux, which made a test segfault under -mm=gc (#88). Co-Authored-By: Claude Opus 5.5 --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 6aa73ed..ab6ba06 100644 --- a/README.md +++ b/README.md @@ -104,9 +104,20 @@ so with the zip and an NDK, nothing needs building. ``` tests.ps1 # x64, all four passes: release/debug x compile/jit +tests.ps1 -Model own # under -mm=own (also rc, none; or $Env:TSLANG_MM) $Env:TSLANG_ARCH="x86"; .\tests.ps1 # x86, release/compile and debug/compile only +./tests.sh rc # Linux, under -mm=rc (or TSLANG_MM=rc) ``` +The default memory model is `gc`. A test whose first line starts with `// gc only` is +skipped under any other model, one starting `// not own` under `-mm=own`, and one starting +`// linux only` by `tests.ps1` (it runs in `tests.sh`). A test that should run under every +model but has a part that can't, branches on `__MEMORY_MODEL__` instead. + +A test's functions are global symbols, so on Linux one named like a libc function (`read`, +`write`, ...) takes that function's place, for the collector too: a test with its own `read()` +segfaulted under `-mm=gc` as the collector started. Give test functions names libc doesn't use. + The JIT is host-only (`--emit=jit` refuses an x86 target by design), so under `TSLANG_ARCH=x86` `tests.ps1` prints "jit is host-only; skipped for x86" and runs only the two compile passes, against the x86 tree built above. It compiles with