summaryrefslogtreecommitdiff
path: root/tests/features/test_zero_init.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features/test_zero_init.zc')
-rw-r--r--tests/features/test_zero_init.zc27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/features/test_zero_init.zc b/tests/features/test_zero_init.zc
new file mode 100644
index 0000000..ba5c209
--- /dev/null
+++ b/tests/features/test_zero_init.zc
@@ -0,0 +1,27 @@
+
+def SIZE = 5;
+
+struct Point {
+ x: int;
+ y: int;
+}
+
+fn main() {
+ let zeros: [int; SIZE];
+
+ if (zeros[0] != 0) return 1;
+ if (zeros[1] != 0) return 1;
+ if (zeros[2] != 0) return 1;
+ if (zeros[3] != 0) return 1;
+ if (zeros[4] != 0) return 1;
+
+ let p: Point;
+ if (p.x != 0) return 2;
+ if (p.y != 0) return 2;
+
+ let b: bool;
+ if (b) { return 3; }
+
+ println "SUCCESS";
+ return 0;
+}