Files
ww/test/wcc/data/defdim_field_fill/case.ww
Hojun-Cho 973dd964c9 wcc: structlit repeat-fill dim off the stamped tinfo (rule 13)
cgstructlitfill's `...` total read only an N_INTLIT dim node, so a
def-dimensioned [N]T struct field under-filled: elements 1..N-1 kept
the zero-fill, silently, wwstage only (cstage and the tn twin read
the stamped array length). Read tichase(fi.tnode.type_).alen first;
the surface node stays as the fallback for unstamped shapes.
2026-08-09 00:40:23 +09:00

17 lines
560 B
Plaintext

//ww:run-exit 0
// structlit `...` repeat-fill on a def-dimensioned [N]T field: the
// fill total must come off the stamped array tinfo (rule 13). The
// N_INTLIT-only surface read left elements 1..N-1 zero (ww-only).
package main;
def N: int = 4;
type holder = struct { arr: [N]i64, tail: i64 };
export fn main() i32 = {
let h: holder = holder{ arr = [7...], tail = 9 };
if (h.arr[0] != 7) { return 1; };
if (h.arr[1] != 7) { return 2; };
if (h.arr[2] != 7) { return 3; };
if (h.arr[3] != 7) { return 4; };
if (h.tail != 9) { return 5; };
return 0;
};