test: port the xmod same-leaf collision carriers to corpus fixtures
752_modparam_callee.c -> r752_modparam_xmod_variadic_vs_scalar,
r752_modparam_variadic_no_collision (run; alpha/beta module dirs)
784_xmod_alias_struct_collide_run.c -> r784_xmod_alias_struct_collide
(run-exit 42), r784_xmod_alias_struct_symmetric (21),
r784_xmod_alias_control (30) (sa/sb module dirs)
793_xmod_struct_argpush_collide_run.c -> r793_xmod_argpush_
{recvpush_t16 107, fieldread_t16 107, combined_t16 114,
recvpush_t12 6} (m1/m2 module dirs)
797_xmod_struct_field_layout_collide_run.c -> r797_xmod_layout_
{ptrread_t16 107, letcopy_t16 107, addrptr_pq 10, addrval_pq 10,
ptrwrite_t16 109, valwrite_t16 109} (m1/m2) + r797_nestfill_box (66)
r770-style sibling module dirs express the trees; the fixture corpus
runs both drivers natively (784's wwstage-build-only leg upgrades to
build+run) and test-data-byteid owns each carrier's aggregated per-
package .s compare (letcopy_t16's real discriminator). All 16 probed
green on both stages including per-package byte identity.
This commit is contained in:
12
test/wcc/data/r784_xmod_alias_control/case.ww
Normal file
12
test/wcc/data/r784_xmod_alias_control/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 30
|
||||
// migrated from test/wcc/784_xmod_alias_struct_collide_run.c: control — alias+vtable dispatcher with NO foreign same-leaf struct in the closure.
|
||||
package main;
|
||||
import sa;
|
||||
fn cb(x: sa.s, v: i32) i32 = { return v + 100; };
|
||||
export fn main() i32 = {
|
||||
let vt = sa.mkvt((&cb): *sa.reader);
|
||||
let st: sa.s = &vt;
|
||||
let r = sa.read(st, 5);
|
||||
if (r != 105) { return 11; };
|
||||
return 30;
|
||||
};
|
||||
21
test/wcc/data/r784_xmod_alias_control/sa/sa.ww
Normal file
21
test/wcc/data/r784_xmod_alias_control/sa/sa.ww
Normal file
@@ -0,0 +1,21 @@
|
||||
// alias+vtable dispatcher, collision-free control for r784.
|
||||
package sa;
|
||||
|
||||
export type reader = fn(x: s, v: i32) i32;
|
||||
|
||||
export type vtable = struct {
|
||||
reader: (*reader | void),
|
||||
};
|
||||
|
||||
export type s = *vtable;
|
||||
|
||||
export fn read(x: s, v: i32) i32 = {
|
||||
match (x.reader) {
|
||||
case void => return -1;
|
||||
case let f: *reader => return (*f)(x, v);
|
||||
};
|
||||
};
|
||||
|
||||
export fn mkvt(f: *reader) vtable = {
|
||||
return vtable { reader = f };
|
||||
};
|
||||
Reference in New Issue
Block a user