diff options
Diffstat (limited to 'tests/icon/accept/loop_step.zc')
| -rw-r--r-- | tests/icon/accept/loop_step.zc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/icon/accept/loop_step.zc b/tests/icon/accept/loop_step.zc new file mode 100644 index 0000000..7a0368e --- /dev/null +++ b/tests/icon/accept/loop_step.zc @@ -0,0 +1,12 @@ +include rt; +include run; +include icon; +fn main() { + let q = run.tokens("int n = 0; while (n < limit) { n += 1; } if (n == 4) { n *= 2; } else { n = 99; } return n;"); + let frame = icon.begin(q); + icon.set_global(frame, "limit", 4); + icon.resume(frame, 3); rt.put_n(icon.local(frame, "n")); rt.put_c(' '); + icon.resume(frame, 30); rt.put_n(icon.result(frame)); rt.put_c(' '); rt.put_n(icon.state(frame)); rt.put_c(10); + icon.close(d*frame); + return 0; +} |
