aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/uninit_array_elems_ok.zc
blob: 00f4d1705bb177fb5ba168158ffa96a8c1328e1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
// expect: 6
// spec 4.1.5: writing every element by constant index sets the array
include rt;
fn main() {
	int[3] a;
	a[0] = 1; a[1] = 2; a[2] = 3;
	int s = 0;
	for (int i = 0; i < 3; i++) s = s + a[i];
	rt.put_n(s);
	return 0;
}