aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/3-expressions/dyn_array_resize.zc
blob: c0ae4f5ee7f0e35d6023415bcc4ef596745e5ac1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// expect: 5/0/0/3/7/2/
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() {
	int[?] a = {7, 8, 9};
	resize(a, 5);
	pn(len(a)); pn(a[3]); pn(a[4]);
	resize(a, 1);
	a.resize(3);
	pn(len(a));
	pn(a[0]);
	resize(a, 2);
	pn(len(a));
	return 0;
}
// zc0: skip