test: migrate 802_lenidx to @test + runww rejects, retire C twin (fold-3)
#19 len/index family: value rows -> test/lang/lenidx_test.ww (primitive-only asserts), 3 reject (callres/sliceexpr/strlit) -> runww //ww:error dual-stage carriers. byteid floor 52->53.
This commit is contained in:
13
test/wcc/data/lenidx_callres/case.ww
Normal file
13
test/wcc/data/lenidx_callres/case.ww
Normal file
@@ -0,0 +1,13 @@
|
||||
//ww:error "len() operand shape not place-resolvable (rule-7)"
|
||||
// Lifted from test/wcc/802_lenidx_run.c reject row "reject_callres"
|
||||
// (#10/#41/rule-7): len() over a CALL RESULT (`mk()`) is not a
|
||||
// place-resolvable operand and MUST loud-fail in both stages, not silently
|
||||
// return the data pointer as the length. The substring is the shared
|
||||
// diagnostic body — byte-identical on both stages (no file:line, no cstage
|
||||
// "ww: " prefix — both differ cs vs ww).
|
||||
package main;
|
||||
fn mk() []i64 = {
|
||||
let xs: []i64 = [10, 20, 30];
|
||||
return xs;
|
||||
};
|
||||
export fn main() i32 = { return len(mk()): i32; };
|
||||
12
test/wcc/data/lenidx_sliceexpr/case.ww
Normal file
12
test/wcc/data/lenidx_sliceexpr/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:error "len() operand shape not place-resolvable (rule-7)"
|
||||
// Lifted from test/wcc/802_lenidx_run.c reject row "reject_sliceexpr"
|
||||
// (#10/#41/rule-7): len() over a SLICING expression (`xs[1:3]`) is not a
|
||||
// place-resolvable operand and MUST loud-fail in both stages, not silently
|
||||
// return the data pointer as the length. The substring is the shared
|
||||
// diagnostic body — byte-identical on both stages (no file:line, no cstage
|
||||
// "ww: " prefix — both differ cs vs ww).
|
||||
package main;
|
||||
export fn main() i32 = {
|
||||
let xs: []i64 = [10, 20, 30, 40];
|
||||
return len(xs[1:3]): i32;
|
||||
};
|
||||
9
test/wcc/data/lenidx_strlit/case.ww
Normal file
9
test/wcc/data/lenidx_strlit/case.ww
Normal file
@@ -0,0 +1,9 @@
|
||||
//ww:error "len() operand shape not place-resolvable (rule-7)"
|
||||
// Lifted from test/wcc/802_lenidx_run.c reject row "reject_strlit"
|
||||
// (#10/#41/rule-7): len() over a string LITERAL is not a place-resolvable
|
||||
// operand and MUST loud-fail in both stages, not silently return the data
|
||||
// pointer as the length. The substring is the shared diagnostic body —
|
||||
// byte-identical on both stages (no file:line, no cstage "ww: " prefix —
|
||||
// both differ cs vs ww).
|
||||
package main;
|
||||
export fn main() i32 = { return len("abc"): i32; };
|
||||
Reference in New Issue
Block a user