test: migrate defdim len/cap family to test/lang @test, retire C twins (fold-2)

Continue fold-2: migrate drew's Family 2 (def-dimensioned array len/cap/slice
resolution) 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 3 (425->422). All asserts are
primitive int comparisons (no fmt/strconv in the assert path); the defcap rows
poison cap != len and assert both words so a dropped cap word FAILS.

  989_defdim_field_run.c    -> defdim_field_test.ww    (`.len` field-read on a def-dim [MAX]T resolves from the type table: local/let-global/def cgdot arms + sum)
  989_defdim_slice_run.c    -> defdim_slice_test.ww    (slicing a def-dim [MAX]T resolves len AND cap from the type table: default-hi + cgbasecap, local+global)
  989_defdim_argslice_run.c -> defdim_argslice_test.ww (def-dim slice passed as a call arg resolves default-hi len in the N_SLICE arg-push arms; litctrl pins the N_INTLIT path)

Bump LANGBYTEID_EXPECTED_MIN 31->34 to ratchet the new corpus floor.
This commit is contained in:
2026-06-22 12:04:03 +09:00
parent 438efab8c6
commit a367bf984e
7 changed files with 120 additions and 546 deletions

View File

@@ -275,10 +275,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_structlocal_frame \
$(BIN)/test_structcopytail_run \
$(BIN)/test_arrlit_tail_zero_run \
$(BIN)/test_defdim_slice_run \
$(BIN)/test_allocalias_run \
$(BIN)/test_defdim_field_run \
$(BIN)/test_defdim_argslice_run \
$(BIN)/test_slttypepref_run \
$(BIN)/test_defercap_run \
$(BIN)/test_loopcap_run \
@@ -961,16 +958,6 @@ $(BIN)/test_arrlit_tail_zero_run: test/wcc/989_arrlit_tail_zero_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_defdim_slice_run (#21): slicing a `def`-dimensioned array (`[MAX]T`)
# resolves length + capacity from the type table, not the AST dim node.
# Builds+runs on BOTH driver twins (rule-10), pinning the absolute value.
$(BIN)/test_defdim_slice_run: test/wcc/989_defdim_slice_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).
@@ -981,28 +968,6 @@ $(BIN)/test_allocalias_run: test/wcc/989_allocalias_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_defdim_field_run (#56): `.len` field-read on a `def`-dimensioned array
# (`[MAX]T`) resolves the length from the type table in the local/global/def
# cgdot arms + letemitsize (cgdot sibling of #21). Builds+runs on BOTH driver
# twins (rule-10).
$(BIN)/test_defdim_field_run: test/wcc/989_defdim_field_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_defdim_argslice_run (#56 c4): passing a slice of a `def`-dimensioned
# array as a call arg resolves the default-hi length from the type table in
# the N_SLICE arg-push arms (cgenutil pushargsrev local+global). Builds+runs
# on BOTH driver twins (rule-10).
$(BIN)/test_defdim_argslice_run: test/wcc/989_defdim_argslice_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_slttypepref_run (#58/#50, c1): scopelookuptype prefers the current
# module's SK_TYPE when a value binding shadows a type leaf two modules both
# export. Builds+runs on BOTH driver twins (rule-10). See the test header.
@@ -3464,7 +3429,7 @@ test-lang: all
LANGBYTEID_DIR = $(OUT)/langbyteid
LANGBYTEID_FILES = $(wildcard test/lang/*_test.ww)
LANGBYTEID_VERB = test -c
LANGBYTEID_EXPECTED_MIN = 31
LANGBYTEID_EXPECTED_MIN = 34
$(if $(LANGBYTEID_FILES),,$(error test-lang-byteid: empty corpus))
test-lang-byteid: all
@set -e; \