// globstructwiden_test — F8-c7 (#50, #263): widening a module-GLOBAL struct // ident into a tagged union must copy the full payload into the box, not just // word0. Was a cat-A both-stage-wrong, now CLOSED both stages (.s byte-id). // Migrated from test/wcc/989_globstructwiden_run.c (K_RUN value rows). The // global lives at module scope so the widen exercises the g(SB) source arm. package globstructwiden_test; type pt = struct { a: i64, b: i64 }; type tri = struct { a: i64, b: i64, c: i64 }; let gp16: pt = pt { a = 5, b = 6 }; let gp24: tri = tri { a = 5, b = 6, c = 7 }; @test fn widen_16() void = { let x: (pt | str) = gp16; match (x) { case let q: pt => { assert(q.a == 5 && q.b == 6); }; case str => { assert(false); }; }; }; @test fn widen_24() void = { let x: (tri | str) = gp24; match (x) { case let q: tri => { assert(q.a == 5 && q.b == 6 && q.c == 7); }; case str => { assert(false); }; }; };