aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/memdebug_report.zc
blob: 782a85eb6cfe9efdd502fe74d5a09f46677ccfe4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// expect: leak: line 8 3 words/107/
// spec 4.11: rt.memreport() returns the count of live recorded objects; W is the 3 words new asked for
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
memdebug on;
fn main() {
	unchecked {
		int* q = rt.new(3);
		int* r = rt.new(2);
		rt.free(r);
		pn(rt.memreport() * 100 + 7);
	}
	return 0;
}
// zc0: skip