wcc/ww: tagged GLOBAL reassign stores tag and payload

Reassigning a module-global tagged union stored the payload into the
tag word; emit the full tag+payload store to g(SB). Both-wrong pair:
cstage silently DROPS the store entirely (filed task #41) — rows pin
ww-runtime-correct and the documented cstage residual. Review item #32.
This commit is contained in:
2026-06-12 09:10:16 +09:00
parent 94bfca761c
commit b3a355744f
5 changed files with 247 additions and 0 deletions

View File

@@ -259,6 +259,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_globstrslice_run \
$(BIN)/test_globtagisas_run \
$(BIN)/test_dotbasehijack_run \
$(BIN)/test_globtagreassign_run \
$(BIN)/test_arr_ptr_global \
$(BIN)/test_def_arr_infer_len \
$(BIN)/test_def_arr_len \
@@ -758,6 +759,17 @@ $(BIN)/test_dotbasehijack_run: test/wcc/989_dotbasehijack_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_globtagreassign_run (F8-c5, #32, #263): reassigning a module-global
# tagged ident (g = expr) must store tag+payload. ww-runtime-correct; cstage
# drops the store (cs!=ww residual, cstage half = task #41). Per-driver
# expected rows. See the test header.
$(BIN)/test_globtagreassign_run: test/wcc/989_globtagreassign_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 $@ $<