test: port 732_def_const_fold residue to corpus fixtures
732_def_const_fold.c -> r732_def_xmod_fold (run-exit 42; stronger than the carrier's DATA-row grep — links AND reads the folded cross-module value), r732_def_xmod_cycle (error 'def value: reference chain too deep', upgrading the needle-less exit!=0 check). The five same-module exec rows and both same-module fail-loud rows were already owned by the r732_def_* fixtures; their cs-vs-ww byte identity rides test-data-byteid, which now also covers the xmod fold row. The timeout-124 hang distinction devolves to the wwfixture harness timeout.
This commit is contained in:
9
test/wcc/data/r732_def_xmod_cycle/case.ww
Normal file
9
test/wcc/data/r732_def_xmod_cycle/case.ww
Normal file
@@ -0,0 +1,9 @@
|
||||
//ww:error "def value: reference chain too deep"
|
||||
// migrated from test/wcc/732_def_const_fold.c: cross-module def cycle (a.J -> b.K -> a.J) must fail loud, not hang or emit silently.
|
||||
package a;
|
||||
import b;
|
||||
export def J: i32 = b.K;
|
||||
package b;
|
||||
import a;
|
||||
export def K: i32 = a.J;
|
||||
export fn main() i32 = { return 0; };
|
||||
12
test/wcc/data/r732_def_xmod_fold/case.ww
Normal file
12
test/wcc/data/r732_def_xmod_fold/case.ww
Normal file
@@ -0,0 +1,12 @@
|
||||
//ww:run-exit 42
|
||||
// migrated from test/wcc/732_def_const_fold.c: cross-module def-RHS fold (`def K = a.J + 1`) must emit the folded DATA row; run-exit links AND reads the value.
|
||||
package a;
|
||||
export def J: i32 = 41;
|
||||
package b;
|
||||
import a;
|
||||
def K: i32 = a.J + 1;
|
||||
export fn main() i32 = {
|
||||
let k: i32 = K;
|
||||
if (k == 42) { return 42; };
|
||||
return 1;
|
||||
};
|
||||
Reference in New Issue
Block a user