From 83f5956df20297cb55cca2cb204822b208c71640 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Sat, 8 Aug 2026 21:40:23 +0900 Subject: [PATCH] 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. --- test/byteid/wwi_test.ww | 3 - test/lang/aggregate_tail_test.ww | 2 +- test/lang/aggret_source_test.ww | 2 +- test/lang/alias_accept_runonly_test.ww | 2 +- test/lang/alias_accept_test.ww | 63 +++---------------- test/lang/alias_amp_idx_test.ww | 2 +- test/lang/alias_cgen_b5_test.ww | 38 ++--------- test/lang/alias_cgen_b6_test.ww | 12 +--- .../alias_decl_order_size_runonly_test.ww | 4 +- test/lang/alias_decl_order_size_test.ww | 15 +---- test/lang/alias_def_addr_test.ww | 3 +- test/lang/alias_emit_b7_test.ww | 4 +- test/lang/alias_global_decl_test.ww | 2 +- test/lang/alias_idx_family_test.ww | 2 +- test/lang/alias_structlit_init_test.ww | 2 +- test/lang/alloc_nested_field_test.ww | 2 +- test/lang/append_structlit_evalorder_test.ww | 2 +- test/lang/arr_float_call_index_test.ww | 2 +- test/lang/arr_struct_subtail_frame_test.ww | 4 +- test/lang/arr_u16_store_test.ww | 2 +- test/lang/array_static_init_test.ww | 2 +- test/lang/arraytoslice_test.ww | 2 +- test/lang/arrlit_elem_narrow_test.ww | 2 +- test/lang/arrlit_infer_elem_test.ww | 2 +- test/lang/arrlit_slice_test.ww | 2 +- test/lang/arrvar_union_slice_test.ww | 2 +- test/lang/callret_unsigned_test.ww | 2 +- test/lang/chained_dot_struct_copy_test.ww | 2 +- test/lang/chainidx_test.ww | 2 +- test/lang/composite_call_arg_test.ww | 2 +- test/lang/const_slice_aggregate_test.ww | 2 +- test/lang/continue_test.ww | 2 +- test/lang/def_amp_idx_test.ww | 2 +- test/lang/def_float_lit_test.ww | 2 +- test/lang/defdim_argslice_test.ww | 2 +- test/lang/defdim_field_test.ww | 2 +- test/lang/defdim_slice_test.ww | 2 +- test/lang/deref_callarg_test.ww | 2 +- test/lang/deref_hdr_test.ww | 2 +- test/lang/deref_narrow_test.ww | 2 +- test/lang/deref_slice_store_test.ww | 2 +- test/lang/dotbase_addr_slice_test.ww | 24 ++----- test/lang/f32_untyped_narrow_test.ww | 21 +++---- test/lang/globtagreassign_test.ww | 2 +- test/lang/ptrarr_index_test.ww | 7 --- test/lang/strglobeq_test.ww | 6 -- test/lang/struct_composite_init_test.ww | 2 +- test/lang/struct_unwrap_test.ww | 2 +- test/lang/structcopytail_test.ww | 2 +- test/lang/structlit_arrfield_test.ww | 2 +- test/lang/subslice_cap_test.ww | 2 +- test/lang/subslice_ptresz_test.ww | 2 +- test/lang/tagged_call_arg_test.ww | 2 +- test/lang/tagged_structlit_payload_test.ww | 2 +- test/lang/tagged_tuple_widen_test.ww | 2 +- test/lang/tagged_widen_arg_test.ww | 2 +- test/lang/taggedarg_callresult_test.ww | 2 +- test/lang/taggedderefstore_test.ww | 2 +- test/lang/taggedglobalindex_test.ww | 2 +- test/lang/taggedidx_test.ww | 2 +- test/lang/tagnorm_test.ww | 2 +- test/lang/tagtupfieldsize_test.ww | 2 +- test/lang/try_str_unwrap_test.ww | 2 +- test/lang/tryprop_tag_remap_test.ww | 2 +- test/lang/tupfieldsize_test.ww | 2 +- test/lang/tuple_elem_slice_len_test.ww | 2 +- test/lang/tuple_in_union_test.ww | 2 +- test/lang/tuple_index_read_test.ww | 2 +- test/lang/tuple_lit_declblind_test.ww | 2 +- test/lang/tuple_nary_destructure_test.ww | 2 +- test/lang/tuple_slot_layout_test.ww | 2 +- test/lang/tuple_sret_receive_test.ww | 2 +- test/lang/tuple_tagged_union_test.ww | 2 +- test/lang/tupparam_test.ww | 2 +- test/lang/tuprecv_f64_test.ww | 2 +- test/lang/tuprecv_test.ww | 2 +- test/lang/type_value_shadow_test.ww | 2 +- test/lang/uniesc_test.ww | 2 +- test/lang/union_subtail_bp_test.ww | 2 +- test/lang/unwrap_callarg_slice_test.ww | 2 +- test/lang/unwrap_callarg_str_test.ww | 2 +- test/lang/valstruct_subsize_test.ww | 2 +- test/lang/variant_chain_b95_runonly_test.ww | 2 +- test/lang/variant_chain_b95_test.ww | 2 +- test/lang/variant_typekey_test.ww | 2 +- test/lang/void_error_singleton_test.ww | 2 +- test/lang/widen_pad_test.ww | 2 +- test/misc/stampdiag_test.ww | 1 - test/object/archive_test.ww | 4 -- test/object/asmgate_test.ww | 4 -- test/object/elfobj_test.ww | 8 --- test/object/link_test.ww | 19 +----- test/package/package_test.ww | 1 - test/sep/m3sep_test.ww | 5 -- test/sep/sepbuild_test.ww | 8 --- test/sep/sepimport_test.ww | 8 --- test/sep/seplink_test.ww | 10 +-- test/testenv/testenv.ww | 8 +-- test/tool/c6soak_test.ww | 1 - test/tool/rejects_test.ww | 1 - test/wcc/000_smoke.c | 7 +-- test/wcc/100_lex.c | 23 ++----- test/wcc/200_parse.c | 24 +------ test/wcc/300_check.c | 13 ---- test/wcc/400_w6c.c | 3 +- test/wcc/738_module_decl.c | 18 ++---- test/wcc/810_dyn.c | 22 +++---- test/wcc/950_selfcheck.c | 16 +---- test/wcc/989_dynentry_run.c | 8 +-- test/wcc/991_w6a_ww.c | 16 ++--- test/wcc/992_w6l_ww.c | 14 ++--- test/wcc/993_ww_ww.c | 37 +++++------ test/wcc/994_w6c_ww.c | 12 ++-- test/wcc/995_self_rebuild.c | 19 ++---- test/wcc/996_dyn_ww.c | 13 ++-- test/wcc/data/selfhost_smoke/case.ww | 23 ++----- test/wcc/wwtestpkg.h | 2 +- test/xmod/label_test.ww | 4 -- test/xmod/m1_test.ww | 4 -- test/xmod/typecheck_test.ww | 6 -- 120 files changed, 184 insertions(+), 530 deletions(-) diff --git a/test/byteid/wwi_test.ww b/test/byteid/wwi_test.ww index aa062b99..954b6747 100644 --- a/test/byteid/wwi_test.ww +++ b/test/byteid/wwi_test.ww @@ -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"); diff --git a/test/lang/aggregate_tail_test.ww b/test/lang/aggregate_tail_test.ww index 8ee235de..22760e7f 100644 --- a/test/lang/aggregate_tail_test.ww +++ b/test/lang/aggregate_tail_test.ww @@ -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 diff --git a/test/lang/aggret_source_test.ww b/test/lang/aggret_source_test.ww index 5a9394cd..2d03eec4 100644 --- a/test/lang/aggret_source_test.ww +++ b/test/lang/aggret_source_test.ww @@ -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 diff --git a/test/lang/alias_accept_runonly_test.ww b/test/lang/alias_accept_runonly_test.ww index 786ef9f9..7374fc66 100644 --- a/test/lang/alias_accept_runonly_test.ww +++ b/test/lang/alias_accept_runonly_test.ww @@ -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 diff --git a/test/lang/alias_accept_test.ww b/test/lang/alias_accept_test.ww index de259f7b..d99eac60 100644 --- a/test/lang/alias_accept_test.ww +++ b/test/lang/alias_accept_test.ww @@ -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 }; diff --git a/test/lang/alias_amp_idx_test.ww b/test/lang/alias_amp_idx_test.ww index deb90903..6e2a4950 100644 --- a/test/lang/alias_amp_idx_test.ww +++ b/test/lang/alias_amp_idx_test.ww @@ -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 diff --git a/test/lang/alias_cgen_b5_test.ww b/test/lang/alias_cgen_b5_test.ww index 739ea99e..8a68f809 100644 --- a/test/lang/alias_cgen_b5_test.ww +++ b/test/lang/alias_cgen_b5_test.ww @@ -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; diff --git a/test/lang/alias_cgen_b6_test.ww b/test/lang/alias_cgen_b6_test.ww index cf56216c..f39a6cca 100644 --- a/test/lang/alias_cgen_b6_test.ww +++ b/test/lang/alias_cgen_b6_test.ww @@ -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 }; diff --git a/test/lang/alias_decl_order_size_runonly_test.ww b/test/lang/alias_decl_order_size_runonly_test.ww index 02dbe9d3..50ffae97 100644 --- a/test/lang/alias_decl_order_size_runonly_test.ww +++ b/test/lang/alias_decl_order_size_runonly_test.ww @@ -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; diff --git a/test/lang/alias_decl_order_size_test.ww b/test/lang/alias_decl_order_size_test.ww index d4104d07..bbcb4bff 100644 --- a/test/lang/alias_decl_order_size_test.ww +++ b/test/lang/alias_decl_order_size_test.ww @@ -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 = { diff --git a/test/lang/alias_def_addr_test.ww b/test/lang/alias_def_addr_test.ww index c3c1b7c1..1e581348 100644 --- a/test/lang/alias_def_addr_test.ww +++ b/test/lang/alias_def_addr_test.ww @@ -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 = { diff --git a/test/lang/alias_emit_b7_test.ww b/test/lang/alias_emit_b7_test.ww index b5b39792..679b0de3 100644 --- a/test/lang/alias_emit_b7_test.ww +++ b/test/lang/alias_emit_b7_test.ww @@ -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, diff --git a/test/lang/alias_global_decl_test.ww b/test/lang/alias_global_decl_test.ww index 10a15316..0da90cec 100644 --- a/test/lang/alias_global_decl_test.ww +++ b/test/lang/alias_global_decl_test.ww @@ -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 diff --git a/test/lang/alias_idx_family_test.ww b/test/lang/alias_idx_family_test.ww index 613afa84..02496f08 100644 --- a/test/lang/alias_idx_family_test.ww +++ b/test/lang/alias_idx_family_test.ww @@ -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 diff --git a/test/lang/alias_structlit_init_test.ww b/test/lang/alias_structlit_init_test.ww index 6a9ba913..7f19d191 100644 --- a/test/lang/alias_structlit_init_test.ww +++ b/test/lang/alias_structlit_init_test.ww @@ -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 diff --git a/test/lang/alloc_nested_field_test.ww b/test/lang/alloc_nested_field_test.ww index 9a2dbd9e..1db79206 100644 --- a/test/lang/alloc_nested_field_test.ww +++ b/test/lang/alloc_nested_field_test.ww @@ -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 diff --git a/test/lang/append_structlit_evalorder_test.ww b/test/lang/append_structlit_evalorder_test.ww index 7ddd5ec8..fb810809 100644 --- a/test/lang/append_structlit_evalorder_test.ww +++ b/test/lang/append_structlit_evalorder_test.ww @@ -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). diff --git a/test/lang/arr_float_call_index_test.ww b/test/lang/arr_float_call_index_test.ww index cbb456c9..44f31379 100644 --- a/test/lang/arr_float_call_index_test.ww +++ b/test/lang/arr_float_call_index_test.ww @@ -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 diff --git a/test/lang/arr_struct_subtail_frame_test.ww b/test/lang/arr_struct_subtail_frame_test.ww index de111821..e1c8373b 100644 --- a/test/lang/arr_struct_subtail_frame_test.ww +++ b/test/lang/arr_struct_subtail_frame_test.ww @@ -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 }]; diff --git a/test/lang/arr_u16_store_test.ww b/test/lang/arr_u16_store_test.ww index 6a004d6b..3005370d 100644 --- a/test/lang/arr_u16_store_test.ww +++ b/test/lang/arr_u16_store_test.ww @@ -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 diff --git a/test/lang/array_static_init_test.ww b/test/lang/array_static_init_test.ww index 29347cae..2d9d6110 100644 --- a/test/lang/array_static_init_test.ww +++ b/test/lang/array_static_init_test.ww @@ -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 diff --git a/test/lang/arraytoslice_test.ww b/test/lang/arraytoslice_test.ww index 72894b91..1d88f2cc 100644 --- a/test/lang/arraytoslice_test.ww +++ b/test/lang/arraytoslice_test.ww @@ -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 diff --git a/test/lang/arrlit_elem_narrow_test.ww b/test/lang/arrlit_elem_narrow_test.ww index df6cbdf9..c34f22c3 100644 --- a/test/lang/arrlit_elem_narrow_test.ww +++ b/test/lang/arrlit_elem_narrow_test.ww @@ -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 diff --git a/test/lang/arrlit_infer_elem_test.ww b/test/lang/arrlit_infer_elem_test.ww index 2047ad0a..3e8b89ef 100644 --- a/test/lang/arrlit_infer_elem_test.ww +++ b/test/lang/arrlit_infer_elem_test.ww @@ -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). // diff --git a/test/lang/arrlit_slice_test.ww b/test/lang/arrlit_slice_test.ww index edb4b72a..eca63933 100644 --- a/test/lang/arrlit_slice_test.ww +++ b/test/lang/arrlit_slice_test.ww @@ -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/. diff --git a/test/lang/arrvar_union_slice_test.ww b/test/lang/arrvar_union_slice_test.ww index ce264d84..2b696978 100644 --- a/test/lang/arrvar_union_slice_test.ww +++ b/test/lang/arrvar_union_slice_test.ww @@ -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). diff --git a/test/lang/callret_unsigned_test.ww b/test/lang/callret_unsigned_test.ww index 3196dccf..305ea354 100644 --- a/test/lang/callret_unsigned_test.ww +++ b/test/lang/callret_unsigned_test.ww @@ -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 / diff --git a/test/lang/chained_dot_struct_copy_test.ww b/test/lang/chained_dot_struct_copy_test.ww index e7f28d8d..0c369a85 100644 --- a/test/lang/chained_dot_struct_copy_test.ww +++ b/test/lang/chained_dot_struct_copy_test.ww @@ -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 diff --git a/test/lang/chainidx_test.ww b/test/lang/chainidx_test.ww index 5b7e4cfd..c736e29b 100644 --- a/test/lang/chainidx_test.ww +++ b/test/lang/chainidx_test.ww @@ -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 diff --git a/test/lang/composite_call_arg_test.ww b/test/lang/composite_call_arg_test.ww index 8af23235..059e3c47 100644 --- a/test/lang/composite_call_arg_test.ww +++ b/test/lang/composite_call_arg_test.ww @@ -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 diff --git a/test/lang/const_slice_aggregate_test.ww b/test/lang/const_slice_aggregate_test.ww index 624bd126..65bd0f1b 100644 --- a/test/lang/const_slice_aggregate_test.ww +++ b/test/lang/const_slice_aggregate_test.ww @@ -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 diff --git a/test/lang/continue_test.ww b/test/lang/continue_test.ww index 03bc9960..eadd6931 100644 --- a/test/lang/continue_test.ww +++ b/test/lang/continue_test.ww @@ -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). // diff --git a/test/lang/def_amp_idx_test.ww b/test/lang/def_amp_idx_test.ww index 1818b02e..bdd8c072 100644 --- a/test/lang/def_amp_idx_test.ww +++ b/test/lang/def_amp_idx_test.ww @@ -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 diff --git a/test/lang/def_float_lit_test.ww b/test/lang/def_float_lit_test.ww index 637f061d..6046df2f 100644 --- a/test/lang/def_float_lit_test.ww +++ b/test/lang/def_float_lit_test.ww @@ -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 diff --git a/test/lang/defdim_argslice_test.ww b/test/lang/defdim_argslice_test.ww index 7e80eb2b..89c925e4 100644 --- a/test/lang/defdim_argslice_test.ww +++ b/test/lang/defdim_argslice_test.ww @@ -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 diff --git a/test/lang/defdim_field_test.ww b/test/lang/defdim_field_test.ww index 78c033de..966efebb 100644 --- a/test/lang/defdim_field_test.ww +++ b/test/lang/defdim_field_test.ww @@ -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 diff --git a/test/lang/defdim_slice_test.ww b/test/lang/defdim_slice_test.ww index a7458eeb..fcf35ff9 100644 --- a/test/lang/defdim_slice_test.ww +++ b/test/lang/defdim_slice_test.ww @@ -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 diff --git a/test/lang/deref_callarg_test.ww b/test/lang/deref_callarg_test.ww index 897a2a87..45ddc247 100644 --- a/test/lang/deref_callarg_test.ww +++ b/test/lang/deref_callarg_test.ww @@ -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 diff --git a/test/lang/deref_hdr_test.ww b/test/lang/deref_hdr_test.ww index 65b65241..0b0b1564 100644 --- a/test/lang/deref_hdr_test.ww +++ b/test/lang/deref_hdr_test.ww @@ -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) diff --git a/test/lang/deref_narrow_test.ww b/test/lang/deref_narrow_test.ww index 70ad4383..1e8d1278 100644 --- a/test/lang/deref_narrow_test.ww +++ b/test/lang/deref_narrow_test.ww @@ -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 diff --git a/test/lang/deref_slice_store_test.ww b/test/lang/deref_slice_store_test.ww index 3df3644e..40a496f7 100644 --- a/test/lang/deref_slice_store_test.ww +++ b/test/lang/deref_slice_store_test.ww @@ -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 diff --git a/test/lang/dotbase_addr_slice_test.ww b/test/lang/dotbase_addr_slice_test.ww index ef5db95e..be68d4d0 100644 --- a/test/lang/dotbase_addr_slice_test.ww +++ b/test/lang/dotbase_addr_slice_test.ww @@ -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 }; diff --git a/test/lang/f32_untyped_narrow_test.ww b/test/lang/f32_untyped_narrow_test.ww index 33c36878..04f466d8 100644 --- a/test/lang/f32_untyped_narrow_test.ww +++ b/test/lang/f32_untyped_narrow_test.ww @@ -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); diff --git a/test/lang/globtagreassign_test.ww b/test/lang/globtagreassign_test.ww index 20c2d03b..091af22c 100644 --- a/test/lang/globtagreassign_test.ww +++ b/test/lang/globtagreassign_test.ww @@ -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; diff --git a/test/lang/ptrarr_index_test.ww b/test/lang/ptrarr_index_test.ww index 625d6dca..a3248c8b 100644 --- a/test/lang/ptrarr_index_test.ww +++ b/test/lang/ptrarr_index_test.ww @@ -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; diff --git a/test/lang/strglobeq_test.ww b/test/lang/strglobeq_test.ww index 88892826..ab952d80 100644 --- a/test/lang/strglobeq_test.ww +++ b/test/lang/strglobeq_test.ww @@ -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); diff --git a/test/lang/struct_composite_init_test.ww b/test/lang/struct_composite_init_test.ww index c5fb7345..07824a1b 100644 --- a/test/lang/struct_composite_init_test.ww +++ b/test/lang/struct_composite_init_test.ww @@ -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 diff --git a/test/lang/struct_unwrap_test.ww b/test/lang/struct_unwrap_test.ww index 7e78adf9..456411a6 100644 --- a/test/lang/struct_unwrap_test.ww +++ b/test/lang/struct_unwrap_test.ww @@ -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: diff --git a/test/lang/structcopytail_test.ww b/test/lang/structcopytail_test.ww index dfcd237b..2b426673 100644 --- a/test/lang/structcopytail_test.ww +++ b/test/lang/structcopytail_test.ww @@ -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 diff --git a/test/lang/structlit_arrfield_test.ww b/test/lang/structlit_arrfield_test.ww index 48cd77f7..9026f210 100644 --- a/test/lang/structlit_arrfield_test.ww +++ b/test/lang/structlit_arrfield_test.ww @@ -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 diff --git a/test/lang/subslice_cap_test.ww b/test/lang/subslice_cap_test.ww index 4d042447..da01dfd7 100644 --- a/test/lang/subslice_cap_test.ww +++ b/test/lang/subslice_cap_test.ww @@ -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 diff --git a/test/lang/subslice_ptresz_test.ww b/test/lang/subslice_ptresz_test.ww index 78ba4d50..49dc63d5 100644 --- a/test/lang/subslice_ptresz_test.ww +++ b/test/lang/subslice_ptresz_test.ww @@ -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) diff --git a/test/lang/tagged_call_arg_test.ww b/test/lang/tagged_call_arg_test.ww index 868a0a31..c73ea42f 100644 --- a/test/lang/tagged_call_arg_test.ww +++ b/test/lang/tagged_call_arg_test.ww @@ -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. diff --git a/test/lang/tagged_structlit_payload_test.ww b/test/lang/tagged_structlit_payload_test.ww index ad850dc3..07417115 100644 --- a/test/lang/tagged_structlit_payload_test.ww +++ b/test/lang/tagged_structlit_payload_test.ww @@ -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. diff --git a/test/lang/tagged_tuple_widen_test.ww b/test/lang/tagged_tuple_widen_test.ww index f6564bde..dce394ef 100644 --- a/test/lang/tagged_tuple_widen_test.ww +++ b/test/lang/tagged_tuple_widen_test.ww @@ -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- diff --git a/test/lang/tagged_widen_arg_test.ww b/test/lang/tagged_widen_arg_test.ww index 29922bc7..7eb8ec05 100644 --- a/test/lang/tagged_widen_arg_test.ww +++ b/test/lang/tagged_widen_arg_test.ww @@ -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. diff --git a/test/lang/taggedarg_callresult_test.ww b/test/lang/taggedarg_callresult_test.ww index f3314ac8..c3962041 100644 --- a/test/lang/taggedarg_callresult_test.ww +++ b/test/lang/taggedarg_callresult_test.ww @@ -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 diff --git a/test/lang/taggedderefstore_test.ww b/test/lang/taggedderefstore_test.ww index 3ea5f79b..8c3accf9 100644 --- a/test/lang/taggedderefstore_test.ww +++ b/test/lang/taggedderefstore_test.ww @@ -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 diff --git a/test/lang/taggedglobalindex_test.ww b/test/lang/taggedglobalindex_test.ww index 5255fa2b..43dd6a2f 100644 --- a/test/lang/taggedglobalindex_test.ww +++ b/test/lang/taggedglobalindex_test.ww @@ -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 diff --git a/test/lang/taggedidx_test.ww b/test/lang/taggedidx_test.ww index 91de20c6..df98f737 100644 --- a/test/lang/taggedidx_test.ww +++ b/test/lang/taggedidx_test.ww @@ -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). diff --git a/test/lang/tagnorm_test.ww b/test/lang/tagnorm_test.ww index 5389bec9..ca078ea8 100644 --- a/test/lang/tagnorm_test.ww +++ b/test/lang/tagnorm_test.ww @@ -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 + diff --git a/test/lang/tagtupfieldsize_test.ww b/test/lang/tagtupfieldsize_test.ww index dae36d19..21a68b6a 100644 --- a/test/lang/tagtupfieldsize_test.ww +++ b/test/lang/tagtupfieldsize_test.ww @@ -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. diff --git a/test/lang/try_str_unwrap_test.ww b/test/lang/try_str_unwrap_test.ww index 39de9ede..78e39a05 100644 --- a/test/lang/try_str_unwrap_test.ww +++ b/test/lang/try_str_unwrap_test.ww @@ -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 diff --git a/test/lang/tryprop_tag_remap_test.ww b/test/lang/tryprop_tag_remap_test.ww index 76a1f437..d101e3f5 100644 --- a/test/lang/tryprop_tag_remap_test.ww +++ b/test/lang/tryprop_tag_remap_test.ww @@ -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). diff --git a/test/lang/tupfieldsize_test.ww b/test/lang/tupfieldsize_test.ww index 44176686..b214b7d8 100644 --- a/test/lang/tupfieldsize_test.ww +++ b/test/lang/tupfieldsize_test.ww @@ -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 diff --git a/test/lang/tuple_elem_slice_len_test.ww b/test/lang/tuple_elem_slice_len_test.ww index 7aa3ec8d..20726129 100644 --- a/test/lang/tuple_elem_slice_len_test.ww +++ b/test/lang/tuple_elem_slice_len_test.ww @@ -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)`, diff --git a/test/lang/tuple_in_union_test.ww b/test/lang/tuple_in_union_test.ww index 70e4bebf..4ffbff3f 100644 --- a/test/lang/tuple_in_union_test.ww +++ b/test/lang/tuple_in_union_test.ww @@ -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: diff --git a/test/lang/tuple_index_read_test.ww b/test/lang/tuple_index_read_test.ww index 8f22d799..fce8ad91 100644 --- a/test/lang/tuple_index_read_test.ww +++ b/test/lang/tuple_index_read_test.ww @@ -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 diff --git a/test/lang/tuple_lit_declblind_test.ww b/test/lang/tuple_lit_declblind_test.ww index fc73b889..ef5a223e 100644 --- a/test/lang/tuple_lit_declblind_test.ww +++ b/test/lang/tuple_lit_declblind_test.ww @@ -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 diff --git a/test/lang/tuple_nary_destructure_test.ww b/test/lang/tuple_nary_destructure_test.ww index 2d461bd1..bca55c3d 100644 --- a/test/lang/tuple_nary_destructure_test.ww +++ b/test/lang/tuple_nary_destructure_test.ww @@ -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 diff --git a/test/lang/tuple_slot_layout_test.ww b/test/lang/tuple_slot_layout_test.ww index f3759ecd..3ab6979f 100644 --- a/test/lang/tuple_slot_layout_test.ww +++ b/test/lang/tuple_slot_layout_test.ww @@ -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. diff --git a/test/lang/tuple_sret_receive_test.ww b/test/lang/tuple_sret_receive_test.ww index d623ef9c..8d8b240c 100644 --- a/test/lang/tuple_sret_receive_test.ww +++ b/test/lang/tuple_sret_receive_test.ww @@ -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 diff --git a/test/lang/tuple_tagged_union_test.ww b/test/lang/tuple_tagged_union_test.ww index 83a78603..3d8f868b 100644 --- a/test/lang/tuple_tagged_union_test.ww +++ b/test/lang/tuple_tagged_union_test.ww @@ -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. diff --git a/test/lang/tupparam_test.ww b/test/lang/tupparam_test.ww index d34f20da..1c8b01d7 100644 --- a/test/lang/tupparam_test.ww +++ b/test/lang/tupparam_test.ww @@ -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 diff --git a/test/lang/tuprecv_f64_test.ww b/test/lang/tuprecv_f64_test.ww index 6649bd98..6b0ee1a5 100644 --- a/test/lang/tuprecv_f64_test.ww +++ b/test/lang/tuprecv_f64_test.ww @@ -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 diff --git a/test/lang/tuprecv_test.ww b/test/lang/tuprecv_test.ww index 238017dd..1be82a25 100644 --- a/test/lang/tuprecv_test.ww +++ b/test/lang/tuprecv_test.ww @@ -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. // diff --git a/test/lang/type_value_shadow_test.ww b/test/lang/type_value_shadow_test.ww index 1b2b89f2..0e0e45ea 100644 --- a/test/lang/type_value_shadow_test.ww +++ b/test/lang/type_value_shadow_test.ww @@ -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 diff --git a/test/lang/uniesc_test.ww b/test/lang/uniesc_test.ww index 72e35503..690fa80f 100644 --- a/test/lang/uniesc_test.ww +++ b/test/lang/uniesc_test.ww @@ -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 diff --git a/test/lang/union_subtail_bp_test.ww b/test/lang/union_subtail_bp_test.ww index 90e0ba56..be261546 100644 --- a/test/lang/union_subtail_bp_test.ww +++ b/test/lang/union_subtail_bp_test.ww @@ -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 diff --git a/test/lang/unwrap_callarg_slice_test.ww b/test/lang/unwrap_callarg_slice_test.ww index 67416b55..321aae26 100644 --- a/test/lang/unwrap_callarg_slice_test.ww +++ b/test/lang/unwrap_callarg_slice_test.ww @@ -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 diff --git a/test/lang/unwrap_callarg_str_test.ww b/test/lang/unwrap_callarg_str_test.ww index 30ae2e21..d123b419 100644 --- a/test/lang/unwrap_callarg_str_test.ww +++ b/test/lang/unwrap_callarg_str_test.ww @@ -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 diff --git a/test/lang/valstruct_subsize_test.ww b/test/lang/valstruct_subsize_test.ww index 06be7de0..f932e61e 100644 --- a/test/lang/valstruct_subsize_test.ww +++ b/test/lang/valstruct_subsize_test.ww @@ -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) diff --git a/test/lang/variant_chain_b95_runonly_test.ww b/test/lang/variant_chain_b95_runonly_test.ww index 7012067d..edc2d291 100644 --- a/test/lang/variant_chain_b95_runonly_test.ww +++ b/test/lang/variant_chain_b95_runonly_test.ww @@ -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 diff --git a/test/lang/variant_chain_b95_test.ww b/test/lang/variant_chain_b95_test.ww index d24c0091..460e1812 100644 --- a/test/lang/variant_chain_b95_test.ww +++ b/test/lang/variant_chain_b95_test.ww @@ -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 diff --git a/test/lang/variant_typekey_test.ww b/test/lang/variant_typekey_test.ww index 7e0aa79e..71ac1f72 100644 --- a/test/lang/variant_typekey_test.ww +++ b/test/lang/variant_typekey_test.ww @@ -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). diff --git a/test/lang/void_error_singleton_test.ww b/test/lang/void_error_singleton_test.ww index f92cacc3..e34afee1 100644 --- a/test/lang/void_error_singleton_test.ww +++ b/test/lang/void_error_singleton_test.ww @@ -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). diff --git a/test/lang/widen_pad_test.ww b/test/lang/widen_pad_test.ww index 7cbd0bad..e1d2d03f 100644 --- a/test/lang/widen_pad_test.ww +++ b/test/lang/widen_pad_test.ww @@ -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 diff --git a/test/misc/stampdiag_test.ww b/test/misc/stampdiag_test.ww index 37e6d2f7..0f30b14e 100644 --- a/test/misc/stampdiag_test.ww +++ b/test/misc/stampdiag_test.ww @@ -45,7 +45,6 @@ fn selfcheck() void = { "asserttyped")); }; -// w6c_ww -o /dev/null : 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", diff --git a/test/object/archive_test.ww b/test/object/archive_test.ww index 8e4e5e8c..12e2a5eb 100644 --- a/test/object/archive_test.ww +++ b/test/object/archive_test.ww @@ -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); diff --git a/test/object/asmgate_test.ww b/test/object/asmgate_test.ww index 4cfa1c2e..26f11c78 100644 --- a/test/object/asmgate_test.ww +++ b/test/object/asmgate_test.ww @@ -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"); diff --git a/test/object/elfobj_test.ww b/test/object/elfobj_test.ww index 838e33c6..a9a85678 100644 --- a/test/object/elfobj_test.ww +++ b/test/object/elfobj_test.ww @@ -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"); diff --git a/test/object/link_test.ww b/test/object/link_test.ww index 667d9b07..3834231d 100644 --- a/test/object/link_test.ww +++ b/test/object/link_test.ww @@ -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, diff --git a/test/package/package_test.ww b/test/package/package_test.ww index 821098e8..1fba21b7 100644 --- a/test/package/package_test.ww +++ b/test/package/package_test.ww @@ -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. diff --git a/test/sep/m3sep_test.ww b/test/sep/m3sep_test.ww index 9641da05..a1d42a7f 100644 --- a/test/sep/m3sep_test.ww +++ b/test/sep/m3sep_test.ww @@ -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()); diff --git a/test/sep/sepbuild_test.ww b/test/sep/sepbuild_test.ww index 411c3741..1e6b0a5d 100644 --- a/test/sep/sepbuild_test.ww +++ b/test/sep/sepbuild_test.ww @@ -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); diff --git a/test/sep/sepimport_test.ww b/test/sep/sepimport_test.ww index 0a8a7ae1..005abc46 100644 --- a/test/sep/sepimport_test.ww +++ b/test/sep/sepimport_test.ww @@ -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 = { diff --git a/test/sep/seplink_test.ww b/test/sep/seplink_test.ww index f68e5ead..a81621f1 100644 --- a/test/sep/seplink_test.ww +++ b/test/sep/seplink_test.ww @@ -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"); diff --git a/test/testenv/testenv.ww b/test/testenv/testenv.ww index c92dc543..6134a441 100644 --- a/test/testenv/testenv.ww +++ b/test/testenv/testenv.ww @@ -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; diff --git a/test/tool/c6soak_test.ww b/test/tool/c6soak_test.ww index f28f4535..f14323fb 100644 --- a/test/tool/c6soak_test.ww +++ b/test/tool/c6soak_test.ww @@ -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; diff --git a/test/tool/rejects_test.ww b/test/tool/rejects_test.ww index 2a72c6aa..860ad86c 100644 --- a/test/tool/rejects_test.ww +++ b/test/tool/rejects_test.ww @@ -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) { diff --git a/test/wcc/000_smoke.c b/test/wcc/000_smoke.c index 81ddce69..a14e768f 100644 --- a/test/wcc/000_smoke.c +++ b/test/wcc/000_smoke.c @@ -1,9 +1,4 @@ -/* - * 000_smoke — Phase 0 smoke test. - * - * Asserts arena allocation and growth through libwcc, plus the configured - * version constant. Driver behavior belongs to the driver integration tests. - */ +/* Driver behavior belongs to the driver integration tests. */ #include "ww.h" #include #include diff --git a/test/wcc/100_lex.c b/test/wcc/100_lex.c index 4f7c53f8..38d13dd7 100644 --- a/test/wcc/100_lex.c +++ b/test/wcc/100_lex.c @@ -1,13 +1,3 @@ -/* - * 100_lex — table-driven lexer tests. - * - * Each row is a (src, expected) pair. The expected string is the - * concatenation of token names, space-separated. For literals we - * also encode the value: e.g. INT(42), STR("hi"), IDENT(foo). - * - * EOF is implicit: the harness checks that lexnext returns TK_EOF - * after the last expected token. - */ #include "ww.h" #include #include @@ -75,7 +65,6 @@ static const struct row rows[] = { { "// comment\n", "" }, { "/* a /b/ c */", "" }, - /* identifiers + keywords */ { "foo", "IDENT(foo)" }, { "fn", "fn" }, { "fn main", "fn IDENT(main)" }, @@ -84,7 +73,6 @@ static const struct row rows[] = { { "if else for switch case return import type struct defer break continue proc chan nil true false package", "if else for switch case return import type struct defer break continue proc chan nil true false package" }, - /* numbers */ { "0", "INT(0)" }, { "42", "INT(42)" }, { "1_000_000", "INT(1000000)" }, @@ -95,7 +83,6 @@ static const struct row rows[] = { { "3.14", "FLOAT(3.14)" }, { "1.5e3", "FLOAT(1500)" }, - /* strings & runes */ { "\"hello\"", "STR(hello)" }, { "\"a\\nb\"", "STR(a\nb)" }, { "'A'", "RUNE(65)" }, @@ -122,7 +109,6 @@ static const struct row rows[] = { { "'\\uD7FF'", "RUNE(55295)" }, { "'\\uE000'", "RUNE(57344)" }, - /* operators & punct */ { "+ - * / % == != < > <= >= && || !", "+ - * / % == != < > <= >= && || !" }, { "= += -= *= /= %= &= |= ^= <<= >>=", @@ -136,15 +122,14 @@ static const struct row rows[] = { { "@symbol(\"malloc\")", "@ IDENT(symbol) ( STR(malloc) )" }, - /* mixed */ { "fn add(a: i32, b: i32) i32 = { return a + b; };", "fn IDENT(add) ( IDENT(a) : IDENT(i32) , IDENT(b) : IDENT(i32) ) IDENT(i32) = { return IDENT(a) + IDENT(b) ; } ;" }, }; -/* Escape error cases. A bad escape sets l.errs (the string/rune still - * lexes with the offending codepoint zeroed), so detection is via the - * error counter, not the token stream. The verbatim Hare messages live - * at lexunicode in cmd/wcc/lex.c. */ +/* A bad escape sets l.errs (the string/rune still lexes with the + * offending codepoint zeroed), so detection is via the error counter, + * not the token stream. The verbatim Hare messages live at lexunicode + * in cmd/wcc/lex.c. */ static int runerr(const char *src) { diff --git a/test/wcc/200_parse.c b/test/wcc/200_parse.c index 67132990..8b1459e6 100644 --- a/test/wcc/200_parse.c +++ b/test/wcc/200_parse.c @@ -1,11 +1,7 @@ /* - * 200_parse — parser tests. - * - * Two flavours: - * 1) "must parse": source must produce a Node and no errors. - * 2) "shape match": parsed AST printed via astprint, compared against - * expected substring (so tests stay readable without binding to - * every position field). + * Shape rows compare astprint output against a substring, not a full + * golden, so tests stay readable without binding to every position + * field. */ #include "ww.h" #include @@ -136,34 +132,20 @@ main(void) "fn fnt(f: fn(i32) i32, x: i32) i32 = { return f(x); };", "fn anontype() void = { let f: fn(i32) i32 = id; };", - /* multiple decls */ "import io;\nimport fmt;\ndef N: i32 = 8;\ntype p = struct{x:i32};\nfn f() void = {};", - /* attribute on FFI decl */ "@symbol(\"strlen\") fn cstrlen(s: *u8) u64;", - /* trailing comma */ "fn f(a: i32, b: i32,) void = {};", - /* nil/true/false */ "fn f() void = { let p: *i32 = nil; let x: bool = true; let y: bool = false; };", - /* chan */ "fn ch() void = { let c: chan i32; let v = <-c; };", - /* nested struct lit */ "fn lit2() void = { let q = box { p = nil, n = 0, items = [1, 2] }; };", - /* defer with call */ "fn f() void = { defer close(fd); return; };", - /* break / continue */ "fn f() void = { for () { if (x) { break; }; continue; }; };", - /* deeply nested expr */ "fn deep() i32 = { return ((((((1 + 2) * 3) - 4) / 5) % 6) << 7); };", - /* index chain */ "fn ix() i32 = { return a[b][c[d]]; };", - /* dot chain */ "fn dot() i32 = { return a.b.c.d; };", - /* call chain */ "fn cc() i32 = { return f()()(); };", - /* mixed postfix */ "fn mx() i32 = { return obj.method(arg)[idx].field; };", - /* multi-return tuples */ "fn divmod(a: i64, b: i64) (i64, i64) = { return a / b, a % b; };", "fn try() (i32, str) = { return 0, \"\"; };", "fn use_tuple() void = { let q, r = divmod(10, 3); };", diff --git a/test/wcc/300_check.c b/test/wcc/300_check.c index 88e2a1d3..66183c20 100644 --- a/test/wcc/300_check.c +++ b/test/wcc/300_check.c @@ -1,9 +1,3 @@ -/* - * 300_check — type-checker tests. - * - * Each row is (src, expect) where expect is "ok" (no errors) or a - * substring that must appear in the captured stderr. - */ #include "ww.h" #include #include @@ -54,7 +48,6 @@ runrow(const char *src, const char *expect) struct row { const char *src, *expect; }; static const struct row rows[] = { - /* OK cases */ { "fn main() void = {};", "ok" }, { "fn id(x: i32) i32 = { return x; };", "ok" }, { "fn add(a: i32, b: i32) i32 = { return a + b; };", "ok" }, @@ -81,14 +74,12 @@ static const struct row rows[] = { "type point = struct { x: i32 };", "ok" }, { "fn loops() void = { for () { break; }; for () { continue; }; };", "ok" }, - /* multi-return tuples */ { "fn divmod(a: i64, b: i64) (i64, i64) = { return a / b, a % b; };", "ok" }, { "fn dm(a: i64, b: i64) (i64, i64) = { return a, b; };\n" "fn caller() i64 = { let q, r = dm(10, 3); return q + r; };", "ok" }, { "fn dm() (i64, i64) = { return 1, 2; };\n" "fn ass() void = { let q: i64 = 0; let r: i64 = 0; q, r = dm(); };", "ok" }, - /* error cases */ { "fn f() void = { return 1; };", "return value in void" }, { "fn f() i32 = { return; };", "not assignable" }, { "fn f() void = { x = 1; };", "undefined" }, @@ -111,7 +102,6 @@ static const struct row rows[] = { "not enough arguments" }, { "fn f() void = { if (1) { }; };", "if condition" }, - /* tagged-union normalization & exhaustiveness */ { "fn f() (i32 | never) = { return 7; }; " "fn g() i32 = { return f(); };", "ok" }, /* (T|never) → T */ { "fn f() (i32 | i32) = { return 5; }; " @@ -130,7 +120,6 @@ static const struct row rows[] = { { "fn die() never = { for (true) { let _: i32 = 1; }; }; " "fn f() i32 = { die(); };", "ok" }, /* never assignable to anything */ - /* ? error-subset propagation typecheck */ { "fn inner() (i32 | str) = { return 1; }; " "fn outer() i32 = { let v: i32 = inner()?; return v; };", "enclosing function must return a tagged union" }, @@ -155,7 +144,6 @@ static const struct row rows[] = { { "fn lookup(p: *i32) (*i32 | void) = { return p; };", "ok" }, { "fn lookup() (*i32 | void) = { return; };", "ok" }, /* bare return → null */ - /* `case T` must name a variant of the scrutinee */ { "fn pick() (i32 | str) = { return 1; }; " "fn caller() void = { let v: (i32 | str) = pick(); " "match (v) { case let n: i32 => { }; case let s: str => { }; " @@ -168,7 +156,6 @@ static const struct row rows[] = { "return 0; };", "case: f64 is not a variant" }, - /* enum types */ { "type color = enum { RED, GREEN, BLUE };\n" "fn f() i32 = { return color.GREEN as i32; };", "ok" }, { "type mode = enum u8 { R = 1, W = 2, RW = R | W };\n" diff --git a/test/wcc/400_w6c.c b/test/wcc/400_w6c.c index 08694421..7c2f2975 100644 --- a/test/wcc/400_w6c.c +++ b/test/wcc/400_w6c.c @@ -1,6 +1,5 @@ /* - * 400_w6c — in-process codegen smoke tests. Each row supplies one tiny ww - * source and the assembly fragments it must emit. Full-file golden matches + * Rows match assembly fragments, not full-file goldens: golden matches * would bind the test to unrelated output details. */ #include "gc.h" diff --git a/test/wcc/738_module_decl.c b/test/wcc/738_module_decl.c index 76214ffe..9fae3954 100644 --- a/test/wcc/738_module_decl.c +++ b/test/wcc/738_module_decl.c @@ -1,6 +1,4 @@ /* - * 738_module_decl — sentinel for the `package ;` keyword. - * * Pins three invariants from the module-system rewrite: * 1. The parser ACCEPTS `package foo;` as the first non-comment item. * 2. The parser ACCEPTS multiple `package X;` decls (concatenated @@ -70,38 +68,32 @@ main(void) { int pass = 0, fail = 0; - /* Row 1: `package foo;` accepted as first non-comment item. */ if (parses_clean("package foo;\nfn x() void = {};\n")) pass++; else { fprintf(stderr, "738[1] basic package accept FAILED\n"); fail++; } - /* Row 2: comments before `package foo;` legal. */ if (parses_clean("// header\n// more\npackage foo;\nfn x() void = {};\n")) pass++; else { fprintf(stderr, "738[2] package after comments FAILED\n"); fail++; } - /* Row 3: subsequent decls stamped with current package. */ if (check_module_stamps( "package foo;\nfn x() void = {};\nfn y() void = {};\n", "foo", "foo")) pass++; else { fprintf(stderr, "738[3] decl module stamping FAILED\n"); fail++; } - /* Row 4: concatenated multi-section stream — second package - * decl switches the stamp for subsequent decls. Mirrors driver- - * emitted multi-file modules. */ + /* Mirrors driver-emitted multi-file concatenated streams. */ if (check_module_stamps( "package foo;\nfn a() void = {};\n" "package bar;\nfn b() void = {};\n", "foo", "bar")) pass++; else { fprintf(stderr, "738[4] mid-stream package switch FAILED\n"); fail++; } - /* Row 5: dotted import accepted with leaf stored on N_USE. */ if (parses_clean( "package foo;\nimport encoding.utf8;\nfn x() void = {};\n")) pass++; else { fprintf(stderr, "738[5] dotted import accept FAILED\n"); fail++; } - /* Row 6: dotted import stores only the leaf identifier on - * N_USE.str (post-task-#22 — the driver translates the full - * dotted path to a directory walk; the checker only needs the - * package bareword for n_use → decl disambiguation). */ + /* Dotted import stores only the leaf identifier on N_USE.str + * (post-task-#22 — the driver translates the full dotted path to + * a directory walk; the checker only needs the package bareword + * for n_use → decl disambiguation). */ { Arena *a = newarena(); Lex l; diff --git a/test/wcc/810_dyn.c b/test/wcc/810_dyn.c index 71a86446..9bfc6a49 100644 --- a/test/wcc/810_dyn.c +++ b/test/wcc/810_dyn.c @@ -1,19 +1,12 @@ /* - * 810_dyn — end-to-end test of w6l's dynamic linker. + * Covers the claims the exit status alone can't show: dyn.c reading + * ET_DYN and extracting exports, PLT/GOT generation with JUMP_SLOT + * relocations, and PT_INTERP/PT_DYNAMIC emission. * - * Drives `ww build -L /usr/lib -l c` over a small ww program that - * binds libc symbols via @symbol, then runs the produced binary and - * checks the exit status. Verifies: - * - * - the .so loader (dyn.c) reads ET_DYN and extracts exports - * - PLT/GOT generation and the JUMP_SLOT relocation - * - PT_INTERP/PT_DYNAMIC emission - * - symbol versioning (.gnu.version + .gnu.version_r) — clock_gettime - * has both GLIBC_2.2.5 (compat) and GLIBC_2.17 (default) on glibc; - * the loader requires the right .gnu.version_r entry to bind - * the default vDSO-aware impl. - * - * Reports the harness skip status on systems without a supported libc.so.6. + * Symbol versioning (.gnu.version + .gnu.version_r): clock_gettime has + * both GLIBC_2.2.5 (compat) and GLIBC_2.17 (default) on glibc; the + * loader requires the right .gnu.version_r entry to bind the default + * vDSO-aware impl. */ #include #include @@ -122,7 +115,6 @@ main(void) bin = absbin; } - /* Probe each common libc dir to find the right -L. */ const char *libdir = NULL; if (access("/usr/lib/libc.so.6", 0) == 0) libdir = "/usr/lib"; else if (access("/lib/x86_64-linux-gnu/libc.so.6", 0) == 0) libdir = "/lib/x86_64-linux-gnu"; diff --git a/test/wcc/950_selfcheck.c b/test/wcc/950_selfcheck.c index f60ec55c..77b943ba 100644 --- a/test/wcc/950_selfcheck.c +++ b/test/wcc/950_selfcheck.c @@ -1,10 +1,7 @@ /* - * 950_selfcheck — selfhost typechecker emits the same errors the - * C-side checker does for tagged-union misuse. - * - * Each row is a .ww fixture + an expected stderr substring. We run - * `wwdump_ww -r` (which invokes the selfhost checker's resolve + - * typed passes) and grep for the substring. + * Parity pin: the selfhost typechecker must emit the same errors the + * C-side checker does for tagged-union misuse. `wwdump_ww -r` is the + * probe — it invokes the selfhost checker's resolve + typed passes. */ #include #include @@ -75,7 +72,6 @@ writefile(const char *path, const char *src) struct row { const char *src; const char *expect; }; static const struct row rows[] = { - /* match: missing variant */ { "fn pick() (i32 | str | bool) = { return 1; };\n" "fn caller() void = {\n" " let v: (i32 | str | bool) = pick();\n" @@ -85,14 +81,12 @@ static const struct row rows[] = { " };\n" "};\n", "match: variant not handled" }, - /* ?: enclosing not tagged */ { "fn inner() (i32 | str) = { return 1; };\n" "fn caller() i32 = {\n" " let v: i32 = inner()?;\n" " return v;\n" "};\n", "?: enclosing fn return is not tagged" }, - /* ?: error variant not in enclosing return */ { "fn inner() (i32 | str | bool) = { return 1; };\n" "fn caller() (i32 | str) = {\n" " let v: i32 = inner()?;\n" @@ -117,7 +111,6 @@ static const struct row rows[] = { " return v + 1;\n" "};\n", "?: error variant not in enclosing return" }, - /* case T => names a non-variant */ { "fn pick() (i32 | str) = { return 1; };\n" "fn caller() void = {\n" " let v: (i32 | str) = pick();\n" @@ -128,19 +121,16 @@ static const struct row rows[] = { " };\n" "};\n", "case: not a variant" }, - /* is T where T isn't a variant of the operand */ { "fn pick() (i32 | str) = { return 1; };\n" "fn caller() void = {\n" " let v: (i32 | str) = pick();\n" " if (v is f64) { };\n" "};\n", "is/as: not a variant" }, - /* let init-type mismatch on primitives */ { "fn caller() void = {\n" " let x: bool = 42;\n" "};\n", "let: not assignable" }, - /* return type mismatch */ { "fn caller() i32 = {\n" " return \"hi\";\n" "};\n", diff --git a/test/wcc/989_dynentry_run.c b/test/wcc/989_dynentry_run.c index 1bc0d205..8fa6a092 100644 --- a/test/wcc/989_dynentry_run.c +++ b/test/wcc/989_dynentry_run.c @@ -44,8 +44,6 @@ runwait(const char *cmd) return 1; } -/* Harvest up to `max` default-versioned libc text exports into syms[][]. - * Returns the count, or -1 if nm/libc unavailable. */ static int harvest_syms(const char *libc, char syms[][32], int max) { @@ -68,8 +66,6 @@ harvest_syms(const char *libc, char syms[][32], int max) return n; } -/* Build with `driver` into /main, run, return exit code (or -1 on - * build failure). Sets *outbin to the produced binary path. */ static int build_run(const char *driver, const char *src, const char *libdir, const char *tmpdir, char *outbin, size_t obsz) @@ -119,7 +115,8 @@ main(void) } int fail = 0, total = 0; - /* ---- big: ~160 gated dead PLT calls, return 42 ---- */ + /* big: the s%03d calls are gated dead — they exist only to force + * enough PLT/dynsym entries to push the headers past one page. */ char bigsrc[1024], smallsrc[1024]; snprintf(bigsrc, sizeof bigsrc, "%s/big.ww", td); snprintf(smallsrc, sizeof smallsrc, "%s/small.ww", td); @@ -140,7 +137,6 @@ main(void) goto out; } - /* ---- small: 1 dyn sym, headers fit the page ---- */ f = fopen(smallsrc, "wb"); if (!f) { perror(smallsrc); diff --git a/test/wcc/991_w6a_ww.c b/test/wcc/991_w6a_ww.c index 09a42bd4..e15019ea 100644 --- a/test/wcc/991_w6a_ww.c +++ b/test/wcc/991_w6a_ww.c @@ -1,15 +1,9 @@ /* - * 991_w6a_ww — explicit bootstrap gate for the ww-side w6a port. - * - * Diffs the C-built `w6a` against the ww-built `w6a_ww` on a corpus of - * .s files. Both must produce byte-identical ELF .o output. The corpus - * spans: - * - rt/X.s hand-written runtime; small, varied operands - * - generated .s from the existing selfhost cgen pipeline - * (wwdump/w6a/w6l main.s) - large, exercises - * every encoding path w6c emits - * - * Any divergence is a port bug in selfhost/cmd/w6a/. + * Explicit bootstrap gate: the C-built `w6a` and the ww-built `w6a_ww` + * must produce byte-identical ELF .o output over the corpus. Any + * divergence is a port bug in selfhost/cmd/w6a/. The corpus pairs + * hand-written rt/X.s (small, varied operands) with cgen-generated .s + * (large — exercises every encoding path w6c emits). */ #include #include diff --git a/test/wcc/992_w6l_ww.c b/test/wcc/992_w6l_ww.c index 1991825b..904b89e3 100644 --- a/test/wcc/992_w6l_ww.c +++ b/test/wcc/992_w6l_ww.c @@ -1,13 +1,9 @@ /* - * 992_w6l_ww — explicit bootstrap gate for the ww-side w6l port. - * - * Diffs the C-built `w6l` against the ww-built `w6l_ww` on a corpus of - * link inputs. Both must produce byte-identical static ELF binaries. - * The corpus mixes: - * - a single .o input (no archive resolution) - * - a .o + libwwrt.a link, exercising the SysV `ar` two-pass loader - * - * Any divergence is a port bug in selfhost/cmd/w6l/. + * Explicit bootstrap gate: the C-built `w6l` and the ww-built `w6l_ww` + * must produce byte-identical static ELF binaries on the same link + * inputs. Any divergence is a port bug in selfhost/cmd/w6l/. The + * corpus mixes a single-.o link (no archive resolution) with a + * .o + libwwrt.a link exercising the SysV `ar` two-pass loader. */ #include #include diff --git a/test/wcc/993_ww_ww.c b/test/wcc/993_ww_ww.c index 1845a666..871b3730 100644 --- a/test/wcc/993_ww_ww.c +++ b/test/wcc/993_ww_ww.c @@ -1,15 +1,11 @@ /* - * 993_ww_ww — explicit bootstrap gate for the ww-side driver port. - * - * Diffs the C-built `ww` against the ww-built `ww_ww`. Both drivers + * Explicit bootstrap gate: the C-built `ww` and the ww-built `ww_ww` * orchestrate the same w6c/w6a/w6l, so the resulting binaries must be - * byte-identical for every program in the corpus. The corpus mixes: - * - a tiny single-file program (no -I flags) - * - a multi-import build (selfhost/cmd/wwdump/main.ww), exercising - * `use` resolution + the -I search path + the libwwrt.a link. - * - * Each build runs from a per-driver scratch directory so the - * intermediate .s/.o files don't collide. + * byte-identical for every program in the corpus. The corpus includes + * a multi-import build (selfhost/cmd/wwdump/main.ww) exercising `use` + * resolution, the -I search path, and the libwwrt.a link. Each build + * runs from a per-driver scratch directory so the intermediate .s/.o + * files don't collide. */ #include #include @@ -62,10 +58,8 @@ slurp_eq(const char *a, const char *b) return rc; } -/* Build `src` via the named driver, expecting output binary `out` in - * the build directory. `incs` may be a colon-separated list of include - * dirs (the ww driver accepts -I path1:path2:path3). Returns 0 on - * success. */ +/* `incs` may be a colon-separated list of include dirs (the ww driver + * accepts -I path1:path2:path3). */ static int build_via(const char *bin, const char *driver, const char *src, const char *workdir, const char *incs, const char *out_basename) @@ -129,10 +123,8 @@ cleanup: return rc; } -/* Stage a program whose main() returns `code`, build+exec it via the - * named driver's `run` subcommand, and return the propagated exit code - * (-1 on staging/spawn failure). #16: ww_ww must report the child's real - * exit code, not collapse every non-zero exit to 1. */ +/* #16: `run` must report the child's real exit code, not collapse + * every non-zero exit to 1. Returns -1 on staging/spawn failure. */ static int run_exit_code(const char *bin, const char *driver, int code) { @@ -160,11 +152,10 @@ run_exit_code(const char *bin, const char *driver, int code) return rc; } -/* Stage a program that fails to compile, run it via the named driver, - * and return the exit code. Pins the build-step caller contract: a - * failing build must still report failure (non-zero). The process mechanism's - * exact exit-code return must not regress this, since the - * w6c/w6a/w6l callers only test `!= 0`. */ +/* Pins the build-step caller contract: a failing build must still + * report failure (non-zero). The process mechanism's exact exit-code + * return must not regress this, since the w6c/w6a/w6l callers only + * test `!= 0`. */ static int run_build_fail(const char *bin, const char *driver) { diff --git a/test/wcc/994_w6c_ww.c b/test/wcc/994_w6c_ww.c index 174560f6..d45c9d6c 100644 --- a/test/wcc/994_w6c_ww.c +++ b/test/wcc/994_w6c_ww.c @@ -1,11 +1,7 @@ /* - * 994_w6c_ww — explicit bootstrap gate for the ww-side w6c port. - * - * w6c_ww is a thin packaging of selfhost/cmd/wcc/cgen.ww: it slurps a - * .ww file, runs lex+parse+cgen, and writes Plan 9 amd64 asm to the - * file given by -o. The same cgen is reached through `wwdump_ww -c`, - * so w6c_ww must produce byte-identical output to wwdump_ww -c on - * every program — this test pins that. + * w6c_ww and `wwdump_ww -c` reach the same selfhost cgen, so they must + * produce byte-identical output on every program — this test pins + * that. * * (We do not diff against C-side `w6c` here: this carrier's oracle is * the wwdump_ww -c TOOL OUTPUT, not the tool binary. The C-vs-ww diff @@ -354,7 +350,7 @@ main(void) n++; } - /* ---- Tier-C capstone (#46 c6, rob-c6-spec §2 / amendment-B; M4 #89) --- + /* Tier-C capstone (#46 c6, rob-c6-spec §2 / amendment-B; M4 #89). * The load-bearing M4 oracle: build w6c by SEPARATE compilation under * BOTH driver stages and prove they sep-produce byte-identical per-package * .s/.o/.wwi (cs==ww on the real tool's sep artifacts, rule 10). The diff --git a/test/wcc/995_self_rebuild.c b/test/wcc/995_self_rebuild.c index f6ec8832..d2492410 100644 --- a/test/wcc/995_self_rebuild.c +++ b/test/wcc/995_self_rebuild.c @@ -1,18 +1,13 @@ /* - * 995_self_rebuild — the wwstage rebuilds itself. - * - * Drives ww_ww (the ww-side driver, which shells to w6c_ww/w6a_ww/w6l_ww) - * over each wwstage tool's source and diffs the result byte-for-byte - * against the cstage-built binary in $BIN. A green run means the - * toolchain can recompile itself without touching cc, modulo the - * cold-start binary — which is the v1.0 lock from PLAN.md. + * A green run means the toolchain can recompile itself without + * touching cc, modulo the cold-start binary — which is the v1.0 lock + * from PLAN.md. * * This is stricter than `make bootstrap`: that loop only proves the * wwdump cgen self-stabilises; this proves every wwstage tool round- * trips through the wwstage pipeline. * - * The five tool builds run concurrently: fork() per tool, parent - * collects each pid with waitpid() and then byte-compares. Wall drops + * The five tool builds run concurrently (fork() per tool): wall drops * from sum(builds) to max(builds). */ #include @@ -84,8 +79,8 @@ struct buildjob { pid_t pid; }; -/* Fork a child that runs the `ww_ww build` for this tool. The child - * inherits no concurrent siblings — system() spawns a fresh /bin/sh -c. +/* The child inherits no concurrent siblings — system() spawns a fresh + * /bin/sh -c. * stderr lands in /build.err so concurrent builds don't merge * their diagnostics. `-o /main` (T3) makes the driver write its * intermediates (main.{s,o} and the sepwork tree) beside the output in @@ -137,8 +132,6 @@ spawn_build(const char *bin, const char *cwd, struct buildjob *j) return 0; } -/* Reap one job, byte-diff rebuilt vs canonical, replay captured stderr - * on build failure, rm workdir. Returns 0 on byte-match, -1 otherwise. */ static int collect_build(const char *bin, struct buildjob *j) { diff --git a/test/wcc/996_dyn_ww.c b/test/wcc/996_dyn_ww.c index af7245fc..cd6858e7 100644 --- a/test/wcc/996_dyn_ww.c +++ b/test/wcc/996_dyn_ww.c @@ -1,11 +1,8 @@ /* - * 996_dyn_ww — phase-8 marker for ET_DYN linking on the ww side. - * - * Drives w6l_ww with -L/-l flags over examples/mandelbrot/mandelbrot.o and diffs - * the result against the C-built w6l on the same inputs. A green run - * means the ww-side linker emits PT_INTERP/PT_DYNAMIC binaries byte- - * for-byte identical to the C linker — i.e. the dynamic linking story - * is fully ported. + * Phase-8 marker for ET_DYN linking on the ww side: a green run means + * the ww-side linker emits PT_INTERP/PT_DYNAMIC binaries byte-for-byte + * identical to the C linker on the same inputs — i.e. the dynamic + * linking story is fully ported. */ #include #include @@ -85,7 +82,6 @@ main(void) goto cleanup; } - /* C-side w6l with the dynamic flags. */ snprintf(cmd, sizeof cmd, "%s/w6l -o %s %s -L /usr/lib " "-l c %s/out/lib/libwwrt.a 2>/dev/null", @@ -96,7 +92,6 @@ main(void) goto cleanup; } - /* ww-side w6l with the same flags. */ snprintf(cmd, sizeof cmd, "%s/w6l_ww -o %s %s -L /usr/lib " "-l c %s/out/lib/libwwrt.a 2>/dev/null", diff --git a/test/wcc/data/selfhost_smoke/case.ww b/test/wcc/data/selfhost_smoke/case.ww index 336c256a..25d0e1d0 100644 --- a/test/wcc/data/selfhost_smoke/case.ww +++ b/test/wcc/data/selfhost_smoke/case.ww @@ -24,8 +24,6 @@ import os; import strconv; import ascii; -// --- bump arena --------------------------------------------------------- - type arena = struct { buf: *u8, off: u64, @@ -49,18 +47,14 @@ fn arena_alloc(a: *arena, n: u64) *u8 = { return p; }; -// --- (i32 | str) error idiom ------------------------------------------- - fn checked_div(num: i32, den: i32) (i32 | str) = { if (den == 0) { return "div by zero"; }; return num / den; }; -// --- struct-of-fn-pointer polymorphism --------------------------------- -// -// A trivial "writer" abstraction: a function pointer plus a context. -// This mirrors how io.stream / Plan 9 Bio work. The ctx pointer lets -// the implementation own its own state without a global. +// A "writer" is a function pointer plus a context, mirroring how +// io.stream / Plan 9 Bio work. The ctx pointer lets the implementation +// own its own state without a global. type counter = struct { n: i32, @@ -76,22 +70,19 @@ fn count_emit(ctx: *void, b: u8) void = { c.n += 1; }; -// --- size/align/offset typed-builtin fixtures (#42) -------------------- - type point = struct { x: i32, y: i32, }; -// Mixed-alignment struct: i8 lays at 0, then i64 needs to skip to -// offset 8 (the i64's natural align). Probe asserts both ends. +// #42 size/align/offset typed-builtin fixture. Mixed-alignment struct: +// i8 lays at 0, then i64 needs to skip to offset 8 (the i64's natural +// align). Probe asserts both ends. type mixalign = struct { tag: i8, val: i64, }; -// --- byte scanner like lex.ww's hot path ------------------------------- - fn count_digits(s: str) i32 = { let i: i32 = 0; let n: i32 = 0; @@ -105,8 +96,6 @@ fn count_digits(s: str) i32 = { return n; }; -// --- entry -------------------------------------------------------------- - export fn main() i32 = { // Probe 1 — arena hands out distinct pointers, refuses oversize. let buf: [256]u8; diff --git a/test/wcc/wwtestpkg.h b/test/wcc/wwtestpkg.h index edcaa4b0..03a76d80 100644 --- a/test/wcc/wwtestpkg.h +++ b/test/wcc/wwtestpkg.h @@ -1,5 +1,5 @@ /* - * wwtestpkg.h — strict-package (#24a) test support. + * Strict-package (#24a) test support. * * Inline ww test fixtures historically omitted the `package main;` clause * that the parser now requires (a missing clause is a hard error). These diff --git a/test/xmod/label_test.ww b/test/xmod/label_test.ww index e09ec65b..c1744c72 100644 --- a/test/xmod/label_test.ww +++ b/test/xmod/label_test.ww @@ -71,8 +71,6 @@ fn catasm(sepdir: str) str = { return out; }; -// ---- fnlabel (#9 + #12) ------------------------------------------------ - @test fn fnlabel() void = { let fixdir: str = strings.concat(testenv.repo(), "/test/wcc/data/fnlabelmangle"); @@ -107,8 +105,6 @@ fn catasm(sepdir: str) str = { testenv.clean(td); }; -// ---- mklabel (#13) ----------------------------------------------------- - fn mod1locate() str = { return strings.concat( "package mod1;\n", diff --git a/test/xmod/m1_test.ww b/test/xmod/m1_test.ww index 7cd0528c..1f270eab 100644 --- a/test/xmod/m1_test.ww +++ b/test/xmod/m1_test.ww @@ -82,8 +82,6 @@ fn mkdirs(td: str, dirs: []str) void = { }; }; -// ---- m1mangle (#22 + #32) ---------------------------------------------- - // dirs are '/'-joined mkdir steps, parents before children. fn m1row(label: str, dirs: []str, rel: str, content: str, root: str, want: i32) void = { @@ -163,8 +161,6 @@ fn m1row(label: str, dirs: []str, rel: str, content: str, root: str, "export fn main() int = { return cc.val(); };\n"), 3); }; -// ---- m1usehint (#40) --------------------------------------------------- - fn uselayout(td: str, apick: str, onecall: str) void = { let dirs: []str = ["a", "a/math", "b", "b/math", "one", "two"]; mkdirs(td, dirs); diff --git a/test/xmod/typecheck_test.ww b/test/xmod/typecheck_test.ww index 3e2b608e..f6c3ccd6 100644 --- a/test/xmod/typecheck_test.ww +++ b/test/xmod/typecheck_test.ww @@ -57,8 +57,6 @@ fn tmo() time.duration = { return (240i64 * (time.second: i64)): time.duration; }; -// ---- -T __wwtests reservation faces ------------------------------------ - fn tface(label: str, src: str) void = { let drvs: []str = ["ww", "ww_ww"]; let i: i32 = 0; @@ -100,8 +98,6 @@ fn tface(label: str, src: str) void = { "@test fn checkfoo() void = { return; };\n")); }; -// ---- cross-module call-arg collision rows ------------------------------ - fn io2src() str = { return strings.concat( "package io2;\n", @@ -181,8 +177,6 @@ fn shapemismatchmain() str = { "};\n")); }; -// ---- tagged-subset cross-module leaf-bridge rows ----------------------- - fn xrow(label: str, esrc: str, msrc: str, expectbuild: bool) void = { let drvs: []str = ["ww", "ww_ww"]; let i: i32 = 0;