test: migrate Fam9 match/tagged value tests to @test (#5-C5)

fold-2 chunk C5 (drew's Fam8-13 plan), the highest-risk chunk: 21 match/tagged
value-row C drivers re-homed. 20 -> test/lang/*_test.ww @test row-tables + 12
runww //ww:error carriers (both stages reject). The global-tag cluster
(globtag*/globstructwiden/taggedderefstore/...), which sits on the #15/#17
global-ptr fix, was empirically probed byte-id CLEAN -- the predicted hotspot
surfaced ZERO fresh cs!=ww. Carves: variant_chain_b95 #81 -> _runonly (genuinely
diverges at HEAD); callret_bound277 #277 -> slim C pin (cs-runs/ww-rejects),
mutation-gated. 929_tagged_memarg kept whole (SSE-ABI asm conformance). 19
drivers deleted, 944_variant_chain slimmed to the #277 pin.

The match-on-tagged-struct-field divergence (former #26) probed RESOLVED for all
its cited shapes (938 voidstr_field/recursion_torture, tagnorm dedup_match all
byte-id cs==ww + value-correct) -- closed no-reproducer-at-HEAD, attribution to
#15/#17 INFERRED. Those rows migrate as normal byte-id @test and serve as the
REGRESSION SENTINEL for the inferred close (a resurgence trips the gate).

LANGBYTEID floor 93->113; test count 374->355 (19 deleted; 929 + 944_variant_chain
kept). do-not-auto-batch (926_tagscr/940_global_sret/940_str_forrange) untouched.
This commit is contained in:
2026-06-24 04:27:00 +09:00
parent 60dec4a6bf
commit 246e5bb90e
54 changed files with 1955 additions and 5820 deletions

View File

@@ -1,74 +1,23 @@
/*
* 944_variant_chain_b95_run — #95: variant-match chain-membership arm
* (pass 1b) + structural fallback (c2), BOTH stages fused (cstage
* cg_tag_for_variant + wwstage flatvariantidxt are the same route).
* Pre-#95 a NAMED struct source that was not pointer-identical to a
* NAMED variant fell through every pass and the widen stored tag 0 —
* both stages, byte-identical, gate-blind (the worst class on the
* board: silent wrong tag on VALID code).
* 944_variant_chain_b95_run -- SLIMMED to the one irreducible asymmetric row.
*
* Row sources are ken's #95 first-position oracle
* (.ai/ken-95-oracle.md, probes /tmp/b95/src + kb4/kb5) and rob's
* fold spec (.ai/rob-95-spec.md). Reference: harec
* tagged_select_subtype P1/P2/P3 (ref/harec/src/types.c:702-739,
* :988-1140).
* The #95 variant-match chain-membership corpus (22 rows) migrated to fold-2
* homes (#5-C5): the K_RUN value rows -> test/lang/variant_chain_b95_test.ww
* (@test + T2 byte-id); the two #81-byte-id-waived CALL-source rows ->
* test/lang/variant_chain_b95_runonly_test.ww (value-only); the K_BUILDERR
* reject rows -> test/wcc/data/vchain_<name>/case.ww runww //ww:error carriers.
*
* row | shape (oracle row) | cs/ww
* --------------------+-------------------------------------+------
* chain_1lvl_i | kb5_v2s1i HEADLINE: depth-1 ident |
* | src base → (void|al0) — was both- |
* | wrong-IDENTICAL byte-id tag 0 | 0/0
* chain_2lvl_i | kb95_2lvl_i: ident src depth-2 — |
* | the class extends to any depth | 0/0
* chain_deep_src | kb95_deep_src: src ali2 → (void| |
* | ali) — chain-direction DOWN | 0/0
* chain_deep_var | kb95_deep_var: src base → (void| |
* | ali2) — chain-direction UP | 0/0
* chain_call_bound81 | kb5_v2s1: CALL src 1-lvl — runs |
* | 0/0; byte-id waived: pre-existing |
* | #81 uninit-local zero-fill asm |
* | noise (NO at the #95 base too) | 0/0
* chain_call2_bound81 | kb4_v2_struct2 (#95's original): |
* | CALL src 2-lvl — same #81 waiver | 0/0
* chain_amb_loud | kb95_amb: (ali|ali2) over one base, |
* | src base — TODAY silently tagged |
* | member 0; ≥2 chain hits cannot be |
* | disambiguated in the nominal-lossy |
* | model (harec nassign≥2 → NULL) — |
* | hard-error, twin texts share the |
* | experr tail | err/err
* chain_amb_srcA/B | src ali / src ali2 into (ali|ali2): |
* | pass-1 EXACT fires first (harec P1 |
* | short-circuit) — precedence pins, |
* | MUST NOT MOVE | 0/0
* nom_str / nom_err | (str|linerr) #218 nominal pins: str |
* | src tags str, linerr src tags |
* | linerr — MUST NOT MOVE through the |
* | new arm | 0/0
* exact_ctl | kb5_v2sE2: exact-match ident |
* | control — MUST NOT MOVE | 0/0
* bare_ctl/bare_2lvl | kb4_v2_ctrl / kb4_v2_alias2: pass-2 |
* | bare-source controls — MUST NOT |
* | MOVE | 0/0
* bare_ambig/2 | kb4_v2_ambig(2): pass-2 ambiguity |
* | guards hold their loud texts | err/err
* callret_bound277 | kb5_v2sE: CALL src typed-as-alias — |
* | ww #277 aggregate-return capability |
* | leg, OUT of #95; cells pinned as |
* | observed (cs runs, ww loud) | 0/err
* unrel_struct | kb95_unrel (c2): ta/tb nominally- |
* | unrelated same-layout structs, src |
* | ta → (void|tb) — was both-wrong- |
* | identical byte-id; harec interning |
* | makes dealias(ta)==dealias(tb) → |
* | accept, tag tb (types.c:72-81 + |
* | :1000-1002) | 0/0
* callret_bound277 (kb5_v2sE) CANNOT move: it is cstage-runs / wwstage-rejects
* -- cstage builds+runs it (exit 0) while wwstage LOUD-STOPS with "deferred
* #277" (the ww aggregate-return capability gap, OUT of #95). That asymmetry is
* inexpressible as a single-compile @test (which builds one way) or a runww
* //ww:error carrier (which demands BOTH stages reject). It stays a slim C pin.
*
* K_RUN rows build+run BOTH drivers (exit==want) and assert cstage/
* wwstage asm byte-id. K_RUN_NOID waives byte-id — cite the blocking
* task at the row. K_RUN_CS_WWERR: cstage build+run exit==cswant AND
* wwstage build FAILS with experr (944_alias_accept_run kind). NNN<950,
* self-contained /tmp sources, no imports (944 precedent).
* Non-vacuity (the pin CAN go RED): if cstage stops running it (exit != 0) or
* wwstage starts accepting it (#277 wired), the row fails; the wwstage leg also
* requires the EXACT "deferred #277" diagnostic so an unrelated wwstage error
* cannot masquerade as coverage. Mutation-checked: dropping the cast-to-alias
* (`mk()` typed plainly) flips cstage and was observed RED.
*/
#include <stdio.h>
#include <stdlib.h>
@@ -86,36 +35,6 @@ runwait(const char *cmd)
return -1;
}
static int
slurp_eq(const char *a, const char *b)
{
FILE *fa = fopen(a, "rb");
FILE *fb = fopen(b, "rb");
if (!fa || !fb) { if (fa) fclose(fa); if (fb) fclose(fb); return -1; }
int rc = 0;
for (;;) {
int ca = fgetc(fa), cb = fgetc(fb);
if (ca != cb) { rc = -1; break; }
if (ca == EOF) break;
}
fclose(fa); fclose(fb);
return rc;
}
#define K_RUN 0 /* build+run BOTH, exits==wants, + byte-id */
#define K_BUILDERR 1 /* build FAILS with experr on BOTH drivers */
#define K_RUN_NOID 2 /* build+run BOTH, exits==wants, byte-id
* SKIPPED — cite the blocking task */
#define K_RUN_CS_WWERR 3 /* bound row: cstage build+run exit==cswant;
* wwstage build FAILS with experr — cite
* the blocking task */
struct row { const char *label; const char *src;
int cswant; int wwwant; int kind; const char *experr; };
/* errlog_has — a builderr cell must fail WITH its diagnostic; any other
* failure (parse error, crash, hang-kill) is a vacuous reject (940
* precedent). */
static int
errlog_has(const char *path, const char *needle)
{
@@ -128,390 +47,68 @@ errlog_has(const char *path, const char *needle)
return strstr(buf, needle) != NULL;
}
static const struct row rows[] = {
/* ---- c1: chain-membership graduations (were tag-0 silent) */
{ "chain_1lvl_i",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"export fn main() i32 = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | al0) = s;\n"
" if (!(v is al0)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "chain_2lvl_i",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"type ali = al0;\n"
"export fn main() i32 = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | ali) = s;\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "chain_deep_src",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"export fn main() i32 = {\n"
" let s: ali2;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | ali) = s;\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "chain_deep_var",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"export fn main() i32 = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | ali2) = s;\n"
" if (!(v is ali2)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
/* CALL-src legs run 0/0; byte-id waived: the mk() frame carries
* the pre-existing #81 uninit-local zero-fill asm divergence
* (cells were byteid=NO at the #95 base too). */
{ "chain_call_bound81",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"fn mk() base = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" return s;\n"
"};\n"
"export fn main() i32 = {\n"
" let v: (void | al0) = mk();\n"
" if (!(v is al0)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN_NOID, NULL }, /* byte-id: task #81 */
{ "chain_call2_bound81",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"type ali = al0;\n"
"fn mk() base = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" return s;\n"
"};\n"
"export fn main() i32 = {\n"
" let v: (void | ali) = mk();\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN_NOID, NULL }, /* byte-id: task #81 */
/* ≥2 chain hits — was a SILENT member-0 tag; twin texts share
* the experr tail (prefix convention). */
{ "chain_amb_loud",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"export fn main() i32 = {\n"
" let s: base;\n"
" s.a = 4; s.b = 9;\n"
" let v: (ali | ali2) = s;\n"
" if (v is ali) { return 1; };\n"
" if (v is ali2) { return 2; };\n"
" return 3;\n"
"};\n", 0, 0, K_BUILDERR,
"source alias chain reaches >=2 variants" },
/* pass-1 EXACT precedence pins: an exact source distinguishes
* (ali|ali2) — the chain arm must stay BEHIND pass 1. */
{ "chain_amb_srcA",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"export fn main() i32 = {\n"
" let s: ali;\n"
" s.a = 4; s.b = 9;\n"
" let v: (ali | ali2) = s;\n"
" if (!(v is ali)) { return 1; };\n"
" if (v is ali2) { return 2; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "chain_amb_srcB",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"export fn main() i32 = {\n"
" let s: ali2;\n"
" s.a = 4; s.b = 9;\n"
" let v: (ali | ali2) = s;\n"
" if (!(v is ali2)) { return 1; };\n"
" if (v is ali) { return 2; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
/* #218 nominal regression pins (rob §3e): (str | linerr) stays
* distinguishable through the new arm. */
{ "nom_str",
"package main;\n"
"type linerr = str;\n"
"export fn main() i32 = {\n"
" let s: str = \"ok\";\n"
" let v: (str | linerr) = s;\n"
" if (!(v is str)) { return 1; };\n"
" if (v is linerr) { return 2; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "nom_err",
"package main;\n"
"type linerr = str;\n"
"export fn main() i32 = {\n"
" let e: linerr = \"bad\";\n"
" let v: (str | linerr) = e;\n"
" if (!(v is linerr)) { return 1; };\n"
" if (v is str) { return 2; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "exact_ctl",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"type ali = al0;\n"
"export fn main() i32 = {\n"
" let s: ali;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | ali) = s;\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
/* ---- pass-2 bare-source controls (the #15 leg stays put) */
{ "bare_ctl",
"package main;\n"
"type vt = struct { a: int };\n"
"type stream = *vt;\n"
"export fn main() i32 = {\n"
" let x: vt;\n"
" x.a = 7;\n"
" let v: (void | stream) = &x;\n"
" if (!(v is stream)) { return 1; };\n"
" match (v) {\n"
" case let s: stream => { if (s.a != 7) { return 2; }; };\n"
" case void => { return 3; };\n"
" };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "bare_2lvl",
"package main;\n"
"type vt = struct { a: int };\n"
"type st0 = *vt;\n"
"type stream = st0;\n"
"export fn main() i32 = {\n"
" let x: vt;\n"
" x.a = 7;\n"
" let v: (void | stream) = &x;\n"
" if (!(v is stream)) { return 1; };\n"
" match (v) {\n"
" case let s: stream => { if (s.a != 7) { return 2; }; };\n"
" case void => { return 3; };\n"
" };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
{ "bare_ambig",
"package main;\n"
"type p1 = *i32;\n"
"type p2 = *i32;\n"
"export fn main() i32 = {\n"
" let x: i32 = 7;\n"
" let v: (p1 | p2) = &x;\n"
" return 0;\n"
"};\n", 0, 0, K_BUILDERR,
"bare source structurally matches >=2 NAMED variants" },
{ "bare_ambig2",
"package main;\n"
"type b1 = *i32;\n"
"type b2 = *i32;\n"
"type q1 = b1;\n"
"type q2 = b2;\n"
"export fn main() i32 = {\n"
" let x: i32 = 7;\n"
" let v: (q1 | q2) = &x;\n"
" return 0;\n"
"};\n", 0, 0, K_BUILDERR,
"bare source structurally matches >=2 NAMED variants" },
/* ww #277 aggregate-return capability leg — OUT of #95; dual
* cells pinned as observed so neither side drifts silently. */
{ "callret_bound277",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"type ali = al0;\n"
"fn mk() ali = {\n"
" let s: ali;\n"
" s.a = 4; s.b = 9;\n"
" return s;\n"
"};\n"
"export fn main() i32 = {\n"
" let v: (void | ali) = mk();\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN_CS_WWERR,
"deferred #277" }, /* ww: task #277 */
/* ---- c2: structural fallback — was both-wrong-identical
* byte-id silent (live metric-1: checkers accept, cgen tagged
* 0). harec accepts by interning (one node, tag tb). */
{ "unrel_struct",
"package main;\n"
"type ta = struct { a: int, b: int };\n"
"type tb = struct { a: int, b: int };\n"
"export fn main() i32 = {\n"
" let s: ta;\n"
" s.a = 4; s.b = 9;\n"
" let v: (void | tb) = s;\n"
" if (!(v is tb)) { return 1; };\n"
" return 0;\n"
"};\n", 0, 0, K_RUN, NULL },
/* ---- c3 (#107): is/as ACCEPTANCE must stay nominal-exact. cgen's
* chain/structural tag-synthesis arms widen tag lookup at the WIDEN
* site only; the wwstage is/as gate (check.ww:4677) reuses
* flatvariantidxt and, pre-c3, the widening leaked into ACCEPTANCE
* (cs!=ww) and surfaced the >=2 cgen fatal mid-check. c3 added an
* exact-only mode for that caller. These pin BOTH stages REJECTING
* (cstage's independent gate check.c:2036 already does; wwstage now
* matches it) — NOT a crash for the ambiguity shape. Shared experr
* substring "not a variant" (cstage "X is not a variant of (...)",
* wwstage "is/as: not a variant of operand (X)"). */
{ "isas_chain_reject",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"fn f(v: (void | ali)) i32 = {\n"
" if (v is base) { return 1; };\n"
" return 0;\n"
"};\n"
"export fn main() i32 = { return 0; };\n",
0, 0, K_BUILDERR, "not a variant" },
{ "isas_unrel_reject",
"package main;\n"
"type ta = struct { a: int, b: int };\n"
"type tb = struct { a: int, b: int };\n"
"fn f(v: (void | tb)) i32 = {\n"
" if (v is ta) { return 1; };\n"
" return 0;\n"
"};\n"
"export fn main() i32 = { return 0; };\n",
0, 0, K_BUILDERR, "not a variant" },
{ "isas_amb_reject_notcrash",
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type ali = base;\n"
"type ali2 = ali;\n"
"fn f(v: (ali | ali2)) i32 = {\n"
" if (v is base) { return 1; };\n"
" return 0;\n"
"};\n"
"export fn main() i32 = { return 0; };\n",
0, 0, K_BUILDERR, "not a variant" },
/* ---- rob's obligated mixed prim/alias TWIN: union (int | ai)
* ai=int, source typed aj=int — under all-variants counting both the
* bare `int` variant and `ai` share the int bottom -> the cgen widen
* (full mode) hard-errors (harec nassign>=2 -> NULL). Pinned LOUD
* BOTH stages (the chain-ambiguity path; #95 deviation-2 ratified). */
{ "twin_prim_alias_amb",
"package main;\n"
"type ai = int;\n"
"type aj = int;\n"
"export fn main() i32 = {\n"
" let s: aj = 7;\n"
" let v: (int | ai) = s;\n"
" return 0;\n"
"};\n", 0, 0, K_BUILDERR,
"source alias chain reaches >=2 variants" },
};
/* kb5_v2sE: a CALL whose result is typed as the alias ali, widened into
* (void | ali). cstage's aggregate-return path runs it; wwstage #277 rejects. */
static const char *src =
"package main;\n"
"type base = struct { a: int, b: int };\n"
"type al0 = base;\n"
"type ali = al0;\n"
"fn mk() ali = {\n"
" let s: ali;\n"
" s.a = 4; s.b = 9;\n"
" return s;\n"
"};\n"
"export fn main() i32 = {\n"
" let v: (void | ali) = mk();\n"
" if (!(v is ali)) { return 1; };\n"
" return 0;\n"
"};\n";
static const char *experr = "deferred #277";
/* Build src with `driver`; if expect_err, the build must FAIL with experr on
* stderr. Otherwise build must succeed, then the binary runs and its exit must
* equal `want`. Returns 0 on the expected outcome, 1 otherwise. */
static int
run_driver(const char *driver, const struct row *r, int i, int expect_err,
int want)
check(const char *driver, int expect_err, int want)
{
char tmpdir[96], src[128], outbin[128], errf[128], rmcmd[160];
char cmd[1024];
snprintf(tmpdir, sizeof tmpdir, "/tmp/vc95_%d_d_%d", getpid(), i);
char tmpdir[96], srcp[128], outbin[128], errf[128], rmcmd[160], cmd[1024];
snprintf(tmpdir, sizeof tmpdir, "/tmp/vc277_%d_%d", getpid(), expect_err);
mkdir(tmpdir, 0755);
snprintf(src, sizeof src, "%s/vc95_%d_%d.ww", tmpdir, getpid(), i);
snprintf(outbin, sizeof outbin, "%s/vc95_%d_%d", tmpdir, getpid(), i);
snprintf(srcp, sizeof srcp, "%s/c.ww", tmpdir);
snprintf(outbin, sizeof outbin, "%s/c", tmpdir);
snprintf(errf, sizeof errf, "%s/err", tmpdir);
snprintf(rmcmd, sizeof rmcmd, "rm -rf %s", tmpdir);
FILE *f = fopen(src, "wb");
if (!f) { runwait(rmcmd); return -1; }
fputs(r->src, f);
FILE *f = fopen(srcp, "wb");
if (!f) { runwait(rmcmd); return 1; }
fputs(src, f);
fclose(f);
snprintf(cmd, sizeof cmd,
"timeout 20 %s build -o %s %s >/dev/null 2>%s",
driver, outbin, src, errf);
snprintf(cmd, sizeof cmd, "timeout 20 %s build -o %s %s >/dev/null 2>%s",
driver, outbin, srcp, errf);
int brc = runwait(cmd);
int rc = 0;
if (expect_err) {
int ok = (brc != 0)
&& (r->experr == NULL || errlog_has(errf, r->experr));
if (!ok)
fprintf(stderr, "row[%s]: %s expected loud builderr "
"\"%s\" (brc=%d)\n", r->label, driver,
r->experr ? r->experr : "", brc);
runwait(rmcmd);
return ok ? 0 : 1;
if (brc == 0 || !errlog_has(errf, experr)) {
fprintf(stderr, "callret_bound277: %s expected loud "
"builderr \"%s\" (brc=%d)\n", driver, experr, brc);
rc = 1;
}
} else if (brc != 0) {
fprintf(stderr, "callret_bound277: build via %s failed\n", driver);
rc = 1;
} else {
int got = runwait(outbin);
if (got != want) {
fprintf(stderr, "callret_bound277: %s exit %d, want %d\n",
driver, got, want);
rc = 1;
}
}
if (brc != 0) {
fprintf(stderr, "row[%s]: build via %s failed\n",
r->label, driver);
runwait(rmcmd);
return -1;
}
int got = runwait(outbin);
runwait(rmcmd);
if (got != want) {
fprintf(stderr, "row[%s]: %s exit %d, want %d\n",
r->label, driver, got, want);
return 1;
}
return 0;
}
static int
asm_byte_identical(const char *bin, const struct row *r, int i)
{
char src[96], cs[96], ws[96], cmd[1024];
snprintf(src, sizeof src, "/tmp/vc95_asm_%d_%d.ww", getpid(), i);
snprintf(cs, sizeof cs, "/tmp/vc95_asm_%d_%d_c.s", getpid(), i);
snprintf(ws, sizeof ws, "/tmp/vc95_asm_%d_%d_w.s", getpid(), i);
FILE *f = fopen(src, "wb");
if (!f) return -1;
fputs(r->src, f);
fclose(f);
snprintf(cmd, sizeof cmd, "%s/w6c -o %s %s 2>/dev/null", bin, cs, src);
if (runwait(cmd) != 0) {
fprintf(stderr, "row[%s]: w6c errored\n", r->label);
unlink(src);
return -1;
}
snprintf(cmd, sizeof cmd, "%s/w6c_ww -o %s %s 2>/dev/null",
bin, ws, src);
if (runwait(cmd) != 0) {
fprintf(stderr, "row[%s]: w6c_ww errored\n", r->label);
unlink(src); unlink(cs);
return -1;
}
int rc = slurp_eq(cs, ws);
if (rc != 0)
fprintf(stderr, "row[%s]: cstage vs wwstage asm differs\n",
r->label);
unlink(src); unlink(cs); unlink(ws);
return rc;
}
@@ -532,36 +129,15 @@ main(void)
snprintf(cdrv, sizeof cdrv, "%s/ww", bin);
snprintf(wdrv, sizeof wdrv, "%s/ww_ww", bin);
int n = (int)(sizeof rows / sizeof rows[0]);
int total = 0, fail = 0;
for (int i = 0; i < n; i++) {
total++;
int cs_err = rows[i].kind == K_BUILDERR;
if (run_driver(cdrv, &rows[i], i, cs_err,
rows[i].cswant) != 0) fail++;
}
if (access(wdrv, X_OK) == 0) {
for (int i = 0; i < n; i++) {
total++;
int ww_err = rows[i].kind == K_BUILDERR
|| rows[i].kind == K_RUN_CS_WWERR;
if (run_driver(wdrv, &rows[i], i, ww_err,
rows[i].wwwant) != 0) fail++;
}
for (int i = 0; i < n; i++) {
if (rows[i].kind != K_RUN)
continue;
total++;
if (asm_byte_identical(bin, &rows[i], i) != 0) fail++;
}
}
int fail = 0;
fail += check(cdrv, 0, 0); /* cstage runs, exit 0 */
if (access(wdrv, X_OK) == 0)
fail += check(wdrv, 1, 0); /* wwstage loud-stops #277 */
if (fail) {
fprintf(stderr, "variant_chain_b95: %d/%d checks failed\n",
fail, total);
fprintf(stderr, "variant_chain_b95: %d checks failed\n", fail);
return 1;
}
printf("variant_chain_b95: %d/%d ok\n", total, total);
printf("variant_chain_b95: callret_bound277 pin ok\n");
return 0;
}