aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conformance')
-rw-r--r--tests/conformance/6-ownership/infer_owned_return_before_body.zc8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/infer_owned_return_before_body.zc b/tests/conformance/6-ownership/infer_owned_return_before_body.zc
new file mode 100644
index 0000000..8db6b45
--- /dev/null
+++ b/tests/conformance/6-ownership/infer_owned_return_before_body.zc
@@ -0,0 +1,8 @@
+// expect: 5/0/
+// spec 6.8
+include rt;
+memdebug on;
+int use() { int* q = mk(); int v = *q; return v; }
+int* mk() { int* p = rt.new(int); *p = 5; return p; }
+fn main() { rt.put_n(use()); rt.put_c(10); rt.put_n(rt.memreport()); rt.put_c(10); }
+// zc0: skip