test: retarget Pattern-A combined-feed gates to sep .sepwork layout (M4 E3, #94)
94a of the C-mig2 split (rob rule-11): 13 Pattern-A gates that fed a .combined.ww to w6c/w6c_ww now drive two --sep builds (ww / ww_ww) and byte-diff the concatenated per-package .sepwork/*.s, mirroring #93's convention. Lands pre-flip while combined.ww still exists as the reversible safety net. Test-only; all 5 binary pins HOLD. 989_enumcap_run deferred to 94b (its decisive assertion is a combined.ww content diff, not a .s diff).
This commit is contained in:
@@ -96,11 +96,11 @@ main(void)
|
||||
bin = absbin;
|
||||
}
|
||||
|
||||
char w6c[2100], w6c_ww[2100];
|
||||
snprintf(w6c, sizeof w6c, "%s/w6c", bin);
|
||||
snprintf(w6c_ww, sizeof w6c_ww, "%s/w6c_ww", bin);
|
||||
if (access(w6c_ww, X_OK) != 0) {
|
||||
fprintf(stderr, "794: w6c_ww missing — cannot run the wwstage "
|
||||
char cdrv[2100], wdrv[2100];
|
||||
snprintf(cdrv, sizeof cdrv, "%s/ww", bin);
|
||||
snprintf(wdrv, sizeof wdrv, "%s/ww_ww", bin);
|
||||
if (access(wdrv, X_OK) != 0) {
|
||||
fprintf(stderr, "794: ww_ww missing — cannot run the wwstage "
|
||||
"accept gate (the whole point of this test)\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -123,9 +123,14 @@ main(void)
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/* cstage driver build (prefer is correct) emits the combined unit. */
|
||||
snprintf(cmd, sizeof cmd, "cd %s && %s/ww build -I %s %s/main.ww",
|
||||
dir, bin, dir, dir);
|
||||
/* #94 sep layout: cstage's --sep build (prefer is correct) compiles
|
||||
* the units and links the binary; pin WW_PKGCACHE under the scratch
|
||||
* dir so out/.pkgcache is untouched. NO cs==ww byte-id here — the #55
|
||||
* checker fix has an open cgen-side bare-leaf sibling that diverges the
|
||||
* asm independently; the sound discriminator is the wwstage ACCEPT. */
|
||||
snprintf(cmd, sizeof cmd,
|
||||
"cd %s && WW_PKGCACHE=%s/pkgc_c %s build --sep -I %s -o %s/main %s/main.ww",
|
||||
dir, dir, cdrv, dir, dir, dir);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "794: cstage build failed\n");
|
||||
rc = 1; goto done;
|
||||
@@ -138,29 +143,16 @@ main(void)
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
char comb[1024];
|
||||
snprintf(comb, sizeof comb, "%s/main.combined.ww", dir);
|
||||
if (access(comb, 0) != 0) {
|
||||
fprintf(stderr, "794: no combined.ww emitted\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
/* Sanity: cstage's own backend re-accepts its combined. */
|
||||
char cs_s[1024], ws_s[1024];
|
||||
snprintf(cs_s, sizeof cs_s, "%s/cs.s", dir);
|
||||
snprintf(ws_s, sizeof ws_s, "%s/ww.s", dir);
|
||||
snprintf(cmd, sizeof cmd, "%s -o %s %s 2>/dev/null", w6c, cs_s, comb);
|
||||
/* The #55 discriminator: the wwstage driver's --sep build runs the
|
||||
* wwstage checker over the same units and must ACCEPT. PRE-fix it
|
||||
* rejected (bare `v` -> main.v: i64 -> return mismatch); POST-fix it
|
||||
* prefers curmod=aa -> aa.v: i32 and accepts. */
|
||||
snprintf(cmd, sizeof cmd,
|
||||
"cd %s && WW_PKGCACHE=%s/pkgc_w %s build --sep -I %s -o %s/mainww %s/main.ww "
|
||||
">/dev/null 2>&1",
|
||||
dir, dir, wdrv, dir, dir, dir);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "794: w6c on combined failed\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
/* The #55 discriminator: w6c_ww must ACCEPT the combined unit.
|
||||
* PRE-fix it rejected (bare `v` -> main.v: i64 -> return mismatch);
|
||||
* POST-fix it prefers curmod=aa -> aa.v: i32 and accepts. */
|
||||
snprintf(cmd, sizeof cmd, "%s -o %s %s 2>/dev/null", w6c_ww, ws_s, comb);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "794: w6c_ww REJECTED the combined (#55: bare "
|
||||
fprintf(stderr, "794: ww_ww REJECTED the units (#55: bare "
|
||||
"value-ident resolved the wrong module's same-leaf symbol)\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user