Files
ww/test/lang/void_error_singleton_test.ww
Hojun-Cho 246e5bb90e test: migrate Fam9 match/tagged value tests to @test (#5-C5)
fold-2 chunk C5 (drew's Fam8-13 plan), the highest-risk chunk: 21 match/tagged
value-row C drivers re-homed. 20 -> test/lang/*_test.ww @test row-tables + 12
runww //ww:error carriers (both stages reject). The global-tag cluster
(globtag*/globstructwiden/taggedderefstore/...), which sits on the #15/#17
global-ptr fix, was empirically probed byte-id CLEAN -- the predicted hotspot
surfaced ZERO fresh cs!=ww. Carves: variant_chain_b95 #81 -> _runonly (genuinely
diverges at HEAD); callret_bound277 #277 -> slim C pin (cs-runs/ww-rejects),
mutation-gated. 929_tagged_memarg kept whole (SSE-ABI asm conformance). 19
drivers deleted, 944_variant_chain slimmed to the #277 pin.

The match-on-tagged-struct-field divergence (former #26) probed RESOLVED for all
its cited shapes (938 voidstr_field/recursion_torture, tagnorm dedup_match all
byte-id cs==ww + value-correct) -- closed no-reproducer-at-HEAD, attribution to
#15/#17 INFERRED. Those rows migrate as normal byte-id @test and serve as the
REGRESSION SENTINEL for the inferred close (a resurgence trips the gate).

LANGBYTEID floor 93->113; test count 374->355 (19 deleted; 929 + 944_variant_chain
kept). do-not-auto-batch (926_tagscr/940_global_sret/940_str_forrange) untouched.
2026-06-24 20:42:08 +09:00

76 lines
1.6 KiB
Plaintext

// void_error_singleton_test — a `!void` error singleton (tag-only) across
// return / let-init / assign / call-arg positions, plus a wide (str) success
// payload exercising CX/R8 zeroing on the tag-only return. Migrated from
// test/wcc/949_void_error_singleton_run.c (value rows; C driver asserted cs==ww .s).
package void_error_singleton_test;
type too_long = !void;
fn f_ret_singleton() (i64 | too_long) = {
return too_long;
};
fn f_ret_success() (i64 | too_long) = {
return 42i64;
};
fn use_callarg(r: (i64 | too_long)) i32 = {
match (r) {
case let v: i64 => return 1;
case too_long => return 0;
};
return 2;
};
fn f_wide(ok: bool) (str | too_long) = {
if (ok) { return "hello"; };
return too_long;
};
@test fn return_singleton() void = {
match (f_ret_singleton()) {
case let v: i64 => { assert(false); };
case too_long => { };
};
};
@test fn return_success() void = {
match (f_ret_success()) {
case let v: i64 => { assert(v == 42); };
case too_long => { assert(false); };
};
};
@test fn letinit_singleton() void = {
let e: (i64 | too_long) = too_long;
match (e) {
case let v: i64 => { assert(false); };
case too_long => { };
};
};
@test fn assign_singleton() void = {
let e: (i64 | too_long) = 5i64;
e = too_long;
match (e) {
case let v: i64 => { assert(false); };
case too_long => { };
};
};
@test fn callarg_singleton() void = {
assert(use_callarg(too_long) == 0);
};
@test fn return_singleton_wide() void = {
match (f_wide(false)) {
case let s: str => { assert(false); };
case too_long => { };
};
match (f_wide(true)) {
case let s: str => { assert(s.len == 5); };
case too_long => { assert(false); };
};
};