test: migrate str/slice global family-1 batch to test/lang @test, retire C twins (fold-2)

Continue fold-2 (after 374e97b): migrate the remaining Family-1 str/slice
global + literal + index + call-arg group from bespoke build+run C twins to
test/lang @test, retiring each twin in the same commit. Runtime coverage MOVES
from $(TESTS) to test-lang (T1 runs+asserts via `ww test`) + test-lang-byteid
(T2 keeps cs==ww .s byte-id); coverage is preserved, the $(TESTS) headline
drops 9 (434->425). All asserts are primitive int/u8/bool comparisons (no
fmt/strconv in the assert path); the slice-store/index rows reset the global
each fn and sum ADJACENT elements so a dropped/mis-strided/over-wide word FAILS.

  989_globslicefield_run.c    -> glob_slice_field_test.ww     (slice field of a global struct: g.f=<slice> stores full 24B header; len/cap/non-zero-offset + str/scalar controls)
  989_globstrslice_run.c      -> glob_str_slice_arg_test.ww   (global str sliced with default hi passed as call arg loads its len word; explicit-hi control)
  989_trystr_run.c            -> try_str_unwrap_test.ww       (`!` unwrap of str-success tagged union shuffles the str header for ident-source/error-first/success-first)
  797_len_strglobal_run.c     -> len_str_global_test.ww       (len(str-global) loads .len via name(SB); local-str control)
  801_litstr_pseudo_run.c     -> lit_str_pseudo_test.ww       (string-literal .len/.ptr pseudo-field; empty/multibyte + arg-passthrough)
  803_globalidx_run.c         -> global_index_test.ww         (global str/slice index read/addr-of/store/compound, esz 1/4; local regression pins)
  903_tuple_elem_slice_len.c  -> tuple_elem_slice_len_test.ww (len(t.N) of a slice/str tuple element loads .len at +8; 2/3-slice, str-slice both orders)
  927_composite_call_arg_run.c-> composite_call_arg_test.ww   (slice-returning CALL passed inline as a composite arg; canonical/letslice/two-call/middle/nested/scalar/tagged)
  952_slicecopy_assign_run.c  -> slice_copy_assign_test.ww    (bulk slice-copy-assign `arr[lo:hi]=bs`, esz 1/4, field/via-ptr/local bases; reslice-read companion)

rd_reslice asserts the TRUE value 360 (the .c twin's want=104 was 360 & 0xFF,
an exit-code truncation). 723_composite_call_arg.c's comment repointed to the
new test/lang location. 802_lenidx_run.c is DEFERRED (it carries //ww:error
reject rows — needs a value-rows-only split + a slim reject carrier, a fold-3
pass). Bump LANGBYTEID_EXPECTED_MIN 22->31 to ratchet the new corpus floor.
This commit is contained in:
2026-06-22 09:30:28 +09:00
parent 374e97b9e8
commit 438efab8c6
20 changed files with 623 additions and 2180 deletions

View File

@@ -276,7 +276,6 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_structcopytail_run \
$(BIN)/test_arrlit_tail_zero_run \
$(BIN)/test_defdim_slice_run \
$(BIN)/test_trystr_run \
$(BIN)/test_allocalias_run \
$(BIN)/test_defdim_field_run \
$(BIN)/test_defdim_argslice_run \
@@ -293,8 +292,6 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_taggedidx_run \
$(BIN)/test_fnptrcollide_run \
$(BIN)/test_tagnorm_run \
$(BIN)/test_globslicefield_run \
$(BIN)/test_globstrslice_run \
$(BIN)/test_globtagisas_run \
$(BIN)/test_dotbasehijack_run \
$(BIN)/test_globtagreassign_run \
@@ -414,10 +411,8 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_forrange_fieldbase_run \
$(BIN)/test_errtype_compare \
$(BIN)/test_intbinop_mismatch \
$(BIN)/test_tuple_elem_slice_len_run \
$(BIN)/test_str_forrange_loopvar_run \
$(BIN)/test_composite_call_arg \
$(BIN)/test_composite_call_arg_run \
$(BIN)/test_letdecl_zeroinit \
$(BIN)/test_nested_if_labels \
$(BIN)/test_alias_leaf_collision \
@@ -491,10 +486,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_xmod_ident_prefer \
$(BIN)/test_xmod_valglobal_run \
$(BIN)/test_xmod_valglobal_dot_run \
$(BIN)/test_len_strglobal_run \
$(BIN)/test_litstr_pseudo_run \
$(BIN)/test_lenidx_run \
$(BIN)/test_globalidx_run \
$(BIN)/test_zeroinit_run \
$(BIN)/test_tuple_sret_callee \
$(BIN)/test_tuple_sret_receive_run \
@@ -573,7 +565,6 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_ptrarr_index_run \
$(BIN)/test_dotbase_arr_run \
$(BIN)/test_dotbase_addr_slice_run \
$(BIN)/test_slicecopy_assign_run \
$(BIN)/test_globalslice_arg_run \
$(BIN)/test_structlit_arrfield_run \
$(BIN)/test_defdim_struct_run \
@@ -980,17 +971,6 @@ $(BIN)/test_defdim_slice_run: test/wcc/989_defdim_slice_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_trystr_run (#16): `?`/`!` unwrap of a str-success tagged union shuffles
# the str header for ANY operand shape + variant order, keyed off the stamped
# operand type (not a name-keyed call-only first-variant lookup). Builds+runs
# on BOTH driver twins (rule-10).
$(BIN)/test_trystr_run: test/wcc/989_trystr_run.c \
$(BIN)/ww $(BIN)/ww_ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_allocalias_run (#26): alloc(T{...}) for an alias T sizes + field-fills
# from the alias-chased struct layout, not a name-keyed lookup of the literal
# head. Builds+runs on BOTH driver twins (rule-10).
@@ -1156,28 +1136,6 @@ $(BIN)/test_fnptrcollide_run: test/wcc/989_fnptrcollide_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globslicefield_run (F8-c1, #35): a SLICE field of a module-global
# struct assigned via `g.f = <slice>` must store the full {ptr,len,cap}
# header. Builds+runs on BOTH driver twins (rule-10); align-UP — see the
# test header.
$(BIN)/test_globslicefield_run: test/wcc/989_globslicefield_run.c \
$(BIN)/ww $(BIN)/ww_ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globstrslice_run (F8-c2, #47): a module-global str sliced with a
# default high bound and passed as a call arg (`take(g[1:])`) must load its
# length word for the hi. Builds+runs on BOTH driver twins (rule-10);
# align-UP — see the test header.
$(BIN)/test_globstrslice_run: test/wcc/989_globstrslice_run.c \
$(BIN)/ww $(BIN)/ww_ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globtagisas_run (F8-c3, #18): `is`/`as` on a module-global tagged
# ident must read tag/payload from g(SB), not saved-BP. MIXED per-half:
# `is` align-UP (cs==ww); `as` #263 ww-runtime-correct (cs!=ww residual,
@@ -1919,23 +1877,6 @@ $(BIN)/test_xmod_valglobal_dot_run: test/wcc/796_xmod_valglobal_dot_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #231: len(str/slice global) must load the .len field via the global's
# address (LEAQ name(SB),CX; MOVQ 8(CX),AX), not a bogus BP-relative slot
# (cstage) or the whole header's .ptr (wwstage) — runtime + cs==ww byte-id.
$(BIN)/test_len_strglobal_run: test/wcc/797_len_strglobal_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #14: a string LITERAL `.len` is TY_UNTYPED_STR, so it misses the typed
# slice/str pseudo-field gate and fell to the N_DOT base-eval fallback —
# cstage returned AX=.ptr instead of shuffling BX=.len into AX (wwstage
# already did). Runtime + cs==ww byte-id; `.ptr` unchanged (control row).
$(BIN)/test_litstr_pseudo_run: test/wcc/801_litstr_pseudo_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #19: len() over an INDEXED str/slice element (`len(xs[i])`) returned the
# element's .ptr, not its length (cstage == wwstage, shared gap). Runtime
# (cstage build+run) + cs==ww byte-id, both dimensions per row.
@@ -1944,17 +1885,6 @@ $(BIN)/test_lenidx_run: test/wcc/802_lenidx_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #10: indexing a GLOBAL str / GLOBAL slice (`s[i]` / `g[i]`) read a wide
# {ptr,len,cap} header with an 8-byte stride + full-word load instead of the
# element load — wwstage `cgindex` dispatched esz off the base tnode KIND
# (only N_TARRAY/N_TPTR), so a global str/slice matched neither and defaulted
# to esz=8. cstage is correct (type-driven dispatch). Runtime (cstage build+
# run) + cs==ww byte-id, both dimensions per row.
$(BIN)/test_globalidx_run: test/wcc/803_globalidx_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #16: a bare `let x: T;` (no rhs) must zero-fill its slot. cgen emitted
# the zero-fill only for 8B-primitive and >8B-composite slots — a SUB-8
# aggregate (`let c: [3]u8;`) fell through to NOTHING and read stack
@@ -2542,13 +2472,6 @@ $(BIN)/test_overcap_tuple_field_store_run: test/wcc/940_overcap_tuple_field_stor
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #235: len() of a tuple-element slice/str reads .len (+8) not .ptr.
$(BIN)/test_tuple_elem_slice_len_run: test/wcc/903_tuple_elem_slice_len_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# #240: mixed-scalar tuple (e.g. (int,[]u8,str)) sret layout agrees in both
# stages — callee SEND foff via the return-type element size, caller RECEIVE
# falls an over-cap tuple through to the sret receive (size-gated).
@@ -2640,12 +2563,6 @@ $(BIN)/test_composite_call_arg: test/wcc/723_composite_call_arg.c \
$(BIN)/w6c $(BIN)/w6c_ww | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_composite_call_arg_run: test/wcc/927_composite_call_arg_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_letdecl_zeroinit: test/wcc/724_letdecl_zeroinit.c \
$(BIN)/w6c $(BIN)/w6c_ww | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
@@ -3289,11 +3206,6 @@ $(BIN)/test_dotbase_addr_slice_run: test/wcc/949_dotbase_addr_slice_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_slicecopy_assign_run: test/wcc/952_slicecopy_assign_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_globalslice_arg_run: test/wcc/953_globalslice_arg_run.c \
$(BIN)/ww $(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)
@@ -3552,7 +3464,7 @@ test-lang: all
LANGBYTEID_DIR = $(OUT)/langbyteid
LANGBYTEID_FILES = $(wildcard test/lang/*_test.ww)
LANGBYTEID_VERB = test -c
LANGBYTEID_EXPECTED_MIN = 22
LANGBYTEID_EXPECTED_MIN = 31
$(if $(LANGBYTEID_FILES),,$(error test-lang-byteid: empty corpus))
test-lang-byteid: all
@set -e; \