aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/6-ownership/back_link_cycle.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conformance/6-ownership/back_link_cycle.zc')
-rw-r--r--tests/conformance/6-ownership/back_link_cycle.zc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/back_link_cycle.zc b/tests/conformance/6-ownership/back_link_cycle.zc
new file mode 100644
index 0000000..fc47100
--- /dev/null
+++ b/tests/conformance/6-ownership/back_link_cycle.zc
@@ -0,0 +1,17 @@
+// expect: 0/
+// spec 6.6
+include rt;
+struct node { int value; node* prev; node* next; };
+fn main() {
+ memdebug on;
+ for (int round = 0; round < 50; round++) {
+ node* a = rt.new(node);
+ node* b = rt.new(node);
+ a.next = b;
+ b.prev = a;
+ a.value = round;
+ b.value = b.prev.value;
+ }
+ rt.put_n(rt.memreport()); rt.put_c(10);
+}
+// zc0: skip