| ... | @@ -748,3 +748,16 @@ test "array init with no result location has result type" { | ... | @@ -748,3 +748,16 @@ test "array init with no result location has result type" { |
| 748 | try expect(x.foo[0] == 10); | 748 | try expect(x.foo[0] == 10); |
| 749 | try expect(x.foo[1] == 20); | 749 | try expect(x.foo[1] == 20); |
| 750 | } | 750 | } |
| | 751 | |
| | 752 | test "slicing array of zero-sized values" { |
| | 753 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 754 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 755 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 756 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| | 757 | |
| | 758 | var arr: [32]u0 = undefined; |
| | 759 | for (arr[0..]) |*zero| |
| | 760 | zero.* = 0; |
| | 761 | for (arr[0..]) |zero| |
| | 762 | try expect(zero == 0); |
| | 763 | } |