aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/uninit_read.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/uninit_read.zc')
-rw-r--r--tests/errors/uninit_read.zc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/errors/uninit_read.zc b/tests/errors/uninit_read.zc
new file mode 100644
index 0000000..3a18a95
--- /dev/null
+++ b/tests/errors/uninit_read.zc
@@ -0,0 +1,9 @@
+namespace;
+include rt;
+
+// expect: x: used before it is initialized
+fn main() {
+ int x;
+ rt.put_n(x);
+ return 0;
+}