wcc/ww: global-str default-hi slice arg loads its len word

Slicing a module-global str with default hi emitted nothing for the
bound; load the len word from g(SB)+8 (mirror the cstage twin).
Review item #47; dual-stage rows red-proven.
This commit is contained in:
2026-06-12 09:00:15 +09:00
parent fee84528da
commit 1eceb46ac3
5 changed files with 202 additions and 3 deletions

View File

@@ -256,6 +256,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_fnptrcollide_run \
$(BIN)/test_tagnorm_run \
$(BIN)/test_globslicefield_run \
$(BIN)/test_globstrslice_run \
$(BIN)/test_arr_ptr_global \
$(BIN)/test_def_arr_infer_len \
$(BIN)/test_def_arr_len \
@@ -723,6 +724,17 @@ $(BIN)/test_globslicefield_run: test/wcc/989_globslicefield_run.c \
$(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 $@ $<
$(BIN)/test_let_global: test/wcc/630_let_global.c $(BIN)/ww $(BIN)/w6c \
$(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<