aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/6-ownership/back_link_alias.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conformance/6-ownership/back_link_alias.zc')
-rw-r--r--tests/conformance/6-ownership/back_link_alias.zc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/back_link_alias.zc b/tests/conformance/6-ownership/back_link_alias.zc
new file mode 100644
index 0000000..58db710
--- /dev/null
+++ b/tests/conformance/6-ownership/back_link_alias.zc
@@ -0,0 +1,6 @@
+// expect error: b: is an owned object and can't be copied into another variable
+// spec 6.6
+include rt;
+struct node { int value; node* prev; node* next; };
+fn main() { node* p; { node* a = rt.new(node); node* b = rt.new(node); a.next = b; b.prev = a; p = b; } rt.put_n(p.prev.value); }
+// zc0: skip