// idx_dot_src_aggregate_runonly_test — #11b sub-8-tail anti-clobber through a // LOCAL [N] array. The fix's MOVL (not MOVQ) tail // is VALUE-verified here: the dropped tail would read the poison 9, and a tail // WIDENED to MOVQ would write bytes 8..15 and smash the adjacent g at +12 — both // caught by asserting f.c AND g. Exit-correct under BOTH stages. // // _runonly (excluded from the test-lang-byteid T2 gate) because a local // [N] trips a SEPARATE PRE-EXISTING let-array slotsize cs!=ww // FRAME divergence — ww sizes the array element by slotsize (s12 slot-padded), // cstage by natural size — that PREDATES and is INDEPENDENT of #11b: empirically // the #11b receive INSTRUCTIONS are byte-identical (both stages emit `MOVQ // (SI),AX` then the `MOVL 8(SI),AX` tail); only the container's frame SIZE and // the BP-relative offsets shift ($48 vs $64). The byte-id twin // (idx_dot_src_aggregate_test) covers the same sub-8-tail shape via global- // backed bases, where the slotsize bug does not bite (task #9). package idx_dot_src_aggregate_runonly_test; type t12 = struct { a: i32, b: i32, c: i32 }; type s12 = struct { f: t12, g: i32 }; fn one() i64 = { return 1i64; }; @test fn subtail_local_ident_const() void = { let a: [2]s12 = [s12{f=t12{a=9i32,b=9i32,c=9i32},g=9i32}, s12{f=t12{a=9i32,b=9i32,c=9i32},g=9i32}]; let src: t12 = t12{a=10i32, b=20i32, c=30i32}; a[1].f = src; assert(a[1].f.a == 10i32); assert(a[1].f.b == 20i32); assert(a[1].f.c == 30i32); assert(a[1].g == 9i32); assert(a[0].f.a == 9i32); }; @test fn subtail_local_ident_runtime() void = { let a: [2]s12 = [s12{f=t12{a=9i32,b=9i32,c=9i32},g=9i32}, s12{f=t12{a=9i32,b=9i32,c=9i32},g=9i32}]; let src: t12 = t12{a=10i32, b=20i32, c=30i32}; a[one()].f = src; assert(a[1].f.a == 10i32); assert(a[1].f.b == 20i32); assert(a[1].f.c == 30i32); assert(a[1].g == 9i32); };