aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/3-expressions/dyn_array_cap_at_least_doubles.zc
blob: 5a55545a40a339ded349da363854163dfe211b58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// expect: 1/1/10/
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() {
	int[?] a = rt.new(int[?]);
	int c0 = cap(a);
	int i = 0;
	while (i < c0) { push(a, i); i++; }
	pn(cap(a) == c0);
	push(a, 99);
	pn(cap(a) >= 2 * c0);
	int j = 0;
	while (j < 9) { push(a, j); j++; }
	pn(len(a) - c0);
	return 0;
}
// zc0: skip