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:
@@ -51,13 +51,23 @@ static const struct check checks[] = {
|
||||
{ "TEXT utf8.runesz,", 0 },
|
||||
};
|
||||
|
||||
/* build_s — build `src` to `<stem>.s` via `driver`; returns 0 on success. */
|
||||
/* build_s — build `src` via `driver`, leaving the unit asm at `<stem>.s`;
|
||||
* returns 0 on success.
|
||||
* #93 sep layout: `--sep -o <stem>` splits the asm across
|
||||
* <stem>.sepwork/<pkg>.s (root in __root.s, the imported encoding.utf8 in
|
||||
* encoding.utf8.s). The mangled `encoding.utf8.runesz` definition lives in
|
||||
* the per-pkg .s and `TEXT main,` in __root.s, so we CONCAT all the
|
||||
* per-unit .s (sorted glob order is deterministic) into a single <stem>.s
|
||||
* for the needle scans + the rule-10 cmp downstream. WW_PKGCACHE is pinned
|
||||
* beside <stem> to leave the shared out/.pkgcache untouched. */
|
||||
static int
|
||||
build_s(const char *driver, const char *src, const char *stem)
|
||||
{
|
||||
char cmd[1024];
|
||||
snprintf(cmd, sizeof cmd, "%s build -o '%s' '%s' 2>/dev/null",
|
||||
driver, stem, src);
|
||||
snprintf(cmd, sizeof cmd,
|
||||
"WW_PKGCACHE='%s.pkgc' timeout 180 %s build --sep -o '%s' '%s' "
|
||||
"2>/dev/null && cat '%s.sepwork/'*.s > '%s.s'",
|
||||
stem, driver, stem, src, stem, stem);
|
||||
return runwait(cmd);
|
||||
}
|
||||
|
||||
@@ -137,7 +147,8 @@ main(void)
|
||||
}
|
||||
|
||||
char cmd[256];
|
||||
snprintf(cmd, sizeof cmd, "rm -f '%s' '%s'* '%s'*", src, cstem, wstem);
|
||||
/* #93: -rf to also drop the per-stem .sepwork scratch + pinned pkgc. */
|
||||
snprintf(cmd, sizeof cmd, "rm -rf '%s' '%s'* '%s'*", src, cstem, wstem);
|
||||
runwait(cmd);
|
||||
|
||||
if (fail) {
|
||||
|
||||
Reference in New Issue
Block a user