aboutsummaryrefslogtreecommitdiff
path: root/tests/icon/accept/loop_step.zc
blob: 7a0368e2927bb4729e6a290ccda0339f44687d64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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;
}