// #138: `continue` in a loop with a post-step must run the // post-step BEFORE re-testing the cond/bound. Migrated from // test/wcc/911_continue_run.c (value rows; cs==ww byte-id rides T2). // // Pre-fix the continue-target was the loop top, SKIPPING the post-step, so the // value that triggered continue never advanced → infinite loop. Both stages // emitted identical buggy asm, so the byte-id gate was blind; the runtime // readback (count/sum mismatch, or a hang) is the net. The 1-clause row pins // the no-post-step shape stays unchanged (cont-target = loop top). package continue_test; @test fn for3_skip_one() void = { let count: i32 = 0; for (let i: i32 = 0; i < 5; i += 1) { if (i == 2) { continue; }; count += 1; }; assert(count == 4); }; @test fn for3_skip_two() void = { let c: i32 = 0; for (let i: i32 = 0; i < 5; i += 1) { if (i == 1) { continue; }; if (i == 3) { continue; }; c += 10; }; assert(c == 30); }; @test fn range_skip() void = { let xs: [5]i32 = [10, 20, 30, 40, 50]; let sum: i32 = 0; for (let v .. xs) { if (v == 30) { continue; }; sum += v; }; assert(sum == 120); }; @test fn for1_continue_byteid() void = { let count: i32 = 0; let i: i32 = 0; for (i < 5) { let cur: i32 = i; i += 1; if (cur == 2) { continue; }; count += 1; }; assert(count == 4); };