diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 10:20:32 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 10:20:40 +0000 |
| commit | 08247ead8ecd05d892b98bfb12ed807bcfebfc5c (patch) | |
| tree | de10d620840075c96aa7fdcbc2bda6745ca22877 /tests/features | |
| parent | 86ae08ff28ee47c57546c487b0bdaab27c4ab5ad (diff) | |
Fix zero init bug
Diffstat (limited to 'tests/features')
| -rw-r--r-- | tests/features/test_zero_init.zc | 27 |
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; +} |
