test: port 787/929 cross-module match carriers to corpus fixtures
787_xmod_variant_match.c -> r787_xmod_variant_no_default (run-exit 21), r787_xmod_variant_bind_default (42), r787_xmod_variant_shape_a (12) (pkg/errs module dirs), r787_xmod_variant_foreign_qualifier (staged error: w6c 'is not a variant of', w6c_ww rejects via the #95 ambiguity guard — the carrier asserted reject polarity only) 929_match_4arm_cross_module_run.c -> r929_match_{4arm_shadowed_ canonical,3arm_shadowed,5arm_shadowed,6arm_shadowed,4arm_mixed_kinds, 4arm_shadowed_reverse} (run; single-file a+b packages, dropping the carrier's accidental doubled 'package b;' line) 929's byte-id upgrades from 994-delegated to per-fixture via test-data-byteid; the asm-level distinct-CMPQ sentinel remains 728's separate concern. All rows probed green on both stages.
This commit is contained in:
30
test/wcc/data/r929_match_4arm_shadowed_canonical/case.ww
Normal file
30
test/wcc/data/r929_match_4arm_shadowed_canonical/case.ww
Normal file
@@ -0,0 +1,30 @@
|
||||
//ww:run
|
||||
// migrated from test/wcc/929_match_4arm_cross_module_run.c: canonical 4-arm — caller fn `next` shadows callee a.next; every arm body must fire (#31 fnretlookupmod).
|
||||
package a;
|
||||
export type more = void;
|
||||
export type invalid = !void;
|
||||
export type done = void;
|
||||
export fn next(k: i32) (rune | done | more | invalid) = {
|
||||
if (k == 0) { return 0x41u32: rune; };
|
||||
if (k == 1) { let v: done; return v; };
|
||||
if (k == 2) { let v: more; return v; };
|
||||
let v: invalid; return v;
|
||||
};
|
||||
package b;
|
||||
import a;
|
||||
type done = void;
|
||||
fn next(k: i32) i32 = {
|
||||
match (a.next(k)) {
|
||||
case let r: rune => return 100i32 + (r: i32);
|
||||
case let dn: a.done => return 200;
|
||||
case let m: a.more => return 300;
|
||||
case let e: a.invalid => return 400;
|
||||
};
|
||||
};
|
||||
export fn main() i32 = {
|
||||
if (next(0) != 165) { return 11; };
|
||||
if (next(1) != 200) { return 12; };
|
||||
if (next(2) != 300) { return 13; };
|
||||
if (next(3) != 400) { return 14; };
|
||||
return 0;
|
||||
};
|
||||
Reference in New Issue
Block a user