test: migrate 948_idx_compound to @test + runww rejects, retire C twin (fold-3)
#133 indexed-scalar compound-assign. The 21 rows split by observability: 18 value rows -> test/lang/idx_compound_test.ww (one @test fn each, primitive-only asserts, slot-poison + neighbor-unchanged read-back); 3 reject rows -> test/wcc/data/idx_compound_{float_indexed,str_indexed, chained_ptr_float}/case.ww as //ww:error, asserting BOTH stages reject on the shared diagnostic body (cstage's leading prefix excluded). The C twin is retired; its coverage is a strict superset of the original rows. First reject-bearing fold-3 migration -- validates the runww dual-stage home end to end. LANGBYTEID_EXPECTED_MIN 49 -> 50.
This commit is contained in:
12
test/wcc/data/idx_compound_chained_ptr_float/case.ww
Normal file
12
test/wcc/data/idx_compound_chained_ptr_float/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:error "chained-ptr-field compound on float element not wired (#133/rule-7)"
|
||||
// Lifted from test/wcc/948_idx_compound_run.c reject row "he_float_chained_ptr"
|
||||
// (#133-expanded rule-7): a compound assign on a chained-pointer FLOAT field
|
||||
// (d.i.v += ...) is unwired in both stages and MUST loud-fail. The substring is
|
||||
// the shared diagnostic body up to "(#133/rule-7)" — cstage appends an extra
|
||||
// "; field='v'" that wwstage omits, so the cited body is the most specific form
|
||||
// present on BOTH stages (no file:line / "ww: " prefix, which differ cs vs ww).
|
||||
package main;
|
||||
type t = struct { v: f64 };
|
||||
type w = struct { i: *t };
|
||||
fn bad(d: *w) void = { d.i.v += 1.5; };
|
||||
export fn main() i32 = { return 0; };
|
||||
13
test/wcc/data/idx_compound_float_indexed/case.ww
Normal file
13
test/wcc/data/idx_compound_float_indexed/case.ww
Normal file
@@ -0,0 +1,13 @@
|
||||
//ww:error "indexed-lvalue compound on float element not wired (#133/rule-7)"
|
||||
// Lifted from test/wcc/948_idx_compound_run.c reject row "he_float_indexed"
|
||||
// (#133-expanded rule-7): a compound assign on an indexed FLOAT element is
|
||||
// unwired in both stages and MUST loud-fail, not silently fall through to the
|
||||
// default break (silent miscompile). The substring is the FULL shared
|
||||
// diagnostic body — byte-identical on both stages (no file:line prefix, no
|
||||
// cstage "ww: " prefix — both differ cs vs ww).
|
||||
package main;
|
||||
export fn main() i32 = {
|
||||
let a: [4]f64 = [1.0, 2.0, 3.0, 4.0];
|
||||
a[0] += 1.5;
|
||||
return 0;
|
||||
};
|
||||
13
test/wcc/data/idx_compound_str_indexed/case.ww
Normal file
13
test/wcc/data/idx_compound_str_indexed/case.ww
Normal file
@@ -0,0 +1,13 @@
|
||||
//ww:error "indexed-lvalue compound on str element not wired (#133/rule-7)"
|
||||
// Lifted from test/wcc/948_idx_compound_run.c reject row "he_str_indexed"
|
||||
// (#133-expanded rule-7): a compound assign on an indexed STR element is
|
||||
// unwired in both stages and MUST loud-fail. The substring is the FULL shared
|
||||
// diagnostic body — byte-identical on both stages — pinned to "str element" so
|
||||
// it cannot also match the float row (no file:line / "ww: " prefix, which
|
||||
// differ cs vs ww).
|
||||
package main;
|
||||
export fn main() i32 = {
|
||||
let a: [4]str = ["a", "b", "c", "d"];
|
||||
a[0] += "x";
|
||||
return 0;
|
||||
};
|
||||
Reference in New Issue
Block a user