aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/lend_branch.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/lend_branch.zc')
-rw-r--r--tests/errors/lend_branch.zc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/errors/lend_branch.zc b/tests/errors/lend_branch.zc
new file mode 100644
index 0000000..594047f
--- /dev/null
+++ b/tests/errors/lend_branch.zc
@@ -0,0 +1,6 @@
+namespace;
+include rt;
+
+// expect: buf: is lent to global sink; assign the global again before the block that lent it ends
+word sink;
+fn main() { word buf = rt.new(4); sink = m*buf; if (buf[0]) { sink = 0; } return 0; }