aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/uninit_do_loop_ok.zc
blob: 4f0930245a5ad7820533d8bdbe17fe47305dbe91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
// expect: 1/
// spec 4.1.5: do/while always runs once, so an assignment in the body initializes
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() {
	int x;
	int n = 0;
	do { x = 1; n = 0; } while (n);
	pn(x);
	return 0;
}
// zc0: skip