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:
17
test/wcc/data/r787_xmod_variant_bind_default/case.ww
Normal file
17
test/wcc/data/r787_xmod_variant_bind_default/case.ww
Normal file
@@ -0,0 +1,17 @@
|
||||
//ww:run-exit 42
|
||||
// migrated from test/wcc/787_xmod_variant_match.c: bare arm + bound `case let o: pkg.b` + default over an imported 3-variant union.
|
||||
package main;
|
||||
import pkg;
|
||||
fn classify(e: pkg.u2) i32 = {
|
||||
match (e) {
|
||||
case pkg.a => return 1;
|
||||
case let o: pkg.b => return 2;
|
||||
case => return 9;
|
||||
};
|
||||
};
|
||||
export fn main() i32 = {
|
||||
if (classify(pkg.mka()) != 1) { return 11; };
|
||||
if (classify(pkg.mkb()) != 2) { return 12; };
|
||||
if (classify(pkg.mkc()) != 9) { return 13; };
|
||||
return 42;
|
||||
};
|
||||
9
test/wcc/data/r787_xmod_variant_bind_default/pkg/pkg.ww
Normal file
9
test/wcc/data/r787_xmod_variant_bind_default/pkg/pkg.ww
Normal file
@@ -0,0 +1,9 @@
|
||||
// exports the 3-variant union for the r787 bind_and_default scenario.
|
||||
package pkg;
|
||||
export type a = !void;
|
||||
export type b = !void;
|
||||
export type c = !void;
|
||||
export type u2 = !(a | b | c);
|
||||
export fn mka() u2 = { let x: a; return x; };
|
||||
export fn mkb() u2 = { let y: b; return y; };
|
||||
export fn mkc() u2 = { let z: c; return z; };
|
||||
Reference in New Issue
Block a user