test: retarget Pattern-B gates to sep .sepwork layout; 915 off private global (M4 E3, #93)

The driver flip moves build artifacts from next-to-source <stem>.s to a
.sepwork/ scratch dir. 29 Pattern-B gates now build `ww build --sep -o <stem>`
and read <stem>.sepwork/__root.s (multi-package gates concat all
<stem>.sepwork/*.s, since cross-package labels live in per-package .s).
All intermediates redirect to /tmp (WW_PKGCACHE + -o), so the corpus runs
parallel-safe with no source-tree pollution. Tests pass now (--sep is live)
and survive the flip.

915 additionally retargeted off strconv's PRIVATE left_shift_table (a let,
not export) — which separate compilation correctly hides — onto a test-local
package that exports its own probe table (#96). The combined path only linked
it via a single-unit private leak; encapsulation is now honored under sep.

Test-only; all 5 *_ww binaries HOLD. 989_m1mangle_run deferred (blocked by
#99, imported-package fn main mangling under sep).
This commit is contained in:
2026-06-18 11:12:04 +09:00
parent 24ca570a7e
commit eb6083e54a
30 changed files with 583 additions and 324 deletions

View File

@@ -174,9 +174,18 @@ main(void)
for (int s = 0; s < 2; s++) {
snprintf(stg[s].prog, sizeof stg[s].prog, "%s/prog.%s", td, stg[s].tag);
snprintf(stg[s].sfile, sizeof stg[s].sfile, "%s/prog.%s.s", td, stg[s].tag);
/* #93 sep layout: `--sep -o <prog>` splits the asm across
* <prog>.sepwork/<pkg>.s — the bare user `TEXT run,` lands in
* __root.s and the imported `TEXT aa.run,` in aa.s. Concat all
* the per-unit .s (sorted glob order is deterministic) into the
* flat <prog>.s the label-count + byte-id checks consume. The
* `-I %s` source path is preserved; WW_PKGCACHE is pinned under
* the tmpdir so the shared out/.pkgcache stays untouched. */
snprintf(cmd, sizeof cmd,
"timeout 240 %s/%s build -o %s -I %s %s >/dev/null 2>&1",
bin, stg[s].drv, stg[s].prog, td, rootww);
"WW_PKGCACHE=%s/pkgc timeout 240 %s/%s build --sep -o %s "
"-I %s %s >/dev/null 2>&1 && cat %s.sepwork/*.s > %s",
td, bin, stg[s].drv, stg[s].prog, td, rootww,
stg[s].prog, stg[s].sfile);
if (runwait(cmd) != 0) {
fprintf(stderr, "84 FAIL: %s build\n", stg[s].drv);
fail++;