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, "792: w6c_ww missing — cannot run the cs==ww "
|
||||
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, "792: ww_ww missing — cannot run the cs==ww "
|
||||
"byte-id gate (the whole point of this test)\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ main(void)
|
||||
char dir[] = "/tmp/ww792_XXXXXX";
|
||||
if (mkdtemp(dir) == NULL) { fprintf(stderr, "792: mkdtemp\n"); return 1; }
|
||||
|
||||
char path[1024], cmd[4096], comb[1024], cs_s[1024], ws_s[1024];
|
||||
char path[1024], cmd[4096], cs_s[1024], ws_s[1024];
|
||||
int rc = 0;
|
||||
|
||||
snprintf(path, sizeof path, "%s/main.ww", dir);
|
||||
@@ -117,33 +117,29 @@ main(void)
|
||||
fputs(SRC, f);
|
||||
fclose(f);
|
||||
|
||||
snprintf(comb, sizeof comb, "%s/main.combined.ww", dir);
|
||||
/* #94: sep layout. The cstage driver's --sep build emits the root
|
||||
* unit's asm to <stem>.sepwork/__root.s via its internal w6c; pin
|
||||
* WW_PKGCACHE under the scratch dir so out/.pkgcache is untouched. */
|
||||
snprintf(cs_s, sizeof cs_s, "%s/main.sepwork/__root.s", dir);
|
||||
snprintf(ws_s, sizeof ws_s, "%s/mainww.sepwork/__root.s", dir);
|
||||
|
||||
/* cstage driver build: produces the combined.ww + must accept. */
|
||||
snprintf(cmd, sizeof cmd, "cd %s && %s/ww build -I %s %s/main.ww",
|
||||
dir, bin, dir, dir);
|
||||
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, "792: cstage build failed\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
if (access(comb, 0) != 0) {
|
||||
fprintf(stderr, "792: no combined.ww produced\n");
|
||||
fprintf(stderr, "792: cstage sep build failed\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
/* The #209 discriminator: raw w6c_ww on the combined. Pre-fix the
|
||||
* wwstage checker REJECTED the spread-union match arms (non-zero
|
||||
* exit). Post-fix it accepts AND is byte-id with cstage's w6c. */
|
||||
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 #209 discriminator: the wwstage driver's --sep build runs the
|
||||
* wwstage checker over the same root unit. Pre-fix it REJECTED the
|
||||
* spread-union match arms (build fails); post-fix it accepts AND its
|
||||
* w6c_ww-emitted __root.s is byte-id with the cstage __root.s. */
|
||||
snprintf(cmd, sizeof cmd,
|
||||
"cd %s && WW_PKGCACHE=%s/pkgc_w %s build --sep -I %s -o %s/mainww %s/main.ww",
|
||||
dir, dir, wdrv, dir, dir, dir);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "792: w6c on combined failed\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
snprintf(cmd, sizeof cmd, "%s -o %s %s 2>/dev/null", w6c_ww, ws_s, comb);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "792: w6c_ww on combined failed "
|
||||
fprintf(stderr, "792: wwstage sep build failed "
|
||||
"(#209 spread-union match reject?)\n");
|
||||
rc = 1; goto done;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user