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:
@@ -0,0 +1,8 @@
|
||||
// sole variadic callee for the r752 no-collision control.
|
||||
package alpha;
|
||||
export fn sum(a: i32, xs: i32...) i32 = {
|
||||
let t: i32 = a;
|
||||
let i: i32 = 0;
|
||||
for (i < xs.len) { t += xs[i]; i += 1; };
|
||||
return t;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
//ww:run
|
||||
// migrated from test/wcc/752_modparam_callee.c: control — variadic callee in one module only; the N_IDENT arm stays on bare fnparamslookup.
|
||||
package main;
|
||||
import alpha;
|
||||
export fn main() i32 = {
|
||||
let r: i32 = alpha.sum(1, 2, 3, 4);
|
||||
if (r != 10) { return 40; };
|
||||
return 0;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
// same-leaf variadic side of the r752 collision pair.
|
||||
package alpha;
|
||||
export fn foo(a: i32, xs: i32...) i32 = {
|
||||
return a + xs.len;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
// same-leaf scalar-tagged side of the r752 collision pair.
|
||||
package beta;
|
||||
export fn foo(a: i32, n: (u8 | []u8)) i32 = {
|
||||
match (n) {
|
||||
case let c: u8 => return a + (c: i32);
|
||||
case let s: []u8 => return a + s.len;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
11
test/wcc/data/r752_modparam_xmod_variadic_vs_scalar/case.ww
Normal file
11
test/wcc/data/r752_modparam_xmod_variadic_vs_scalar/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run
|
||||
// migrated from test/wcc/752_modparam_callee.c: N_DOT callee param lookup must be module-keyed — alpha.foo variadic vs beta.foo scalar same leaf (#16).
|
||||
package main;
|
||||
import alpha;
|
||||
import beta;
|
||||
export fn main() i32 = {
|
||||
let n: (u8 | []u8) = 7u8;
|
||||
let r: i32 = beta.foo(10, n);
|
||||
if (r != 17) { return 11; };
|
||||
return 0;
|
||||
};
|
||||
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 };
|
||||
};
|
||||
17
test/wcc/data/r784_xmod_alias_struct_collide/case.ww
Normal file
17
test/wcc/data/r784_xmod_alias_struct_collide/case.ww
Normal file
@@ -0,0 +1,17 @@
|
||||
//ww:run-exit 42
|
||||
// migrated from test/wcc/784_xmod_alias_struct_collide_run.c: #223 trigger — sa's *vtable alias peel must not halt on sb's same-leaf foreign struct.
|
||||
package main;
|
||||
import sa;
|
||||
import sb;
|
||||
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);
|
||||
let vt2 = sa.mkempty();
|
||||
let st2: sa.s = &vt2;
|
||||
let r2 = sa.read(st2, 5);
|
||||
if (r != 105) { return 11; };
|
||||
if (r2 != -1) { return 12; };
|
||||
return 42;
|
||||
};
|
||||
25
test/wcc/data/r784_xmod_alias_struct_collide/sa/sa.ww
Normal file
25
test/wcc/data/r784_xmod_alias_struct_collide/sa/sa.ww
Normal file
@@ -0,0 +1,25 @@
|
||||
// alias-side of the r784 #223 pair: s = *vtable with a branched dispatcher.
|
||||
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 };
|
||||
};
|
||||
|
||||
export fn mkempty() vtable = {
|
||||
return vtable { reader = void };
|
||||
};
|
||||
7
test/wcc/data/r784_xmod_alias_struct_collide/sb/sb.ww
Normal file
7
test/wcc/data/r784_xmod_alias_struct_collide/sb/sb.ww
Normal file
@@ -0,0 +1,7 @@
|
||||
// foreign same-leaf STRUCT `s` (no reader field) — the #223 mis-peel bait.
|
||||
package sb;
|
||||
|
||||
export type s = struct {
|
||||
a: i32,
|
||||
b: i32,
|
||||
};
|
||||
11
test/wcc/data/r784_xmod_alias_struct_symmetric/case.ww
Normal file
11
test/wcc/data/r784_xmod_alias_struct_symmetric/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 21
|
||||
// migrated from test/wcc/784_xmod_alias_struct_collide_run.c: symmetric guard — sa's same-module STRUCT break must still fire with sb's same-leaf alias present.
|
||||
package main;
|
||||
import sa;
|
||||
import sb;
|
||||
export fn main() i32 = {
|
||||
let o = sa.mk(21, 8);
|
||||
let r = sa.geta(o);
|
||||
if (r != 21) { return 11; };
|
||||
return 21;
|
||||
};
|
||||
15
test/wcc/data/r784_xmod_alias_struct_symmetric/sa/sa.ww
Normal file
15
test/wcc/data/r784_xmod_alias_struct_symmetric/sa/sa.ww
Normal file
@@ -0,0 +1,15 @@
|
||||
// struct-side receiver for the r784 symmetric guard.
|
||||
package sa;
|
||||
|
||||
export type s = struct {
|
||||
a: i32,
|
||||
b: i32,
|
||||
};
|
||||
|
||||
export fn mk(av: i32, bv: i32) s = {
|
||||
return s { a = av, b = bv };
|
||||
};
|
||||
|
||||
export fn geta(x: s) i32 = {
|
||||
return x.a;
|
||||
};
|
||||
8
test/wcc/data/r784_xmod_alias_struct_symmetric/sb/sb.ww
Normal file
8
test/wcc/data/r784_xmod_alias_struct_symmetric/sb/sb.ww
Normal file
@@ -0,0 +1,8 @@
|
||||
// foreign same-leaf pointer ALIAS `s` — a naive alias-first reorder would mis-peel sa's struct.
|
||||
package sb;
|
||||
|
||||
export type vtable = struct {
|
||||
q: i32,
|
||||
};
|
||||
|
||||
export type s = *vtable;
|
||||
12
test/wcc/data/r793_xmod_argpush_combined_t16/case.ww
Normal file
12
test/wcc/data/r793_xmod_argpush_combined_t16/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 114
|
||||
// migrated from test/wcc/793_xmod_struct_argpush_collide_run.c: recv+field+push in one fn under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let s = m1.mk();
|
||||
let x: i32 = (s.lo: i32);
|
||||
return m1.consume(s) + x;
|
||||
};
|
||||
5
test/wcc/data/r793_xmod_argpush_combined_t16/m1/m1.ww
Normal file
5
test/wcc/data/r793_xmod_argpush_combined_t16/m1/m1.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 16B sub-8-tail pair — the local side of the r793 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn consume(p: pair) i32 = { return (p.hi + (p.lo: u64)): i32; };
|
||||
4
test/wcc/data/r793_xmod_argpush_combined_t16/m2/m2.ww
Normal file
4
test/wcc/data/r793_xmod_argpush_combined_t16/m2/m2.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
// 24B same-leaf foreign pair — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
11
test/wcc/data/r793_xmod_argpush_fieldread_t16/case.ww
Normal file
11
test/wcc/data/r793_xmod_argpush_fieldread_t16/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 107
|
||||
// migrated from test/wcc/793_xmod_struct_argpush_collide_run.c: #224 site — direct field read off the inferred-let recv under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let s = m1.mk();
|
||||
return (s.hi + (s.lo: u64)): i32;
|
||||
};
|
||||
4
test/wcc/data/r793_xmod_argpush_fieldread_t16/m1/m1.ww
Normal file
4
test/wcc/data/r793_xmod_argpush_fieldread_t16/m1/m1.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
// 16B sub-8-tail pair — the local side of the r793 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
4
test/wcc/data/r793_xmod_argpush_fieldread_t16/m2/m2.ww
Normal file
4
test/wcc/data/r793_xmod_argpush_fieldread_t16/m2/m2.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
// 24B same-leaf foreign pair — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
11
test/wcc/data/r793_xmod_argpush_recvpush_t12/case.ww
Normal file
11
test/wcc/data/r793_xmod_argpush_recvpush_t12/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 6
|
||||
// migrated from test/wcc/793_xmod_struct_argpush_collide_run.c: maxalign-4 12B {u32,u32,u32} sub-8 tail under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let s = m1.mk();
|
||||
return m1.consume(s);
|
||||
};
|
||||
5
test/wcc/data/r793_xmod_argpush_recvpush_t12/m1/m1.ww
Normal file
5
test/wcc/data/r793_xmod_argpush_recvpush_t12/m1/m1.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 12B maxalign-4 triple — the local side of the r793 t12 collision.
|
||||
package m1;
|
||||
export type pair = struct { a: u32, b: u32, c: u32 };
|
||||
export fn mk() pair = { return pair { a = 1: u32, b = 2: u32, c = 3: u32 }; };
|
||||
export fn consume(p: pair) i32 = { return (p.a + p.b + p.c): i32; };
|
||||
4
test/wcc/data/r793_xmod_argpush_recvpush_t12/m2/m2.ww
Normal file
4
test/wcc/data/r793_xmod_argpush_recvpush_t12/m2/m2.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
// 24B same-leaf foreign pair — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
11
test/wcc/data/r793_xmod_argpush_recvpush_t16/case.ww
Normal file
11
test/wcc/data/r793_xmod_argpush_recvpush_t16/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 107
|
||||
// migrated from test/wcc/793_xmod_struct_argpush_collide_run.c: #21 push+recv sites — 16B m1.pair vs 24B foreign same-leaf; count must come from stamped tinfo.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let s = m1.mk();
|
||||
return m1.consume(s);
|
||||
};
|
||||
5
test/wcc/data/r793_xmod_argpush_recvpush_t16/m1/m1.ww
Normal file
5
test/wcc/data/r793_xmod_argpush_recvpush_t16/m1/m1.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 16B sub-8-tail pair — the local side of the r793 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn consume(p: pair) i32 = { return (p.hi + (p.lo: u64)): i32; };
|
||||
4
test/wcc/data/r793_xmod_argpush_recvpush_t16/m2/m2.ww
Normal file
4
test/wcc/data/r793_xmod_argpush_recvpush_t16/m2/m2.ww
Normal file
@@ -0,0 +1,4 @@
|
||||
// 24B same-leaf foreign pair — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
14
test/wcc/data/r797_nestfill_box/case.ww
Normal file
14
test/wcc/data/r797_nestfill_box/case.ww
Normal file
@@ -0,0 +1,14 @@
|
||||
//ww:run-exit 66
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: cgstructlitfilltn nested-recursion pin — struct-literal field store with a nested literal; single-dot readback helpers per the open wwstage chained-read gaps.
|
||||
package main;
|
||||
type deep = struct { d0: u64, d1: u64 };
|
||||
type nst = struct { i0: u64, dp: deep };
|
||||
type box = struct { tag: u64, ir: nst };
|
||||
fn mkbox() box = { return box { tag = 0: u64, ir = nst { i0 = 0: u64, dp = deep { d0 = 0: u64, d1 = 0: u64 } } }; };
|
||||
fn sumdeep(d: deep) u64 = { return d.d0 + d.d1; };
|
||||
fn sumnst(n: nst) u64 = { return n.i0 + sumdeep(n.dp); };
|
||||
fn main() i32 = {
|
||||
let s = mkbox();
|
||||
s.ir = nst { i0 = 11: u64, dp = deep { d0 = 22: u64, d1 = 33: u64 } };
|
||||
return sumnst(s.ir): i32;
|
||||
};
|
||||
13
test/wcc/data/r797_xmod_layout_addrptr_pq/case.ww
Normal file
13
test/wcc/data/r797_xmod_layout_addrptr_pq/case.ww
Normal file
@@ -0,0 +1,13 @@
|
||||
//ww:run-exit 10
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: A1 arm — &p.v LEAQ offset over *struct; all-u64 pq isolates offset from the narrow-deref-store width family.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pq;
|
||||
dummy.a = 0: u64;
|
||||
let p = m1.mkpq();
|
||||
let q = &p.v;
|
||||
*q = 9: u64;
|
||||
return (p.a + p.v): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_addrptr_pq/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_addrptr_pq/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_addrptr_pq/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_addrptr_pq/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
13
test/wcc/data/r797_xmod_layout_addrval_pq/case.ww
Normal file
13
test/wcc/data/r797_xmod_layout_addrval_pq/case.ww
Normal file
@@ -0,0 +1,13 @@
|
||||
//ww:run-exit 10
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: A2 arm — &s.v over a value struct under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pq;
|
||||
dummy.a = 0: u64;
|
||||
let s = m1.mkq();
|
||||
let q = &s.v;
|
||||
*q = 9: u64;
|
||||
return (s.a + s.v): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_addrval_pq/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_addrval_pq/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_addrval_pq/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_addrval_pq/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
12
test/wcc/data/r797_xmod_layout_letcopy_t16/case.ww
Normal file
12
test/wcc/data/r797_xmod_layout_letcopy_t16/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 107
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: C1 arm — let-copy size from the COPY source's stamped tinfo (value coincides; byte-id is the net).
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let p1 = m1.mk();
|
||||
let p2 = p1;
|
||||
return (p2.hi + (p2.lo: u64)): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_letcopy_t16/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_letcopy_t16/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_letcopy_t16/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_letcopy_t16/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
11
test/wcc/data/r797_xmod_layout_ptrread_t16/case.ww
Normal file
11
test/wcc/data/r797_xmod_layout_ptrread_t16/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 107
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: R1 arm — *struct field read offset must come from stamped tinfo, not the foreign layout.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let p = m1.mkp();
|
||||
return (p.hi + (p.lo: u64)): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_ptrread_t16/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_ptrread_t16/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_ptrread_t16/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_ptrread_t16/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
12
test/wcc/data/r797_xmod_layout_ptrwrite_t16/case.ww
Normal file
12
test/wcc/data/r797_xmod_layout_ptrwrite_t16/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 109
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: W1 arm — p.lo store offset/width through *struct under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let p = m1.mkp();
|
||||
p.lo = 9: u16;
|
||||
return (p.hi + (p.lo: u64)): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_ptrwrite_t16/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_ptrwrite_t16/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_ptrwrite_t16/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_ptrwrite_t16/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
12
test/wcc/data/r797_xmod_layout_valwrite_t16/case.ww
Normal file
12
test/wcc/data/r797_xmod_layout_valwrite_t16/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 109
|
||||
// migrated from test/wcc/797_xmod_struct_field_layout_collide_run.c: W2 arm — s.lo store into a value struct under the same-leaf collision.
|
||||
package main;
|
||||
import m1;
|
||||
import m2;
|
||||
fn main() i32 = {
|
||||
let dummy: m2.pair;
|
||||
dummy.hi = 0: u64;
|
||||
let s = m1.mk();
|
||||
s.lo = 9: u16;
|
||||
return (s.hi + (s.lo: u64)): i32;
|
||||
};
|
||||
10
test/wcc/data/r797_xmod_layout_valwrite_t16/m1/m1.ww
Normal file
10
test/wcc/data/r797_xmod_layout_valwrite_t16/m1/m1.ww
Normal file
@@ -0,0 +1,10 @@
|
||||
// 16B pair + 16B all-u64 pq providers — the local side of the r797 collision.
|
||||
package m1;
|
||||
export type pair = struct { hi: u64, lo: u16 };
|
||||
export type pq = struct { a: u64, v: u64 };
|
||||
let g: pair = pair { hi = 100: u64, lo = 7: u16 };
|
||||
let gq: pq = pq { a = 1: u64, v = 7: u64 };
|
||||
export fn mk() pair = { return pair { hi = 100: u64, lo = 7: u16 }; };
|
||||
export fn mkp() *pair = { return &g; };
|
||||
export fn mkq() pq = { return pq { a = 1: u64, v = 7: u64 }; };
|
||||
export fn mkpq() *pq = { return &gq; };
|
||||
5
test/wcc/data/r797_xmod_layout_valwrite_t16/m2/m2.ww
Normal file
5
test/wcc/data/r797_xmod_layout_valwrite_t16/m2/m2.ww
Normal file
@@ -0,0 +1,5 @@
|
||||
// 24B same-leaf pair + pq — the name-keyed lookup's mis-resolution bait.
|
||||
package m2;
|
||||
export type pair = struct { hi: u64, mid: u64, lo: u64 };
|
||||
export type pq = struct { a: u64, b: u64, v: u64 };
|
||||
export fn use2(p: pair) i32 = { return (p.hi + p.mid + p.lo): i32; };
|
||||
Reference in New Issue
Block a user