aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/8-runtime/o3_receiver_method_enter.zc
blob: 3a8d92db2b23d58cb45dbfec942f1d95b0ee035a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// expect: 1003 1003 0/
// spec 4.10.3: an o3 function called from normal code as a receiver method (run.method) enters the region like a direct call, so no collection runs inside it
include rt;
o3 int depth_of(int[?] v) { int i = 0, s = 0; while (i < len(v)) { s = s + v[i]; i++; } return rt.o3_depth * 1000 + s; }
run.method("depth_of", depth_of);
fn main() {
	int[?] v = rt.new(int[?]); v.push(1); v.push(2);
	rt.put_n(depth_of(v)); rt.put_c(32);
	rt.put_n(v.depth_of()); rt.put_c(32);
	rt.put_n(rt.o3_depth); rt.put_c(10);
	return 0;
}
// zc0: skip