wcc/cgen: loud-align static-global tagged cast-init (wwstage align to cstage)

A module-global tagged init via cast (`let g: u = true: u;`) silently
emitted tag=0; cstage louds. Route emittaggeddata through flatvariantidx
(the cstage cg_tag_for_variant twin) so an unsupported variant louds while
valid str/slice cast-inits still accept+run. test/wcc/838.
This commit is contained in:
2026-06-09 19:08:12 +09:00
parent 90452a8364
commit 5c28c90837
5 changed files with 277 additions and 3 deletions

View File

@@ -262,6 +262,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_nested_union_int_box \
$(BIN)/test_tagged_assignable_cluster \
$(BIN)/test_idcast_tagged_return \
$(BIN)/test_global_tagged_castinit \
$(BIN)/test_inferred_array_global \
$(BIN)/test_slice_str_global_arg \
$(BIN)/test_slice_str_global_zero \
@@ -751,6 +752,12 @@ $(BIN)/test_idcast_tagged_return: test/wcc/837_idcast_tagged_return.c $(BIN)/ww
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_global_tagged_castinit: test/wcc/838_global_tagged_castinit.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_inferred_array_global: test/wcc/833_inferred_array_global.c $(BIN)/ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \