Files
ww/test/wcc/data/r805_compound_ops/case.ww
Hojun-Cho f6628b985e test: migrate 24 residual carriers into the fixture corpus
Audit-driven migrate-and-retire wave (one read-only auditor per
carrier batch, verdicts row-checked through the full corpus gate):
every retired carrier's assertions are now owned by declarative
fixtures or an existing owner. 238 new fixtures land (corpus 1,239 ->
1,477; cells 2,954), covering enum/str/slice/tagged array elements,
inferred-length arrays, global slice/str zero-init and literals,
global array/pointer field reads and stores, struct-literal slice
fields, struct returns, float arithmetic, size/int limits, sort and
log-vstream behavior, place-addressed stores, and append places.
Rejection rows STRENGTHEN the old nonzero-exit checks to required
diagnostic fragments; all byte-id claims fold into the blanket
test-data-byteid sweep (now 1,142 compared, 0 pinned-divergent).
Four carriers were fully redundant with existing fixtures/lang tests
(749, 722, 765, and 771's byteid rows) and retire without new rows.
Native carriers 171 -> 147 (residual 135 -> 111).
2026-08-08 01:29:15 +09:00

32 lines
1014 B
Plaintext

//ww:run-exit 44
package main;
type t = struct { s: int, u: size, n: i64, m: i64 };
fn divs(ts: *[]t, i: size) void = { (*ts)[i].s /= 4; };
fn modn(ts: *[]t, i: size) void = { (*ts)[i].n %= 5; };
fn divu(ts: *[]t, i: size) void = { (*ts)[i].u /= 3; };
fn shl(ts: *[]t, i: size) void = { (*ts)[i].u <<= 2; };
fn addm(ts: *[]t, i: size) void = { (*ts)[i].m += 7; };
fn subm(ts: *[]t, i: size) void = { (*ts)[i].m -= 2; };
fn mulm(ts: *[]t, i: size) void = { (*ts)[i].m *= 3; };
fn orm(ts: *[]t, i: size) void = { (*ts)[i].m |= 4; };
export fn main() i32 = {
let ts: []t = [];
append(ts, t { s = 4, u = 5, n = 6, m = 1 });
append(ts, t { s = -12, u = 9, n = -13, m = 4 });
divs(&ts, 1);
if (ts[1].s != -3) { return 1; };
modn(&ts, 1);
if (ts[1].n != -3) { return 2; };
divu(&ts, 1);
if (ts[1].u != 3) { return 3; };
shl(&ts, 1);
if (ts[1].u != 12) { return 4; };
addm(&ts, 1);
subm(&ts, 1);
mulm(&ts, 1);
orm(&ts, 1);
if (ts[1].m != 31) { return 5; };
if (ts[0].s != 4) { return 6; };
return 44;
};