test: banner purge + WHY-only comment sweep (rule 8)

Every section banner dies (103 -> 0) across test/lang, the observer
suites, the C carriers, and the five comment-heavy corpus fixtures;
banner provenance (#N cites, carrier numbers, repair-cluster labels)
folded into headers or adjacent WHY comments. Narration deleted; row
provenance, ref cites, divergence pins, and layout contracts kept
(fwd-ref decl-order guards and bootstrap-gate corpus rationale
restored where the sweep over-cut). Comment-only proven: all 3742
wwbuild workdir .s byte-identical before/after; test-commit and
test-byteid (161 lang + 1399 data, 0 pinned-divergent) green.
This commit is contained in:
2026-08-08 21:40:23 +09:00
parent aadc6618f0
commit 83f5956df2
120 changed files with 184 additions and 530 deletions

View File

@@ -49,7 +49,6 @@ fn lifetime() time.duration = {
return (180i64 * (time.second: i64)): time.duration;
};
// Run argv in `dir`, true iff normal exit 0.
fn runok(dir: str, name: str, argv: []str) bool = {
let co: testenv.commandout;
testenv.runcommand(dir, dir, name, argv, lifetime(), &co);
@@ -227,8 +226,6 @@ fn m2positive(pkg: str) void = {
testenv.clean(td);
};
// ---- wwileaf (#11) -----------------------------------------------------
fn leafrow(tag: str, path: str, leaf: str, body: str, want: str) void = {
let td: str = testenv.fresh();
let prod: str = strings.concat(td, "/", tag, ".prod.ww");

View File

@@ -1,4 +1,4 @@
// aggregate_tail_test — in-cap aggregate-receive sub-8 tail materialise (#10).
// In-cap aggregate-receive sub-8 tail materialise (#10).
// An in-cap (<=24B) aggregate-returning CALL received into an INDEXED dest is a
// two-step: (1) materialise the AX/DX/CX return regs into a frame scratch, (2)
// word-copy scratch -> dest. Step 1's sub-8 TAIL stored a single narrow MOV

View File

@@ -1,4 +1,4 @@
// aggret_source_test — aggregate return-by-value from every ADDRESSABLE source
// Aggregate return-by-value from every ADDRESSABLE source
// shape (#272), migrated from test/wcc/949_aggret_source_run.c. The N_RETURN
// aggregate arms gated the source on N_IDENT || N_STRUCTLIT; every OTHER
// aggregate rvalue (array literal, struct/array field N_DOT, array element

View File

@@ -1,4 +1,4 @@
// alias_accept_runonly_test — the cs≠ww .s carve-out split from
// The cs≠ww .s carve-out split from
// alias_accept_test (#5-C3, #7f/#254 value-only runonly home). A bare
// (anonymous-let) struct widened into a 2-level alias variant: the asm
// diverges on 3 pre-existing cglet zero-fill lines (cs XORQ+2 stores, ww none

View File

@@ -1,4 +1,4 @@
// alias_accept_test — #5 alias arc F1: the transitive TY_NAMED chase. cstage
// #5 alias arc F1: the transitive TY_NAMED chase. cstage
// single-peeled the alias at promotion/cond/assign/index/field/arg/union/cast
// consumers, so a 2+-level alias (or one alias over a named aggregate) left the
// type TY_NAMED and fell to a scalar/word0-only/pointer tail — runtime-wrong or
@@ -8,235 +8,186 @@
package alias_accept_test;
// binop_alias_base
type bab_myint = int;
// binop_2level
type b2_myint = int;
type b2_myint2 = b2_myint;
type b2_myu = u32;
// ret_through_2level
type rt_myint = int;
type rt_myint2 = rt_myint;
// assign_alias_alias
type aa_k1 = int;
type aa_k2 = int;
// cond_* family (alias-of-bool)
type cond_myb = bool;
// dot_2level (alias declared before base — forward ref under test)
// alias declared before base — forward ref under test
type dot_a3 = dot_b3;
type dot_b3 = dot_c3;
type dot_c3 = struct { x: size, y: size, z: size };
// deref_alias_ptr
type dp_pi = *int;
type dp_pi2 = dp_pi;
// slicefield_store_2lvl
type sfs_sl = []int;
type sfs_sl2 = sfs_sl;
type sfs_box = struct { s: sfs_sl2, n: int };
// slicefield_range_2lvl
type sfr_sl = []int;
type sfr_sl2 = sfr_sl;
type sfr_box = struct { s: sfr_sl2, n: int };
// strfield_store_2lvl
type sfst_s1t = str;
type sfst_s2t = sfst_s1t;
type sfst_box = struct { s: sfst_s2t, n: int };
// slicefield_structlit_2lvl
type sfsl_sl = []int;
type sfsl_sl2 = sfsl_sl;
type sfsl_box = struct { s: sfsl_sl2, n: int };
// slicefield_viaptr_2lvl
type sfv_sl = []int;
type sfv_sl2 = sfv_sl;
type sfv_box = struct { s: sfv_sl2, n: int };
// slicefield_chainstore_2lvl
type sfc_sl = []int;
type sfc_sl2 = sfc_sl;
type sfc_inner = struct { s: sfc_sl2 };
type sfc_outer = struct { i: sfc_inner };
// slicefield_ptrchain_2lvl
type sfp_sl = []int;
type sfp_sl2 = sfp_sl;
type sfp_inner = struct { s: sfp_sl2, n: int };
type sfp_outer = struct { pi: *sfp_inner };
// slicefield_chainread_2lvl
type sfcr_sl = []int;
type sfcr_sl2 = sfcr_sl;
type sfcr_inner = struct { s: sfcr_sl2 };
type sfcr_outer = struct { i: sfcr_inner };
// slicefield_ptrread_2lvl
type sfpr_sl = []int;
type sfpr_sl2 = sfpr_sl;
type sfpr_box = struct { s: sfpr_sl2, n: int };
// slicefield_wholeread_2lvl
type sfw_sl = []int;
type sfw_sl2 = sfw_sl;
type sfw_box = struct { s: sfw_sl2, n: int };
// slicefield_idx_tripwire_73
type sfi_sl = []int;
type sfi_sl2 = sfi_sl;
type sfi_box = struct { s: sfi_sl2, n: int };
// idx_2level
type idx_arr = [4]int;
type idx_arr2 = idx_arr;
// slice_2level
type sl2_sl = []int;
type sl2_sl2 = sl2_sl;
// range_2level
type rng_arr = [4]int;
type rng_arr2 = rng_arr;
// slice_of_alias_arg
type soa_arr = [4]int;
type soa_arr2 = soa_arr;
// float_alias_param_kenv3 (alias before base — forward ref)
// alias before base — forward ref under test
type fak_fa = fak_fb;
type fak_fb = f64;
// float_alias_param
type fap_f1t = f64;
type fap_f2t = fap_f1t;
// str_alias_2level
type sa2_s1t = str;
type sa2_s2t = sa2_s1t;
// slice_alias_param
type slp_b1 = []int;
type slp_b2 = slp_b1;
// arg_2level_fwdref (alias before base — forward ref)
// alias before base — forward ref under test
type afr_ali = afr_base;
type afr_base = struct { a: size, b: size, c: size };
// arg_2level_litinit
type ali_st = struct { a: size, b: size, c: size };
type ali_row = ali_st;
// arg_2level_5word
type a5_big = struct { a: size, b: size, c: size, d: size, e: size };
type a5_big2 = a5_big;
// arg_2level_floatclass
type afc_fs = struct { x: f64, n: size };
type afc_fs2 = afc_fs;
// arg_base_control
type abc_base = struct { a: size, b: size, c: size };
// union_store_norm
type usn_base = struct { a: size, b: size };
type usn_ali = usn_base;
// union_store_fwd (alias before base — forward ref)
// alias before base — forward ref under test
type usf_ali = usf_base;
type usf_base = struct { a: size, b: size };
// union_store_3word
type us3_base = struct { a: size, b: size, c: size };
type us3_ali = us3_base;
// union_push_arg
type upa_base = struct { a: size, b: size };
type upa_ali = upa_base;
// union_store_base_ctl
type usbc_base = struct { a: size, b: size, c: size };
// union_slit_base_ctl
type uslbc_base = struct { a: size, b: size };
// union_slit_alias
type usla_base = struct { a: size, b: size };
type usla_ali = usla_base;
// union_slit_alias2
type usl2_base = struct { a: size, b: size };
type usl2_ali = usl2_base;
type usl2_ali2 = usl2_ali;
// union_slit_order (alias before base — forward ref)
// alias before base — forward ref under test
type uslo_ali = uslo_base;
type uslo_base = struct { a: size, b: size };
// castprim_3lvl_base
type cp3_s1 = struct { f: u32 };
type cp3_s2 = cp3_s1;
type cp3_s3 = cp3_s2;
// castprim_ptr2lvl_base
type cpp_s1 = struct { f: u32 };
type cpp_s2 = cpp_s1;
// castprim_2lvl_base_ctl
type cp2_s1 = struct { f: u32 };
type cp2_s2 = cp2_s1;
// untyped_tagdst_2lvl_hold
type utd_r1 = (void | size);
type utd_r2 = utd_r1;
// untyped_str2lvl_ctl
type usc_sa1 = str;
type usc_sa2 = usc_sa1;
// untyped_int2lvl_ctl
type uic_ia1 = i64;
type uic_ia2 = uic_ia1;
// untyped_bool1lvl_ctl
type ub1_ba1 = bool;
// untyped_bool2lvl_bound90
type ub2_bb1 = bool;
type ub2_bb2 = ub2_bb1;
// v2_ctrl
type v2c_pc = *i64;
// v2_alias2
type v2a_pa = *i64;
type v2a_pb = v2a_pa;
// sp_alias1
type sp1_inner = (i64 | str);
type sp1_outer = (...sp1_inner | void);
// sp_alias2
type sp2_inner = (i64 | str);
type sp2_inner2 = sp2_inner;
type sp2_outer = (...sp2_inner2 | void);
// rangevar_alias2
type rva_slk = []int;
// nested_alias_field_norm
type nfn_fa = nfn_inner;
type nfn_inner = struct { a: size, b: size };
type nfn_outer = struct { x: nfn_fa, y: nfn_fa };
// nested_alias_field_fwd (outer before fa before inner — forward ref)
// outer before fa before inner — forward ref under test
type nff_outer = struct { x: nff_fa, y: nff_fa };
type nff_fa = nff_inner;
type nff_inner = struct { a: size, b: size };

View File

@@ -1,4 +1,4 @@
// alias_amp_idx_test — `&a[i]` over an ALIAS-typed array base must classify
// `&a[i]` over an ALIAS-typed array base must classify
// arrayness off the CHASED type, not the syntactic tnode, migrated from
// test/wcc/944_alias_amp_idx_run.c (#5 alias arc). cgun's TK_AMP N_INDEX
// classify keyed arrayness off the syntactic tnode (N_TNAME), so `&a[i]` over an

View File

@@ -1,4 +1,4 @@
// alias_cgen_b5_test — #5 alias arc F2b (B5 train): the cstage cgen helper +
// #5 alias arc F2b (B5 train): the cstage cgen helper +
// funnel internalization through type_chase_named (c1), the #73 tripwire
// graduation (c2), the #89 cgreturn return-position widen (c3) and the #93
// deref-index pointee chase (c4). Each was a 2-level (alias-over-alias) or
@@ -16,12 +16,10 @@
package alias_cgen_b5_test;
// --- c1: signed_ctl
type signed_s0 = i8;
type signed_s1 = signed_s0;
type signed_st = struct { f: signed_s1, g: signed_s1 };
// --- c1: targ_2lvl / wpush_2lvl share the (void|i64) 2-lvl alias + matcher.
type targ_u0 = (void | i64);
type targ_u = targ_u0;
fn targ_h(v: targ_u) i32 = {
@@ -31,7 +29,7 @@ fn targ_h(v: targ_u) i32 = {
};
};
// --- c1: tmem_2lvl (>48B MEMORY-class twin)
// >48B MEMORY-class twin of targ_2lvl.
type tmem_big = struct { a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64 };
type tmem_m0 = (void | tmem_big);
type tmem_m = tmem_m0;
@@ -42,18 +40,15 @@ fn tmem_h(v: tmem_m) i32 = {
};
};
// --- c1: wstore_2lvl
type wstore_u0 = (void | i64);
type wstore_u = wstore_u0;
// --- c1: wstore_1lvl
type wstore1_u = (void | i64);
// --- c1: wstore_a_2lvl
type wstorea_u0 = (void | i64);
type wstorea_u = wstorea_u0;
// --- c1: succ_2lvl (`?`-success remap over 2-lvl alias result)
// `?`-success remap over a 2-lvl alias result.
type succ_e0 = !i64;
type succ_r0 = (i64 | succ_e0);
type succ_r = succ_r0;
@@ -66,70 +61,58 @@ fn succ_outer() succ_r = {
return v + 1;
};
// --- c1: null_2lvl
type null_np0 = (*i64 | void);
type null_np = null_np0;
// --- c1: f32p_2lvl
type f32p_in0 = struct { a: f64 };
type f32p_in1 = f32p_in0;
type f32p_pt = struct { x: f32p_in1, y: f64 };
fn f32p_g(p: f32p_pt) f64 = { return p.x.a + p.y; };
// --- c1: tuparg_bound99 / tuparg_cast_bound99 (2-lvl alias tuple param)
type tparg_tp0 = (i64, i64);
type tparg_tp = tparg_tp0;
fn tparg_f(t: tparg_tp) i64 = { return t.0 + t.1; };
// --- c1: tuparg1_bound99 (1-level identical, not alias-depth)
// 1-level control (not alias-depth).
type tparg1_tp = (i64, i64);
fn tparg1_f(t: tparg1_tp) i64 = { return t.0 + t.1; };
// --- c1: tupglobal_bound99 (alias-tuple module-global)
type tpglob_tp0 = (i64, i64);
type tpglob_tp = tpglob_tp0;
let tpglob_G: tpglob_tp = (4, 9);
// --- c2: g73_idxstore
type g73is_sl = []int;
type g73is_sl2 = g73is_sl;
type g73is_box = struct { s: g73is_sl2, n: int };
// --- c2: g73_strfield
type g73sf_s1t = str;
type g73sf_s2t = g73sf_s1t;
type g73sf_box = struct { s: g73sf_s2t, n: int };
fn g73sf_noise(x: int) int = { return x * 7 + 3; };
// --- c2: g73_tagfield
type g73tf_tu0 = (void | i64);
type g73tf_tu = g73tf_tu0;
type g73tf_box = struct { u: g73tf_tu, n: int };
// --- c2: g73_idxread
type g73ir_sl = []int;
type g73ir_sl2 = g73ir_sl;
type g73ir_box = struct { s: g73ir_sl2, n: int };
fn g73ir_noise(x: int) int = { return x * 7 + 3; };
// --- c2: g73_ptrread
type g73pr_sl = []int;
type g73pr_sl2 = g73pr_sl;
type g73pr_inner = struct { s: g73pr_sl2, n: int };
type g73pr_outer = struct { pi: *g73pr_inner };
fn g73pr_noise(x: int) int = { return x * 7 + 3; };
// --- c2: g73_tupread
type g73tr_sl = []int;
type g73tr_sl2 = g73tr_sl;
// --- c2: g73_static_struct (alias-tuple/struct module-global)
type g73ss_in0 = struct { a: i64, b: i64 };
type g73ss_in1 = g73ss_in0;
type g73ss_box = struct { i: g73ss_in1, n: i64 };
let g73ss_g: g73ss_box = g73ss_box { i = g73ss_in0 { a = 4, b = 9 }, n = 5 };
// --- c3: g89_ret_widen
type g89w_base = struct { a: size, b: size };
type g89w_ali = g89w_base;
fn g89w_mk() (void | g89w_ali) = {
@@ -138,7 +121,6 @@ fn g89w_mk() (void | g89w_ali) = {
return x;
};
// --- c3: g89_ret_errunion
type g89e_failure = struct { code: i32, aux: size };
type g89e_myerr = g89e_failure;
fn g89e_work(bad: bool) (i32 | g89e_myerr) = {
@@ -150,7 +132,6 @@ fn g89e_work(bad: bool) (i32 | g89e_myerr) = {
return 42;
};
// --- c3: g89_ret_named_ctl (bare NAMED struct return control)
type g89c_base = struct { a: size, b: size };
fn g89c_make() (void | g89c_base) = {
let x: g89c_base;
@@ -158,20 +139,15 @@ fn g89c_make() (void | g89c_base) = {
return x;
};
// --- c4: g93_l2_local
type g93l_arr = [3]int;
type g93l_arr2 = g93l_arr;
// --- c4: g93_def (def twin over a 2-lvl alias def array)
type g93d_arr0 = [3]i64;
type g93d_arr = g93d_arr0;
def g93d_D: g93d_arr = [18i64, 29i64, 40i64];
// --- c4: g93_1lvl_ctl (1-level pointee control)
type g93c_arr = [3]int;
// ===== c1: helper + funnel internalization =====
@test fn signed_ctl() void = {
let x: signed_st;
x.f = -5;
@@ -264,8 +240,6 @@ type g93c_arr = [3]int;
assert(tpglob_G.0 + tpglob_G.1 == 13);
};
// ===== c2: #73 graduation =====
@test fn g73_idxstore() void = {
let a: [3]int = [700: int, 800: int, 900: int];
let xs: [2]g73is_box;
@@ -334,8 +308,6 @@ type g93c_arr = [3]int;
assert(g73ss_g.i.b == 9);
};
// ===== c3: #89 cgreturn return-position widen =====
@test fn g89_ret_widen() void = {
match (g89w_mk()) {
case let s: g89w_ali => { assert(s.b == 9); };
@@ -358,8 +330,6 @@ type g93c_arr = [3]int;
};
};
// ===== c4: #93 deref-index pointee chase =====
@test fn g93_l2_local() void = {
let a: g93l_arr2 = [1000: int, 2000: int, 3000: int];
let p: *g93l_arr2 = &a;

View File

@@ -1,4 +1,4 @@
// alias_cgen_b6_test — #5 alias arc F2b (B6 train): the cgen.c cgexpr/cgstmt
// #5 alias arc F2b (B6 train): the cgen.c cgexpr/cgstmt
// INLINE single-peel sweep through type_chase_named, by consumer family —
// c1 assign/reassign, c2 call-arg, c3 addr-of/field-walk/index spine,
// c4 cast/is/try, c5 reads/len/globals. Every K_RUN row was a cs-side
@@ -15,8 +15,6 @@
package alias_cgen_b6_test;
// ---- c1: assign/reassign family
type c1sr_ms0 = str;
type c1sr_ms = c1sr_ms0;
@@ -47,8 +45,6 @@ type c1da_st = c1da_st0;
assert(x.b == 9);
};
// ---- c2: call-arg family
type c2fi_fs0 = struct { x: f64 };
type c2fi_fs = c2fi_fs0;
@@ -84,8 +80,6 @@ fn c2st_g(s: c2st_ms) i64 = { return len(s): i64; };
assert(c2st_g(a) == 5);
};
// ---- c3: addr-of/field-walk/index spine
type c3if_el0 = struct { a: i64, b: i64 };
type c3if_el = c3if_el0;
@@ -190,8 +184,6 @@ type c3kc_S2 = struct { arr: [4]c3kc_my16, n: int };
assert(s.n == 9);
};
// ---- c4: cast/is/try family
type c4sc_ms0 = str;
type c4sc_ms = c4sc_ms0;
@@ -223,8 +215,6 @@ type c4is_u = c4is_u0;
assert(!(v is void));
};
// ---- c5: reads/len/globals family
type c5tf_u0 = (void | i64);
type c5tf_u = c5tf_u0;
type c5tf_st0 = struct { f: c5tf_u, n: i64 };

View File

@@ -1,4 +1,4 @@
// alias_decl_order_size_runonly_test — the cs≠ww .s carve-out split from
// The cs≠ww .s carve-out split from
// alias_decl_order_size_test (#5-C3, #7f/#254 value-only runonly home).
// Indexing an alias-NAMED array LOCAL is the task-#60 family: wwstage emits a
// ptr-load/ADDQ spine vs cstage's direct 8(BX) — PRE-EXISTING on master,
@@ -10,11 +10,9 @@
package alias_decl_order_size_runonly_test;
// arrelem_fwd: arr=[2]base declared BEFORE base (forward ref).
type aef_arr = [2]aef_base;
type aef_base = struct { a: size, b: size };
// arrelem_norm: base before arr.
type aen_base = struct { a: size, b: size };
type aen_arr = [2]aen_base;

View File

@@ -1,4 +1,4 @@
// alias_decl_order_size_test — #62 rider (alias arc pre-F1): type-table layout
// #62 rider (alias arc pre-F1): type-table layout
// must be DECL-ORDER-INDEPENDENT, migrated from
// test/wcc/944_alias_decl_order_size_run.c (#5-C3). cstage check_file resolved
// typedecl bodies in file order with an eager under->size copy, so a body
@@ -18,47 +18,38 @@
package alias_decl_order_size_test;
// sizes_norm: base before alias.
type sn_base = struct { a: size, b: size };
type sn_ali = sn_base;
// sizes_fwd: alias BEFORE base (forward ref).
type sf_ali = sf_base;
type sf_base = struct { a: size, b: size };
// union_decl_norm: named u=(void|ali) declared LAST.
type udn_base = struct { a: size, b: size };
type udn_ali = udn_base;
type udn_u = (void | udn_ali);
// union_decl_fwd: named u declared FIRST, then ali, then base.
type udf_u = (void | udf_ali);
type udf_ali = udf_base;
type udf_base = struct { a: size, b: size };
// field_fwd: outer{i,j: inner} declared BEFORE inner.
type ff_outer = struct { i: ff_inner, j: ff_inner };
type ff_inner = struct { a: size, b: size };
// field_norm: inner before outer.
type fn_inner = struct { a: size, b: size };
type fn_outer = struct { i: fn_inner, j: fn_inner };
// chain2_fwd: a2=a1=base full forward chain.
type cf_a2 = cf_a1;
type cf_a1 = cf_base;
type cf_base = struct { a: size, b: size };
// chain2_norm: base, a1, a2 in order.
type cn_base = struct { a: size, b: size };
type cn_a1 = cn_base;
type cn_a2 = cn_a1;
// union_base_ctl: direct base member (m5b_match0 no-regress control).
type ubc_base = struct { a: size, b: size };
// ptr_selfref_ok: legal self-reference (pointer field never reads the
// target's size) must stay accepted — the io.stream / list-node shape.
// legal self-reference (pointer field never reads the target's size) must
// stay accepted — the io.stream / list-node shape.
type node = struct { v: size, next: *node };
@test fn sizes_norm() void = {

View File

@@ -1,4 +1,4 @@
// alias_def_addr_test — address-of a def whose declared type is an ALIAS of
// Address-of a def whose declared type is an ALIAS of
// an array/struct (#5 alias arc F2a, task #88), migrated from
// test/wcc/944_alias_def_addr_run.c. defisaddressable (cgen.ww) keyed the
// array leg on the UNCHASED syntactic dtnode (N_TARRAY), so `&D` where D is a
@@ -20,7 +20,6 @@
package alias_def_addr_test;
// def_ctrl — plain [3]int def, no alias; the always-held control.
def Dctrl: [3]int = [1000: int, 2000: int, 3000: int];
@test fn alias_def_addr_ctrl() void = {

View File

@@ -1,4 +1,4 @@
// alias_emit_b7_test — #5 alias arc B7 (finale): the cgen static-DATA emitter
// #5 alias arc B7 (finale): the cgen static-DATA emitter
// ELEM-type alias chases, migrated from test/wcc/944_alias_emit_b7_run.c
// (#5-C3). The residual single peel was on the ELEMENT type (u->sub), so a
// 2-level-elem-alias global missed the TY_STRUCT / TY_STR kind tests and fell
@@ -25,7 +25,6 @@ type sarr1_el0 = struct { a: i64, b: i64 };
type sarr1_el = sarr1_el0;
let g_sarr1: [2]sarr1_el = [sarr1_el0 { a = 1, b = 2 }, sarr1_el0 { a = 3, b = 4 }];
// sarr_plain_ctl: [2]el0 control.
type sarrc_el0 = struct { a: i64, b: i64 };
let g_sarrc: [2]sarrc_el0 = [sarrc_el0 { a = 1, b = 2 }, sarrc_el0 { a = 3, b = 4 }];
@@ -47,7 +46,6 @@ let g_strarr2: [2]strarr2_ms = ["aa", "bbb"];
type strarr1_ms = str;
let g_strarr1: [2]strarr1_ms = ["aa", "bbb"];
// strarr_plain_ctl: [2]str control.
let g_strarrc: [2]str = ["aa", "bbb"];
// scalararr_2lvl: [3]my64b raw-bytes path — scalar fold never consulted eu,

View File

@@ -1,4 +1,4 @@
// alias_global_decl_test — g-fold (#77 + #78 fused): alias-typed GLOBAL
// g-fold (#77 + #78 fused): alias-typed GLOBAL
// declarations, migrated from test/wcc/944_alias_global_decl_run.c (#5-C3).
// The decl/emit dispatch was alias-blind on both sides: cs (#78) single-peeled
// the let_* helper family so a 2-level alias chain (or one user alias over a

View File

@@ -1,4 +1,4 @@
// alias_idx_family_test — #5 alias arc F2a batch 1 (task #60 + #79 init-store
// #5 alias arc F2a batch 1 (task #60 + #79 init-store
// rider): wwstage INDEX / SLICE / FOR-RANGE / LITERAL-INIT over an alias-NAMED
// base type, migrated from test/wcc/944_alias_idx_family_run.c (#5-C3). The
// tnode-keyed cgen walks saw only the N_TNAME leaf — esz fell to the

View File

@@ -1,4 +1,4 @@
// alias_structlit_init_test — #63: let-init from an alias-NAMED struct
// #63: let-init from an alias-NAMED struct
// LITERAL, migrated from test/wcc/944_alias_structlit_init_run.c (#5-C3).
// wwstage's cglet N_STRUCTLIT arm resolved the struct by a BARE
// structlookup(sname): for an alias `type rep2 = rep` only the base `rep` is

View File

@@ -1,4 +1,4 @@
// alloc_nested_field_test — a nested aggregate field VALUE inside an
// A nested aggregate field VALUE inside an
// alloc(struct-literal) heap init must survive (C7c, task #6). The
// alloc(value) field-fill loop had only float/str/scalar arms; a field
// whose value is itself an N_STRUCTLIT / N_ARRLIT fell to the scalar

View File

@@ -1,4 +1,4 @@
// append_structlit_evalorder_test — #59: an append/insert of a STRUCT-LITERAL
// #59: an append/insert of a STRUCT-LITERAL
// value evaluates the value BEFORE the len-bump (Hare order). Migrated from
// test/wcc/946_append_structlit_evalorder_run.c (value rows; cs==ww byte-id
// rides T2).

View File

@@ -1,4 +1,4 @@
// arr_float_call_index_test — float arr[i]= with X0-clobbering index, migrated
// Float arr[i]= with X0-clobbering index, migrated
// from test/wcc/916_arr_float_call_index_run.c (#5-C4, #125). In the `arr[i] = v`
// ASSIGN path, when the element type is float and the INDEX sub-expression
// clobbers X0 (e.g. a fn-call index), the value was LOST pre-fix: both stages

View File

@@ -1,4 +1,4 @@
// arr_struct_subtail_frame_test — #9: a local `[N]S` where S is a struct with
// #9: a local `[N]S` where S is a struct with
// a sub-8-tail field over-sized its stack FRAME (cs≠ww, gate-visible). The
// wwstage cgen frame reader (slotsize, cgenutil.ww TY_ARRAY arm) summed the
// element's slot-PADDED width (outer.slotsize 24) × N instead of the array's
@@ -43,7 +43,7 @@ type outer = struct { a: u8, p: inner, z: i64 }; // natural 16, align 8 (sub-8 t
assert(arr[1].z == 200i64);
};
@test fn write_tail() void = { // write the sub-8 tail field then read back
@test fn write_tail() void = {
let arr: [2]outer = [
outer { a = 1u8, p = inner { x = 2u8, y = 3u8 }, z = 100i64 },
outer { a = 4u8, p = inner { x = 5u8, y = 6u8 }, z = 200i64 }];

View File

@@ -1,4 +1,4 @@
// arr_u16_store_test — [N]u16/[N]i16 array-literal init stores MOVW per slot.
// [N]u16/[N]i16 array-literal init stores MOVW per slot.
// Migrated from test/wcc/914_arr_u16_store_run.c. Pre-fix a [4]u16 init emitted
// overlapping MOVQ stores (accident-corrected for some values); the fix dispatches
// a proper MOVW per 2-byte slot (op chosen by esz, not signedness). cstage

View File

@@ -1,4 +1,4 @@
// array_static_init_test — module-level 1D/2D/3D array static-init, element
// Module-level 1D/2D/3D array static-init, element
// read. Migrated from test/wcc/919_array_static_init_run.c (#129 Phase A.3,
// #156). emit_array_lit_bytes recurses on a TY_ARRAY element (esz=etype->size,
// rule 13); cgindex leaves the sub-array ADDRESS for an array element so the

View File

@@ -1,4 +1,4 @@
// arraytoslice_test — #258: the implicit [N]T -> []T array-to-slice BORROW at
// #258: the implicit [N]T -> []T array-to-slice BORROW at
// assign / return / call-arg / let init (.ptr = &arr[0], .len = .cap = N).
// Migrated from test/wcc/953_arraytoslice_run.c (value rows; cs==ww byte-id
// rides T2). The element-type-mismatch reject rows stay as runww //ww:error

View File

@@ -1,4 +1,4 @@
// arrlit_elem_narrow_test — #251: narrow int/rune array-literal elements to a
// #251: narrow int/rune array-literal elements to a
// declared [N]T element type at the let / def / struct-field init sites.
// Migrated from test/wcc/951_arrlit_elem_narrow_run.c (accept rows; cs==ww
// byte-id rides T2). The out-of-range and str-elem reject rows stay as runww

View File

@@ -1,4 +1,4 @@
// arrlit_infer_elem_test — #103/#108/#104: an INFERRED let defaults its
// #103/#108/#104: an INFERRED let defaults its
// untyped-int element to `int` (8B machine word), not i32. Migrated from
// test/wcc/813_arrlit_infer_elem_run.c (value rows; cs==ww byte-id rides T2).
//

View File

@@ -1,4 +1,4 @@
// arrlit_slice_test — #25/#31: a one-step array-LITERAL initialiser for a SLICE
// #25/#31: a one-step array-LITERAL initialiser for a SLICE
// local (`let xs: []T = [..]`). Migrated from test/wcc/953_arrlit_slice_run.c
// (value rows; cs==ww byte-id rides T2). Reject rows, including the
// stage-asymmetric assignment diagnostic, live under test/wcc/data/.

View File

@@ -1,4 +1,4 @@
// arrvar_union_slice_test — #17: an array VARIABLE coerced into the SLICE
// #17: an array VARIABLE coerced into the SLICE
// success variant of a tagged union (`let a:[N]i32; ... ([]i32|e)`) silently
// dropped .len/.cap (and .ptr) — a both-stage miscompile the byte-id gate is
// BLIND to (cstage and wwstage agreed and were BOTH wrong).

View File

@@ -1,4 +1,4 @@
// callret_unsigned_test — an unsigned value returned from a CALL must select
// An unsigned value returned from a CALL must select
// the UNSIGNED opcode (DIVQ / SHRQ / JA) on the div / mod / shift / relational
// path, keyed by the callee's RETURN type, migrated from
// test/wcc/906_callret_unsigned_arith_run.c (#168, the N_CALL twin of #134 /

View File

@@ -1,4 +1,4 @@
// chained_dot_struct_copy_test — depth-≥2 chained-DOT struct-field store from a
// Depth-≥2 chained-DOT struct-field store from a
// struct IDENT source (`t.m.l = s;`, lhs.lhs is itself an N_DOT), migrated from
// test/wcc/949_chained_dot_struct_copy_run.c (#107-class sibling). The copy
// length is the field's NATURAL (non-slot-padded) struct size; cstage's tail

View File

@@ -1,4 +1,4 @@
// chainidx_test — a CHAINED index `m[i][k]` whose element is a str/slice must
// A CHAINED index `m[i][k]` whose element is a str/slice must
// load the full 24B/16B header, both stages, migrated from
// test/wcc/989_chainidx_run.c (#22). The chained-index arm in cgindex read
// the element tinfo for esz/signedness but NOT elemisstr/elemisslice, so a

View File

@@ -1,4 +1,4 @@
// composite_call_arg_test — a 3-reg composite (`[]u8` slice) CALL result passed
// A 3-reg composite (`[]u8` slice) CALL result passed
// inline as a composite arg to another call, migrated from
// test/wcc/927_composite_call_arg_run.c (#24, Class A wwstage cgen miscompile).
// Pre-fix wwstage emitted a single `PUSHQ AX` for a slice-returning CALL arg

View File

@@ -1,4 +1,4 @@
// const_slice_aggregate_test — module-level const slice of (str,*fn) tuple rows
// Module-level const slice of (str,*fn) tuple rows
// + scalar &fn globals, DATA emit with element relocations. Migrated from
// test/wcc/946_const_slice_aggregate_run.c (#117/#119). cstage build+run was T1;
// cs==ww .s byte-id rides T2 (test-lang-byteid). The loud non-tuple-aggregate

View File

@@ -1,4 +1,4 @@
// continue_test — #138: `continue` in a loop with a post-step must run the
// #138: `continue` in a loop with a post-step must run the
// post-step BEFORE re-testing the cond/bound. Migrated from
// test/wcc/911_continue_run.c (value rows; cs==ww byte-id rides T2).
//

View File

@@ -1,4 +1,4 @@
// def_amp_idx_test — `&D[i]` over a DEF-array (indexed &-base), migrated from
// `&D[i]` over a DEF-array (indexed &-base), migrated from
// test/wcc/944_def_amp_idx_run.c (#94). BOTH stages SEGV'd at the TK_AMP
// N_INDEX N_IDENT base classify: a def-array base matched neither the local nor
// the let leg and fell to a wrong else — cstage zero-based the addend (XORQ

View File

@@ -1,4 +1,4 @@
// def_float_lit_test — module-level `def`/`let` f64/f32 literal (incl negation)
// Module-level `def`/`let` f64/f32 literal (incl negation)
// emits DATA, read back from a fn. Migrated from test/wcc/917_def_float_lit_run.c
// (#129 Phase A.1). Pre-fix `def K: f64 = lit;` fell through emit_defs's int-only
// fold gate so no DATAW landed (link: `undefined reference to main.K`); emit_lets's

View File

@@ -1,4 +1,4 @@
// defdim_argslice_test — passing a slice of a `def`-dimensioned array
// Passing a slice of a `def`-dimensioned array
// (`take(buf[1:])` on `[MAX]T`) as a call argument must resolve the default-hi
// length from the type table, the N_SLICE arg-push member of the def-dim
// family, migrated from test/wcc/989_defdim_argslice_run.c (#56 c4). pushargsrev's

View File

@@ -1,4 +1,4 @@
// defdim_field_test — `.len` field-read on an array whose dimension is a
// `.len` field-read on an array whose dimension is a
// `def` constant (`[MAX]T`) must resolve the length from the type table, the
// cgdot sibling of the #21 cgslice fix, migrated from
// test/wcc/989_defdim_field_run.c (#56). A `def MAX` dim arrives as a

View File

@@ -1,4 +1,4 @@
// defdim_slice_test — slicing an array whose dimension is a `def` constant
// Slicing an array whose dimension is a `def` constant
// (`[MAX]T`) must resolve the length AND the capacity from the type table, not
// the AST dimension node, migrated from test/wcc/989_defdim_slice_run.c (#21).
// A `def MAX` dim arrives as a non-literal node; wwstage's cgslice default-hi

View File

@@ -1,4 +1,4 @@
// deref_callarg_test — runtime contract for a whole 24B str/slice header
// Runtime contract for a whole 24B str/slice header
// passed BY VALUE as a call argument whose SOURCE is a deref (`f(*h)` with
// h:*str / h:*[]T). #9 (C1c): cgenutil.ww's nodeisslice/nodeisstr had no
// N_UN(TK_STAR) arm, so `*h` fell through to the scalar single-PUSHQ default

View File

@@ -1,4 +1,4 @@
// deref_hdr_test — runtime contract for a whole 24B str/slice header loaded
// Runtime contract for a whole 24B str/slice header loaded
// BY VALUE through a pointer (`let s = *h` where h:*str / h:*[]T). C1b (#4):
// the N_UN TK_STAR deref arm fell through to a scalar MOVQ (AX),AX that loaded
// ONLY word0 (.ptr); .len/.cap were then stored from stale BX/CX, so len(*h)

View File

@@ -1,4 +1,4 @@
// deref_narrow_test — an integer pointer deref (`*p`) must read its pointee's
// An integer pointer deref (`*p`) must read its pointee's
// ACTUAL width, not a fixed 8B MOVQ, migrated from test/wcc/947_deref_narrow_run.c
// (#116). Before #116 the TK_STAR integer arm emitted a raw `MOVQ (AX),AX`
// regardless of pointee size, so `*p` over a packed `*i32`/`*u32`/`*iN` slot

View File

@@ -1,4 +1,4 @@
// deref_slice_store_test — a []T (slice-typed) VALUE stored through a
// A []T (slice-typed) VALUE stored through a
// WHOLE-deref lhs `*p = sliceval` must move the full 24B {ptr,len,cap} header
// (ref/hare/rt/ensure.ha:4-8), not just {ptr}, migrated from
// test/wcc/944_deref_slice_store_run.c (project #79). The `*p = v` deref-store

View File

@@ -2,10 +2,11 @@
// slice of a struct's `[N]T` FIELD (#252), the CHAINED-base close-out (#253),
// the signed-narrow N_DOT-base index load (#255), the call-arg consumption
// axis (#257), the tagged-element store/read/return cluster (#259/#261/#263),
// the aggregate addressable-rhs let-init / arg / return copy axes
// (#265/#268/#271), the array return-by-value ABI (#267), nested-array stride
// + array-of-struct element store + array-literal element store (#270), and
// the aggregate def-global copy (#268). Migrated from
// the aggregate deref-rhs let-init (#265), addressable-rhs let-init and
// def-global copy (#268), and aggregate-arg-from-any-source (#271) axes, the
// array return-by-value ABI (#267), nested-array outer stride (#270-2),
// element store (#270-1) + array-literal element store (#270-1c), and the
// aggregate index-base copy (#270-3a). Migrated from
// test/wcc/949_dotbase_addr_slice_run.c.
//
// The shared root: taking `&x.o[i]` / slicing `x.o[lo:hi]` / indexing a
@@ -28,19 +29,16 @@
package dotbase_addr_slice_test;
// ---- shared element-array struct shapes (field `o`) --------------------
type eu8 = struct { o: [4]u8 };
type ei32 = struct { o: [4]i32 };
type ei16 = struct { o: [4]i16 };
type ei8 = struct { o: [4]i8 };
// ---- chained-base shapes (#253): inner field `m`, pointer-outer ----------
type cinner = struct { m: [4]u8 }; // also the ctrl `e` shape
type couter = struct { p: *cinner };
type cinneri = struct { m: [4]i32 };
type couteri = struct { p: *cinneri };
// ============================ #252 bare-ident ============================
@test fn addr_local_u8() void = {
let x: eu8;
x.o[1] = 66u8;
@@ -112,7 +110,6 @@ fn sl_slice_ptr_u8(x: *eu8) u8 = { let s: []u8 = x.o[1:4]; return s[0]; };
assert(s[1]: i32 == 44i32);
};
// ============================ #253 chained-base ==========================
@test fn chain_ptr_rd() void = {
let a: cinner; a.m[1] = 66u8;
let o: couter; o.p = &a;
@@ -207,7 +204,6 @@ fn rd_ctrl_ptr_rd(p: *cinner) u8 = { return p.m[1]; };
assert(x.m[1]: i32 == 66i32);
};
// ============================ #255 signed-narrow =========================
@test fn nload_i32() void = {
let x: ei32;
x.o[2] = -5;
@@ -229,7 +225,6 @@ fn rd_ctrl_ptr_rd(p: *cinner) u8 = { return p.m[1]; };
assert(v: i32 == -5i32);
};
// ============================ #257 call-arg ==============================
fn rd_callarg_u8(b: []u8) i32 = { return b[0]: i32; };
@test fn callarg_u8() void = {
let x: eu8;
@@ -292,7 +287,6 @@ fn rd_callarg_strfield(s: str) i32 = { return len(s): i32; };
assert(rd_callarg_strfield(q.v[1:4]) == 3i32);
};
// ===================== #259/#261/#263 tagged cluster =====================
type etag = struct { o: [4](i32 | void) };
type etagnull = struct { o: [4](*i32 | void) };
type mtag2d = struct { g: [2][2](i32 | void) };
@@ -498,7 +492,6 @@ fn dot_tagged_dot_ret_ctrl(x: *wtagfield) (i32 | void) = { return x.f; };
assert(r == 63i32);
};
// ===================== #265 aggregate deref-rhs let-init =================
type t16 = struct { h: [4]u32 };
type t32 = struct { h: [8]u32 };
@@ -552,7 +545,6 @@ type t32 = struct { h: [8]u32 };
+c[6]+c[7]+c[8]+c[9]+c[10]): i32 == 66i32);
};
// ===================== #268 addressable-rhs let-init copy ================
@test fn ai_array16() void = {
let s: [4]u32;
s[0]=11u32; s[1]=22u32; s[2]=33u32; s[3]=44u32;
@@ -647,7 +639,6 @@ def Gsd: gT = gT { a = 10u32, b = 20u32, c = 30u32, d = 40u32 };
assert((c.a+c.b+c.c+c.d): i32 == 100i32);
};
// ===================== #267 array return-by-value ABI ====================
fn mk_ret_arr_u32_8() [2]u32 = { let a: [2]u32; a[0]=3u32; a[1]=4u32; return a; };
@test fn ret_arr_u32_8() void = {
let c = mk_ret_arr_u32_8();
@@ -717,7 +708,6 @@ fn mk_ctrl_struct_ret() sret3 = { let s: sret3; s.a=1u32;s.b=2u32;s.c=3u32; retu
assert((v.a+v.b+v.c): i32 == 6i32);
};
// ===================== #270-2 nested-array outer stride ==================
@test fn nest2d_u32() void = {
let a: [2][3]u32;
a[0][1] = 11u32;
@@ -741,7 +731,6 @@ fn mk_ctrl_struct_ret() sret3 = { let s: sret3; s.a=1u32;s.b=2u32;s.c=3u32; retu
assert((a[1][1] - a[0][1]): i32 == 48i32);
};
// ===================== #270-1 element store axes =========================
type efinner = struct { m: [4]u32 };
@test fn elemfield_store() void = {
let a: [3]efinner;
@@ -765,7 +754,6 @@ type efinner = struct { m: [4]u32 };
assert((arr[1][0]+arr[1][1]+arr[1][2]+arr[1][3]): i32 == 10i32);
};
// ===================== #270-3a aggregate index-base copy =================
type boxprim = struct { arr: [2][4]u32 };
@test fn letcopy_dot_prim() void = {
let s: [4]u32; s[0]=1u32; s[1]=2u32; s[2]=3u32; s[3]=4u32;
@@ -790,7 +778,6 @@ type boxprim = struct { arr: [2][4]u32 };
assert((c[0] + c[1] + c[2]): i32 == 18i32);
};
// ===================== #270-1c array-literal element store ===============
type inner2 = struct { a: u32, b: u32 };
@test fn arrlit_structlit() void = {
let x: [2]inner2 = [inner2{a=1u32,b=2u32}, inner2{a=3u32,b=4u32}];
@@ -804,7 +791,6 @@ type inner2 = struct { a: u32, b: u32 };
assert((x[0].a + x[0].b + x[1].a + x[1].b): i32 == 18i32);
};
// ===================== #271 aggregate ARG from any source ================
type argt16 = struct { x: i64, y: i64 };
type argo16 = struct { f: argt16 };

View File

@@ -24,7 +24,6 @@ type S = struct { f: f32 };
fn ca(a: f32) f32 = { return a; };
// --- binop ×4 (exact) + operand-order ---
@test fn binop_mul() void = {
let x: f32 = 2.0f32;
assert(x * 3.0 == 6.0f32);
@@ -46,8 +45,8 @@ fn ca(a: f32) f32 = { return a; };
assert(3.0 * x == 6.0f32);
};
// --- compare ×6 (exact); the !=, >, >= rows assert a FALSE result (their
// pre-fix low-32 garbage flips it true), so they need the negation. ---
// the cmp_ne/cmp_gt/cmp_ge rows assert a FALSE result (their pre-fix low-32
// garbage flips it true), so they need the negation.
@test fn cmp_eq() void = {
let y: f32 = 4.0f32;
assert(y == 4.0);
@@ -73,53 +72,47 @@ fn ca(a: f32) f32 = { return a; };
assert(!(y >= 5.0));
};
// --- unary neg (exact) ---
@test fn unary_neg() void = {
let z: f32 = -2.0;
assert(z == -2.0f32);
};
// --- assign rhs (witness) ---
@test fn assign_rhs() void = {
let w: f32 = 0.0f32;
w = 0.1;
assert(w == 0.1f32);
};
// --- param-typed call-arg (witness) ---
@test fn call_arg() void = {
assert(ca(0.1) == 0.1f32);
};
// --- struct-field init (witness) ---
@test fn struct_field() void = {
let s: S = S { f = 1.3 };
assert(s.f == 1.3f32);
};
// --- array element (witness, multi-leaf: each untyped leaf coerces alone) ---
// multi-leaf: each untyped leaf coerces alone.
@test fn array_elem() void = {
let a: [2]f32 = [0.1, 0.2];
assert(a[0] == 0.1f32);
assert(a[1] == 0.2f32);
};
// --- let-store (witness) ---
@test fn let_store() void = {
let v: f32 = 1.3;
assert(v == 1.3f32);
};
// --- literal-on-BOTH-sides under an f32 target (exact, must-green): the
// recursion narrows per-leaf AND stamps the binop result f32, so it computes
// 5.0f directly (no f64 intermediate). reddens with garbage if either half
// of the narrow fails. ---
// literal-on-BOTH-sides under an f32 target: the recursion narrows per-leaf
// AND stamps the binop result f32, so it computes 5.0f directly (no f64
// intermediate); reddens with garbage if either half of the narrow fails.
@test fn both_sides() void = {
let q: f32 = 2.0 + 3.0;
assert(q == 5.0f32);
};
// --- CONTROL rows: green pre AND post-fix (no regression / no over-stamp). ---
// the ctrl_ rows are green pre AND post-fix no regression, no over-stamp.
@test fn ctrl_suffixed() void = {
let s: f32 = 0.1f32;
assert(s == 0.1f32);

View File

@@ -1,7 +1,7 @@
// globtagreassign_test — reassigning a module-GLOBAL tagged-union stores the
// full box at g(SB), not just the tag word. Migrated from
// test/wcc/989_globtagreassign_run.c (K_RUN value rows, cs==ww). Globals kept
// at module scope; each @test reassigns then matches.
// at module scope so the store fires the g(SB) path.
package globtagreassign_test;

View File

@@ -44,7 +44,6 @@ fn pa_mix(v: *[4]u64) void = {
};
fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
// A: read.
@test fn rd_u64_param_const() void = {
let a: [4]u64 = [100u64, 101u64, 102u64, 103u64];
assert(pa_rd64c(&a) == 101u64);
@@ -73,7 +72,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(pa_rd32s(&a) == -5i32);
};
// A: write.
@test fn wr_u64_param_const() void = {
let a: [4]u64 = [1u64, 2u64, 3u64, 4u64];
pa_wr64c(&a);
@@ -105,7 +103,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(a[3] == 4u8);
};
// A: compound.
@test fn compound_u64() void = {
let a: [4]u64 = [100u64, 101u64, 102u64, 103u64];
pa_add5(&a);
@@ -129,7 +126,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(p[2] == 102u64);
};
// A: cast base.
@test fn rd_castbase() void = {
let big: [4]u64 = [5u64, 6u64, 7u64, 8u64];
let p: *[4]u64 = (&big): *[4]u64;
@@ -190,7 +186,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(v[3] == 11u64);
};
// C: (*p)[i] read.
@test fn deref_rd_u64() void = {
let a: [4]u64 = [100u64, 101u64, 102u64, 103u64];
let p: *[4]u64 = &a;
@@ -209,7 +204,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(pa_deref_rd(&a) == 101u64);
};
// C: (*p)[i] write.
@test fn deref_wr_u64() void = {
let a: [4]u64 = [1u64, 2u64, 3u64, 4u64];
let p: *[4]u64 = &a;
@@ -228,7 +222,6 @@ fn pa_deref_rd(p: *[4]u64) u64 = { return (*p)[1]; };
assert(a[2] == 3u8);
};
// C: (*p)[i] compound.
@test fn deref_compound_u64() void = {
let a: [4]u64 = [100u64, 101u64, 102u64, 103u64];
let p: *[4]u64 = &a;

View File

@@ -30,42 +30,36 @@ fn ner_const(p: str) bool = { return p != csep; };
fn eql_const(p: str) bool = { return csep == p; };
fn eql_long(p: str) bool = { return longsep == p; };
// Shape 1 — rhs const-global ==.
@test fn rhs_const_eq() void = {
assert(eqr_const("/") == true);
assert(eqr_const("foo") == false);
assert(eqr_const("/usr") == false);
};
// Shape 2 — rhs let-global ==.
@test fn rhs_let_eq() void = {
assert(eqr_let("/") == true);
assert(eqr_let("foo") == false);
assert(eqr_let("/usr") == false);
};
// Shape 3 — lhs const-global ==.
@test fn lhs_const_eq() void = {
assert(eql_const("/") == true);
assert(eql_const("foo") == false);
assert(eql_const("/usr") == false);
};
// Shape 4 — rhs const-global != (negation arm).
@test fn rhs_const_ne() void = {
assert(ner_const("/") == false);
assert(ner_const("foo") == true);
assert(ner_const("/usr") == true);
};
// Shape 5 — rhs len>1 const-global == (LEN word read off name(SB)).
@test fn rhs_long_eq() void = {
assert(eqr_long("/") == false);
assert(eqr_long("foo") == false);
assert(eqr_long("/usr") == true);
};
// Shape 6 — lhs len>1 const-global == (LEN word, lhs sub-site).
@test fn lhs_long_eq() void = {
assert(eql_long("/") == false);
assert(eql_long("foo") == false);

View File

@@ -1,4 +1,4 @@
// struct_composite_init_test — module-level `let`/`def` composite-struct
// Module-level `let`/`def` composite-struct
// static-init, field read. Migrated from test/wcc/918_struct_composite_init_run.c
// (#129 Phase A.2). Pre-fix emit_lets/emit_defs skipped struct-typed decls
// (link: `undefined reference to main.NAME`) and a struct def read MOVSXD'd

View File

@@ -1,4 +1,4 @@
// struct_unwrap_test — #12: an aggregate (struct) success-variant unwrap
// #12: an aggregate (struct) success-variant unwrap
// `(S|e)!` / `r?` dropped payload words (SILENT, both stages, byte-id-BLIND).
// A struct success variant rides the in-cap {AX=w0,DX=w1,CX=w2} GP ABI — a
// DIFFERENT shuffle from #6's str/slice {ptr,len,cap} header. Two layers:

View File

@@ -1,4 +1,4 @@
// structcopytail_test — whole-struct field-copy ragged tail (#73, #263 both
// Whole-struct field-copy ragged tail (#73, #263 both
// stages), migrated from test/wcc/989_structcopytail_run.c. A `x.i = o` copy of
// a struct whose NATURAL size is not 8-aligned must move exactly that many bytes
// via a descending-greedy 8->4->2->1 tail (MOVL/MOVW/MOVB), NOT round up to an

View File

@@ -1,4 +1,4 @@
// structlit_arrfield_test — struct array-field init + read (global let/def and
// Struct array-field init + read (global let/def and
// local lit). Migrated from test/wcc/949_structlit_arrfield_run.c (#249). BUG B:
// reading a [4]u8 field of a module-global struct SEGFAULTed on wwstage; BUG A:
// a local struct-lit array field fell to the scalar tail and dropped every

View File

@@ -1,4 +1,4 @@
// subslice_cap_test — a sub-slice `base[lo:hi]` must set its capacity word to
// A sub-slice `base[lo:hi]` must set its capacity word to
// base_cap - lo (storage remaining to the underlying end; Go/Hare-identical),
// NOT hi - lo (the new length), migrated from test/wcc/942_subslice_cap_run.c
// (task #20). base_cap is the array length N for [N]T, or the carried .capacity

View File

@@ -1,4 +1,4 @@
// subslice_ptresz_test — a sub-slice `base[lo:hi]` must advance its DATA
// A sub-slice `base[lo:hi]` must advance its DATA
// pointer by lo*esz (BYTES), not by lo (element COUNT), migrated from
// test/wcc/943_subslice_ptresz_run.c (project #76). The rt invariant is
// membsz-unit pointer arithmetic (ref/hare/rt/ensure.ha:30). For esz==1 (u8/str)

View File

@@ -1,4 +1,4 @@
// tagged_call_arg_test — #21: passing a tagged-union arg sourced from a fn call
// #21: passing a tagged-union arg sourced from a fn call
// that returns the same tagged union must not drop the DX/CX/R8 payload words.
// Pins CALL-source (4-variant + 2-variant) and the IDENT-source fast-path that
// must stay byte-identical, plus a tagged-CALL-then-scalar pop-count row.

View File

@@ -1,4 +1,4 @@
// tagged_structlit_payload_test — #23/#33/#38a: constructing a tagged union from
// #23/#33/#38a: constructing a tagged union from
// an inline struct literal whose fields are themselves tagged (void|size) /
// (void|str) must fill the payload at the WIDENED slot's payload base, copy every
// payload word (not just AX), and read/assign tagged leaves down a dot-spine.

View File

@@ -1,4 +1,4 @@
// tagged_tuple_widen_test — #66 (fold-4 prereq): the cast-wrapped tuple literal
// #66 (fold-4 prereq): the cast-wrapped tuple literal
// `((a, b): variant_alias)` widened into a tagged-union payload. Pre-#66 the
// #242 tuple arm of the widen choke-point (cg_widen_tagged_store /
// cgwidentaggedstorebp) gated on a BARE N_TUPLE source; the cast-to-CONCRETE-

View File

@@ -1,4 +1,4 @@
// tagged_widen_arg_test — a narrower tagged source (ident/deref/index/dot) passed
// A narrower tagged source (ident/deref/index/dot) passed
// into a wider tagged param must widen + tag-remap so the callee reads the right
// arm. The aligned set keeps i64 at tag0 in both; the remap set has i64 at tag1
// in the source (un16b) but tag0 in the param (un3b), forcing the remap.

View File

@@ -1,4 +1,4 @@
// taggedarg_callresult_test — a tagged-union call RESULT passed
// A tagged-union call RESULT passed
// directly as a call ARGUMENT rides the register cursor (PUSHQ AX/DX
// pairs), classified by the STAMPED result type (taggedcallslot); the
// old callee-name gate dropped fn-pointer and cross-module callees to

View File

@@ -1,4 +1,4 @@
// taggedderefstore_test — #17 teeth: `*p = v` into a tagged-union pointee must
// #17 teeth: `*p = v` into a tagged-union pointee must
// store the full box (route through the widener + scratch word-copy), not a
// single tag-word store. Was both-stage-wrong AND byte-id-green (#263-class),
// now CLOSED both stages. Migrated from test/wcc/989_taggedderefstore_run.c

View File

@@ -1,4 +1,4 @@
// taggedglobalindex_test — #16 teeth: `gs[i] = v` into a global tagged array
// #16 teeth: `gs[i] = v` into a global tagged array
// must use the global base g(SB) and store the full box. Migrated from
// test/wcc/989_taggedglobalindex_run.c (value rows; loc_ctl/scalar_ctl pin the
// frame-base and scalar-array control arms stay unperturbed). Globals kept at

View File

@@ -1,4 +1,4 @@
// taggedidx_test — #23: a tagged element off a non-ident base (slice `arr[1:][0]`,
// #23: a tagged element off a non-ident base (slice `arr[1:][0]`,
// call `getrows()[1]`) must load the full cursor, not just the tag word. The
// N_IDENT base control already worked and must not regress. Migrated from
// test/wcc/989_taggedidx_run.c (value rows).

View File

@@ -1,4 +1,4 @@
// tagnorm_test — tagged-union normalization: nullable folds to an 8B ptr slot;
// Tagged-union normalization: nullable folds to an 8B ptr slot;
// `never` drops; duplicate variants dedup; size/align ride the normalized chain;
// and a bare `return;` void tag comes off the NORMALIZED (deduped) variant index
// at positions 0/1/2. dedup_match pins that a deduped (i32|i32|str) constructs +

View File

@@ -1,4 +1,4 @@
// tagtupfieldsize_test — #53 (sibling of #43): a for-range destructure over an
// #53 (sibling of #43): a for-range destructure over an
// array of tuples whose field is a TAGGED UNION must stride by the tuple's true
// size and copy the field's full box (tag + payload), not the 8B scalar
// default. Migrated from test/wcc/989_tagtupfieldsize_run.c.

View File

@@ -1,4 +1,4 @@
// try_str_unwrap_test — the `!` unwrap of a str-success tagged union must
// The `!` unwrap of a str-success tagged union must
// shuffle the str header (DX,CX,R8) → (AX,BX,CX) for ANY operand shape and ANY
// variant order, keyed off the STAMPED operand type, migrated from
// test/wcc/989_trystr_run.c (#16). The wwstage cgtryprop/cgtryunw computed

View File

@@ -1,4 +1,4 @@
// tryprop_tag_remap_test — the `?` try-operator must remap variant tags when the
// The `?` try-operator must remap variant tags when the
// propagated error union's variant ORDER differs between callee and caller
// ((i32|e1|e2) propagated through (i32|e2|e1)), and pass multiword (str) error
// payloads intact. Migrated from test/wcc/925_tryprop_tag_remap_run.c (value rows).

View File

@@ -1,4 +1,4 @@
// tupfieldsize_test — F7-c4 (#43) + #40: a for-range destructure over an array
// F7-c4 (#43) + #40: a for-range destructure over an array
// of tuples must stride by the tuple's TRUE size, and a slice/str/nested-tuple
// FIELD carries its full 24B width, not the 8B scalar default; the destructure
// LOAD-into-binding must copy the full extent of a sz>8 aggregate binding (the

View File

@@ -1,4 +1,4 @@
// tuple_elem_slice_len_test — `len(t.N)` where t is a tuple and t.N is a
// `len(t.N)` where t is a tuple and t.N is a
// slice/str-typed element, migrated from test/wcc/903_tuple_elem_slice_len_run.c
// (#235). The len() builtin special-cased only a PLAIN N_IDENT slice operand
// and an array operand; every other shape fell back to a bare `cgexpr(operand)`,

View File

@@ -1,4 +1,4 @@
// tuple_in_union_test — project #242: a mixed-scalar tuple wrapped in a tagged
// Project #242: a mixed-scalar tuple wrapped in a tagged
// union must construct, match-bind, and destructure identically in both stages
// and round-trip every element. Migrated from test/wcc/940_tuple_in_union_run.c
// (K_RUN value rows). Three silent gate-blind cs!=ww divergences were met:

View File

@@ -1,4 +1,4 @@
// tuple_index_read_test — #121: const-slice tuple-element READ. Migrated from
// #121: const-slice tuple-element READ. Migrated from
// test/wcc/947_tuple_index_read_run.c.
//
// Three legs of indexed-tuple read off a `const [](str,*fn)` (fold-6's

View File

@@ -1,4 +1,4 @@
// tuple_lit_declblind_test — #64 + #68: a tuple LITERAL fills the register
// #64 + #68: a tuple LITERAL fills the register
// cursor DECL-BLIND. The #57 decl wire (a declared-tagged element's concrete
// rvalue widens into its box) stopped at N_LET / N_RETURN; the other two
// tuple-literal consumers — destructure-REASSIGN (N_MASSIGN, #64) and CALL-ARG

View File

@@ -1,4 +1,4 @@
// tuple_nary_destructure_test — project #83: the general N-ary tuple-
// Project #83: the general N-ary tuple-
// destructure per-element register-return. The send (N_RETURN) and receive
// (N_MLET / N_MASSIGN) sites previously gated the 3-word {ptr,len,cap} store
// on a str-only XOR (e0_is_str ^ e1_is_str), which admitted EXACTLY ONE str

View File

@@ -1,4 +1,4 @@
// tuple_slot_layout_test — tuple arc layout SSoT (user-ratified): the tuple
// Tuple arc layout SSoT (user-ratified): the tuple
// SLOT layout (str/slice = 24B header, everything else one 8B eightbyte;
// tagged = roundup8(size(elem))) is the single source of truth the checker
// size, the cgen cursor transports, and the t.N read walk all agree on.

View File

@@ -1,4 +1,4 @@
// tuple_sret_receive_test — wide tuple-return / sret RECEIVE side (#10 Fold B),
// Wide tuple-return / sret RECEIVE side (#10 Fold B),
// migrated from test/wcc/799_tuple_sret_receive_run.c. A fn returning a tuple
// over the 4-GP cap (`([]u8, []u8)` = 6 GP eightbytes) sret's into the caller's
// dest; each receive form must lay the elements out at the SAME packed offset

View File

@@ -1,4 +1,4 @@
// tuple_tagged_union_test — project #47 gap-A/gap-B: a tuple whose elements
// Project #47 gap-A/gap-B: a tuple whose elements
// include a TAGGED union, boxed as a member of a tagged union, must CONSTRUCT
// + RETURN-STORE identically in both stages. Migrated from
// test/wcc/944_tuple_tagged_union_run.c.

View File

@@ -1,4 +1,4 @@
// tupparam_test — runtime contract for #163, the tuple-PARAM ABI (the param
// Runtime contract for #163, the tuple-PARAM ABI (the param
// twin of #164's tuple RETURN). Migrated from test/wcc/905_tupparam_run.c.
// A tuple passed AS AN ARGUMENT was unhandled in both stages: a tuple-typed
// call result left its elements in the return-ABI cursor and the SEND fell to

View File

@@ -1,4 +1,4 @@
// tuprecv_f64_test — f64 SysV SSE-cursor tuple receive, migrated from
// f64 SysV SSE-cursor tuple receive, migrated from
// test/wcc/956_tuprecv_f64_run.c (#5-C4, #105 + #164/#107 + #10). A tuple-from-
// call receive (single-var 16B/32B, destructure, reassign) must spill each
// element CLASS-AWARE: an f64/f32 word `MOVSD/MOVSS X0, slot`, an integer word

View File

@@ -1,4 +1,4 @@
// tuprecv_test — runtime + byte-id net for #102: the 16B whole-tuple-from-call
// Runtime + byte-id net for #102: the 16B whole-tuple-from-call
// receive (`let t = mk()`, then field reads t.0 / t.1). Migrated from
// test/wcc/954_tuprecv_run.c.
//

View File

@@ -1,4 +1,4 @@
// type_value_shadow_test — #225: a value binding that shadows a same-named TYPE
// #225: a value binding that shadows a same-named TYPE
// must NOT hide that type in type-annotation or cast position. ww keeps type and
// value namespaces separate. Migrated from test/wcc/788_type_value_shadow_run.c
// (value rows; cs==ww byte-id rides T2). The value-in-type-position reject and

View File

@@ -1,4 +1,4 @@
// uniesc_test — in-language behavior rows for \u / \U / \x escapes,
// In-language behavior rows for \u / \U / \x escapes,
// migrated from the retired 110_uniesc_run carrier (task #12
// proof-of-path; its .wwi round-trip half now lives in
// test/tool/wwirune_test.ww). The

View File

@@ -1,4 +1,4 @@
// union_subtail_bp_test — #15: a union-return struct-lit fill stored every
// #15: a union-return struct-lit fill stored every
// scalar field with MOVQ except the explicit {1→MOVB, 4→MOVL} arms, so a
// 2-byte (i16/u16) field fell through to an 8-byte MOVQ. For the LAST field at
// the frame edge this over-store ran past the slot into saved [BP]: a

View File

@@ -1,4 +1,4 @@
// unwrap_callarg_slice_test — runtime contract for a whole 24B slice header
// Runtime contract for a whole 24B slice header
// produced by an UNWRAP source (`mk_sl()!` N_TRYUNW). #6 (Mechanism B, the
// deep root, BOTH stages, byte-id-BLIND): the unwrap success-shuffle
// materialised {ptr,len,cap}→{AX,BX,CX} ONLY when the success variant was

View File

@@ -1,4 +1,4 @@
// unwrap_callarg_str_test — runtime contract for a whole 24B str header
// Runtime contract for a whole 24B str header
// produced by an UNWRAP source (`mk_se()!` N_TRYUNW) passed BY VALUE as a
// call argument. #6 (Mechanism A): cgenutil.ww's nodeisstr had no
// N_TRYUNW/N_TRYPROP arm, so the unwrap fell through to the scalar

View File

@@ -1,4 +1,4 @@
// valstruct_subsize_test — sub-8 nested value-struct zero-init extent, local +
// Sub-8 nested value-struct zero-init extent, local +
// global, distinct byte asserts. Migrated from
// test/wcc/949_valstruct_subsize_run.c. A nested {[N]u8} value-struct of ABI
// size 1/2/4 once emitted a stray MOVQ $0 (local) / 8 zero DATA bytes (global)

View File

@@ -1,4 +1,4 @@
// variant_chain_b95_runonly_test — the two #95 CALL-source chain rows whose mk()
// The two #95 CALL-source chain rows whose mk()
// frame carries the pre-existing #81 uninit-local zero-fill asm divergence: the
// `is` result is cs==ww runtime-correct, but the surrounding frame byte-diverges
// cs≠ww (probed at HEAD: real, both standalone and @test forms). So these migrate

View File

@@ -1,4 +1,4 @@
// variant_chain_b95_test — #95: widening a source whose TYPE reaches a union
// #95: widening a source whose TYPE reaches a union
// variant through an alias CHAIN (or by structural fallback) must tag the right
// variant. Pins 1/2/deep-level chain membership, exact-precedence (ali|ali2),
// nominal (str|linerr) regression, bare-pointer source, and unrelated-struct

View File

@@ -1,4 +1,4 @@
// variant_typekey_test — nominal-type-key variant discrimination. A call-
// Nominal-type-key variant discrimination. A call-
// returned value with no surface name (str or i32) widened into (alias | base)
// must tag the structural (base) variant, not the leading alias. Both the str
// axis ((linerr|str), linerr=!str) and the scalar axis ((ec|i32), ec=!i32).

View File

@@ -1,4 +1,4 @@
// void_error_singleton_test — a `!void` error singleton (tag-only) across
// A `!void` error singleton (tag-only) across
// return / let-init / assign / call-arg positions, plus a wide (str) success
// payload exercising CX/R8 zeroing on the tag-only return. Migrated from
// test/wcc/949_void_error_singleton_run.c (value rows; C driver asserted cs==ww .s).

View File

@@ -1,4 +1,4 @@
// widen_pad_test — widening a NARROW scalar/float value into a tagged-union
// Widening a NARROW scalar/float value into a tagged-union
// slot whose payload is WIDER than one word must ZERO the high pad words
// (slot+16, slot+24), not leave them at whatever the frame slot last held,
// migrated from test/wcc/793_widen_pad_zero_run.c (#227). cg_widen_tagged_store

View File

@@ -45,7 +45,6 @@ fn selfcheck() void = {
"asserttyped"));
};
// w6c_ww -o /dev/null <src>: rc 0 and stderr free of asserttyped.
fn stampprobe(label: str, srcpath: str) void = {
let td: str = testenv.fresh();
let av: []str = [testenv.driver("w6c_ww"), "-o", "/dev/null",

View File

@@ -70,8 +70,6 @@ fn compile(td: str, stem: str, body: str) void = {
};
};
// ---- selectivity (610) -------------------------------------------------
@test fn selectivity() void = {
let td: str = testenv.fresh();
compile(td, "lib_good", strings.concat("package main;\n",
@@ -112,8 +110,6 @@ fn compile(td: str, stem: str, body: str) void = {
testenv.clean(td);
};
// ---- manyflags (632) ---------------------------------------------------
fn linkwith(td: str, lnk: str, n: i32) void = {
let tag: str = strings.concat(lnk, "_", dec(n));
let exe: str = strings.concat(td, "/x_", tag);

View File

@@ -52,8 +52,6 @@ fn assemble(td: str, tool: str, tag: str, src: str, obj: str) i32 = {
return runcode(td, tag, av);
};
// ---- parsenum (530) ----------------------------------------------------
@test fn parsenum() void = {
let td: str = testenv.fresh();
let labels: []str = ["ws_after_dollar", "leading_zero",
@@ -108,8 +106,6 @@ fn assemble(td: str, tool: str, tag: str, src: str, obj: str) i32 = {
testenv.clean(td);
};
// ---- datargate (989) ---------------------------------------------------
@test fn datargate() void = {
let td: str = testenv.fresh();
let bads: str = strings.concat(td, "/bad.s");

View File

@@ -147,8 +147,6 @@ fn iself64(o: str) bool = {
&& o[3] == 0x46u8 && o[4] == 2u8;
};
// ---- elf64header (500) -------------------------------------------------
@test fn elf64header() void = {
let td: str = testenv.fresh();
let programs: []str = [
@@ -184,8 +182,6 @@ fn iself64(o: str) bool = {
testenv.clean(td);
};
// ---- dataw (510) -------------------------------------------------------
@test fn dataw() void = {
let td: str = testenv.fresh();
let src: str = strings.concat(td, "/dataw.s");
@@ -246,8 +242,6 @@ fn iself64(o: str) bool = {
testenv.clean(td);
};
// ---- nodataw (510) -----------------------------------------------------
@test fn nodataw() void = {
let td: str = testenv.fresh();
let src: str = strings.concat(td, "/nodataw.s");
@@ -272,8 +266,6 @@ fn iself64(o: str) bool = {
testenv.clean(td);
};
// ---- datar (520) -------------------------------------------------------
@test fn datar() void = {
let td: str = testenv.fresh();
let src: str = strings.concat(td, "/datar.s");

View File

@@ -8,9 +8,9 @@ package link_test;
// proxy for staticness is replaced by a direct scan of every program
// header asserting no PT_INTERP.
//
// readglobal / writeglobal (620) — a DATAW global is readable (exit
// 42) and the R+W mapping truly writable (store 99, read back, exit
// 99).
// readglobal / writeglobal (620 test_read / test_write) — a DATAW
// global is readable (exit 42) and the R+W mapping truly writable
// (store 99, read back, exit 99).
//
// twoloads (620) — a DATAW input links to exactly 2 program headers,
// both PT_LOAD, exactly one R+X and one R+W (exact p_flags equality;
@@ -73,7 +73,6 @@ fn iself64(o: str) bool = {
&& o[3] == 0x46u8 && o[4] == 2u8;
};
// assemble+link a hand-written .s; returns the exe path.
fn build(td: str, tag: str, body: str) str = {
let src: str = strings.concat(td, "/", tag, ".s");
let obj: str = strings.concat(td, "/", tag, ".o");
@@ -95,8 +94,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
return runcode(td, strings.concat("run_", tag), rav);
};
// ---- staticexec (600) --------------------------------------------------
@test fn staticexec() void = {
let td: str = testenv.fresh();
let src: str = strings.concat(td, "/m.ww");
@@ -129,8 +126,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
testenv.clean(td);
};
// ---- readglobal (620 test_read) ----------------------------------------
@test fn readglobal() void = {
let td: str = testenv.fresh();
let exe: str = build(td, "rd", strings.concat(
@@ -145,8 +140,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
testenv.clean(td);
};
// ---- writeglobal (620 test_write) --------------------------------------
@test fn writeglobal() void = {
let td: str = testenv.fresh();
let exe: str = build(td, "wr", strings.concat(
@@ -163,8 +156,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
testenv.clean(td);
};
// ---- twoloads (620 test_two_loads) -------------------------------------
@test fn twoloads() void = {
let td: str = testenv.fresh();
let exe: str = build(td, "tl", strings.concat(
@@ -197,8 +188,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
testenv.clean(td);
};
// ---- nodatasingleload (620 test_no_data_single_load) -------------------
@test fn nodatasingleload() void = {
let td: str = testenv.fresh();
let exe: str = build(td, "nd", strings.concat(
@@ -214,8 +203,6 @@ fn runexit(td: str, tag: str, exe: str) i32 = {
testenv.clean(td);
};
// ---- bssfilesz (620 test_bss_filesz) -----------------------------------
@test fn bssfilesz() void = {
let td: str = testenv.fresh();
// nz = \x07 + 7 zeros, zlong = 24 zeros: memsz covers all 32B,

View File

@@ -1,6 +1,5 @@
package package_test;
// Native end-to-end checks for the first single-directory package route.
// Make builds and invokes this one binary; discovery, subprocess ownership,
// output interpretation, and assertions remain WW code.

View File

@@ -164,8 +164,6 @@ fn cxrootsrc() str = {
"fn main() i32 = { return (cea.val(): i32) + (ceb.val(): i32); };\n");
};
// produce a package's .wwi (w6c -I, .s discarded); the production
// itself must succeed.
fn produce(td: str, name: str, unit: str, wwi: str) void = {
let av: []str = [testenv.driver("w6c"), "-I", wwi, "-o", "/dev/null",
unit];
@@ -222,7 +220,6 @@ fn keystone(td: str, label: str, bodies: str, sepu: str) void = {
};
};
// compile (-c) + assemble one package unit through one toolchain.
fn buildpkg(td: str, name: str, comp: str, asmtool: str, unit: str,
sf: str, of: str) void = {
let cav: []str = [testenv.driver(comp), "-c", "-o", sf, unit];
@@ -235,7 +232,6 @@ fn buildpkg(td: str, name: str, comp: str, asmtool: str, unit: str,
};
};
// materialize leaf.ww + leaf.wwi + mid.prod.ww + mid.wwi under td.
fn producecore(td: str) void = {
let leafww: str = strings.concat(td, "/leaf.ww");
testenv.writefile(leafww, leafsrc());
@@ -248,7 +244,6 @@ fn producecore(td: str) void = {
produce(td, "mid", prod, strings.concat(td, "/mid.wwi"));
};
// materialize sleaf.ww + sleaf.wwi (+ optionally smid.wwi) under td.
fn producestr(td: str, withsmid: bool) void = {
let sleafww: str = strings.concat(td, "/sleaf.ww");
testenv.writefile(sleafww, sleafsrc());

View File

@@ -69,8 +69,6 @@ fn samefile(label: str, what: str, a: str, b: str) void = {
};
};
// ---- sepbuild (#46): real chain root->os->{rt,time} --------------------
// A package directory's *.ww bodies (less *test.ww), byte-sorted, each
// newline-terminated — mirrors the driver's body enumeration so the
// substituted bodies-unit matches the sep-unit structurally.
@@ -241,8 +239,6 @@ fn composebodies(unit: str, libdir: str) str = {
testenv.clean(td);
};
// ---- seproot (#69 BUG-1): export-over-unexported-type root -------------
@test fn seproot() void = {
let td: str = testenv.fresh();
assert(os.mkdir(strings.concat(td, "/lib"), 493) == 0);
@@ -340,8 +336,6 @@ fn composebodies(unit: str, libdir: str) str = {
testenv.clean(td);
};
// ---- sepstructdef (#70 BUG-2): aggregate-init def prototypes -----------
@test fn sepstructdef() void = {
let td: str = testenv.fresh();
assert(os.mkdir(strings.concat(td, "/lib"), 493) == 0);
@@ -420,8 +414,6 @@ fn composebodies(unit: str, libdir: str) str = {
testenv.clean(td);
};
// ---- wwispread (#95): `...` spread marker round-trip -------------------
fn spreadshape(name: str, entry: str, wwi: str, marker: str) void = {
let td: str = testenv.fresh();
let src: str = strings.concat(testenv.repo(), "/", entry);

View File

@@ -84,8 +84,6 @@ fn cmpsepwork(label: str, csdir: str, wwdir: str) void = {
if (seen == 0) { fail(label, "no .s/.wwi in cs sepwork"); };
};
// ---- coloimport (#98) --------------------------------------------------
@test fn coloimport() void = {
let td: str = testenv.fresh();
let inc: str = strings.concat(testenv.repo(), "/test/wcc/data/colo98");
@@ -116,8 +114,6 @@ fn cmpsepwork(label: str, csdir: str, wwdir: str) void = {
testenv.clean(td);
};
// ---- depmain (#99) -----------------------------------------------------
// column-0 anchored `TEXT main,` labels across every .s under `dir`;
// the leading '\n' prepend also counts a file-leading label.
fn countbaremain(dir: str) i32 = {
@@ -183,8 +179,6 @@ fn depmainrow(label: str, entry: str, want: i32, deps: str,
"cc.s", "TEXT cc.main,");
};
// ---- declns modfn coexist (#23/#30) ------------------------------------
@test fn declns() void = {
let td: str = testenv.fresh();
let lays: []str = ["modfn_coexist", "modfn_coexist_vbu"];
@@ -278,8 +272,6 @@ fn depmainrow(label: str, entry: str, want: i32, deps: str,
testenv.clean(td);
};
// ---- slttypepref (#58/#50 c1) ------------------------------------------
// fresh two-directory tree per (row,driver); relative build with the
// tree as cwd (canonical dir-package build, binary lands in cwd).
fn sltbuild(drv: str, param: str) i32 = {

View File

@@ -19,7 +19,7 @@ package seplink_test;
// exit non-zero, name "duplicate symbol", and leave no partial
// binary. Non-vacuity flip: a distinct symbol builds + runs (exit 3).
//
// cycle (#46 commit-4) — a 3-package import cycle
// cycle (#46 commit-4 A) — a 3-package import cycle
// root->pkga->pkgb->pkgc->pkga is LOUD-rejected: non-zero exit, the
// `dependency cycle: pkga -> pkgb -> pkgc -> pkga` chain named, no
// partial binary, and cs stderr == ww stderr BYTE-IDENTICAL (the
@@ -65,8 +65,6 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
return co.code;
};
// ---- archive (#46 commit-5a) -------------------------------------------
@test fn archive() void = {
let td: str = testenv.fresh();
assert(os.mkdir(strings.concat(td, "/helper"), 493) == 0);
@@ -140,8 +138,6 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
testenv.clean(td);
};
// ---- archivedup (#31 through .a, PASS 3) -------------------------------
@test fn archivedup() void = {
let td: str = testenv.fresh();
assert(os.mkdir(strings.concat(td, "/pkga"), 493) == 0);
@@ -208,8 +204,6 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
testenv.clean(td);
};
// ---- cycle (#46 commit-4 A) --------------------------------------------
@test fn cycle() void = {
let td: str = testenv.fresh();
assert(os.mkdir(strings.concat(td, "/pkga"), 493) == 0);
@@ -289,8 +283,6 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
testenv.clean(td);
};
// ---- linkdup (#31 at the linker) ---------------------------------------
@test fn linkdup() void = {
let td: str = testenv.fresh();
let u1: str = strings.concat(td, "/u1.ww");

View File

@@ -1,10 +1,8 @@
package testenv;
// Shared plumbing for ww-native test drivers under test/: subprocess
// launch with captured output, file IO, string search, and scratch
// ownership. A utility surface lifted from the proven
// test/package/package_test.ww idiom — not a framework: callers own
// discovery, assertions, and verdicts.
// A utility surface lifted from the proven test/package/package_test.ww
// idiom — not a framework: callers own discovery, assertions, and
// verdicts.
import endian;
import os;

View File

@@ -55,7 +55,6 @@ fn runcode(dir: str, name: str, argv: []str) i32 = {
return co.code;
};
// every .s/.wwi in csdir byte-identical in wwdir; at least one seen
fn cmpsepwork(label: str, csdir: str, wwdir: str) void = {
let names: []str = testenv.listdir(csdir);
let seen: i32 = 0;

View File

@@ -114,7 +114,6 @@ fn paramshadow_pos(src: str, label: str, want: i32, why: str) void = {
"cross-module param"));
};
// One `ww build` per inline source; the build must exit nonzero.
fn rejectrows(family: str, labels: []str, srcs: []str) void = {
let i: i32 = 0;
for (i < labels.len) {

Some files were not shown because too many files have changed in this diff Show More