test: migrate Fam4 static-init/DATA-emit value tests to @test (#30)
Continues the test-arch tower past Fam8-13. 11 module-level static-init / DATA-emit value drivers move from test/wcc/*_run.c into @test row- tables under test/lang/; every classification empirically re-probed at HEAD (refuting two stale worklist tags). - value rows -> test/lang/*_test.ww (11 files) - reject rows -> runww //ww:error carriers (3, dual-stage non-vacuous; 947 const-divzero confirmed a both-stage compile-reject, not run-exit) - 840_zeroinit, 944_array_zeroinit, 989_arrlit_tail_zero kept as byte-id .c pins (zero-over-dirtied-frame / DATAW-length is byte-id-blind to a runtime @test; #263), mutation-gated - repoint two stale comment refs to deleted test names (719, 989_structlocal_frame) Migrated static-init @test ride the cs==ww T2 byte-id gate, preserving DATA-emit byte-id. 2D global-struct array-field read (#137/#150) confirmed cs==ww + correct at HEAD. Coverage parity verified row-by-row; two-round reviewed. Floor ratchet follows.
This commit is contained in:
44
test/lang/strarray_static_test.ww
Normal file
44
test/lang/strarray_static_test.ww
Normal file
@@ -0,0 +1,44 @@
|
||||
// strarray_static_test — module-level [N]str static-init: per-element .len
|
||||
// header sums + per-element .ptr RELOC dereferenced to chars. Migrated from
|
||||
// test/wcc/919_strarray_static_run.c. cstage build+run was T1; cs==ww .s byte-id
|
||||
// rides T2 (test-lang-byteid).
|
||||
//
|
||||
// drew: assert THROUGH the per-element .ptr deref (not just .len) — a reloc-blind
|
||||
// .len-only check would miss a wrong/swapped element relocation. The empty-slot
|
||||
// and `...` repeat-suffix rows pin that an empty element doesn't shift the
|
||||
// following element's reloc and that the repeat-fill row's DATAR resolves to the
|
||||
// last explicit element.
|
||||
|
||||
package strarray_static_test;
|
||||
|
||||
let TLEN: [3]str = ["ab", "cde", "f"];
|
||||
let TPTR: [3]str = ["A", "B", "C"];
|
||||
let TVAR: [3]str = ["xx", "yyy", "z"];
|
||||
let TEMP: [2]str = ["", "Z"];
|
||||
let TREP: [3]str = ["X", "Y"...];
|
||||
|
||||
@test fn strtab_len() void = {
|
||||
assert((TLEN[0].len + TLEN[1].len + TLEN[2].len): i32 == 6);
|
||||
};
|
||||
|
||||
@test fn strtab_ptr_elem2() void = {
|
||||
let p: *u8 = TPTR[2].ptr;
|
||||
assert((*p): i32 == 67);
|
||||
};
|
||||
|
||||
@test fn strtab_ptr_varindex() void = {
|
||||
let i: i32 = 1;
|
||||
let p: *u8 = TVAR[i].ptr;
|
||||
assert((*p): i32 == 121);
|
||||
};
|
||||
|
||||
@test fn strtab_empty_then_ptr() void = {
|
||||
assert(TEMP[0].len == 0);
|
||||
let p: *u8 = TEMP[1].ptr;
|
||||
assert((*p): i32 == 90);
|
||||
};
|
||||
|
||||
@test fn strtab_repeat_suffix() void = {
|
||||
let p: *u8 = TREP[2].ptr;
|
||||
assert((*p): i32 == 89);
|
||||
};
|
||||
Reference in New Issue
Block a user