| author | |
| committer | |
| log | 437059f37cc4e7fb0f1398043a88b2d7a9363653 |
| tree | 3e7c5f555469bb5f4420a8a04251efd639683402 |
| parent | 0bf8617d963dc432ed0204b10285cc414becf2fd |
Currently, Zig semantically loads an array as a temporary when indexing
it. This means it cannot be guaranteed that only the requested element
is loaded; in particular, our self-hosted backends do not elide the load
of the full array, so this test case was crashing on self-hosted.1 files changed, 4 insertions(+), 3 deletions(-)
test/link/bss/main.zig+4-3| ... | ... | @@ -6,8 +6,9 @@ var buffer: [0x1000000]u64 = [1]u64{0} ** 0x1000000; |
| 6 | 6 | pub fn main() anyerror!void { |
| 7 | 7 | buffer[0x10] = 1; |
| 8 | 8 | try std.io.getStdOut().writer().print("{d}, {d}, {d}\n", .{ |
| 9 | buffer[0], | |
| 10 | buffer[0x10], | |
| 11 | buffer[0x1000000 - 1], | |
| 9 | // workaround the dreaded decl_val | |
| 10 | (&buffer)[0], | |
| 11 | (&buffer)[0x10], | |
| 12 | (&buffer)[0x1000000 - 1], | |
| 12 | 13 | }); |
| 13 | 14 | } |