w6c: receive sub-8 odd-sized by-value struct/array CALL return (#107)

A struct/array sized {3,5,6,7} returned by value fell past every N_LET call-receive arm (the sized-tail arm handles {1,2,4}, the memcpy arm gates on sz>8), so cstage emitted nothing and silently DROPPED the CALL — garbage exit plus a gate-blind cs!=ww divergence (wwstage emitted CALL+MOVQ via its generic let fallback). Align cstage UP: emit the CALL + one MOVQ AX, the SysV single-eightbyte receive (ref/qbe/amd64/sysv.c retr). New table-driven gate 949 (runtime exit oracle on both drivers + cs==ww byte-id; negative-control proven).
This commit is contained in:
2026-06-19 12:47:23 +09:00
parent 3bb381ef48
commit 1466f50a09
3 changed files with 292 additions and 0 deletions

View File

@@ -594,6 +594,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_arrlit_slice_run \
$(BIN)/test_valstruct_subsize_run \
$(BIN)/test_aggret_source_run \
$(BIN)/test_oddstruct_byval_ret_run \
$(BIN)/test_continue_run \
$(BIN)/test_callret_unsigned_arith_run \
$(BIN)/test_sar_shr_run \
@@ -3418,6 +3419,12 @@ $(BIN)/test_aggret_source_run: test/wcc/949_aggret_source_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_oddstruct_byval_ret_run: test/wcc/949_oddstruct_byval_ret_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_continue_run: test/wcc/911_continue_run.c $(BIN)/ww \
$(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l \
$(LIB)/libwwrt.a | $(BIN)