authorgravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2019-04-07 03:18:51+02:00
committergravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2019-04-07 03:18:51+02:00
log6960cd156addc23492ddbb3c1b7627a63d2ba46a
tree9a5dc521310c1bb951b43ca3d6659c1a98a758fb
parentf00adb47f5c2b70496dac1c48f03236271b9bd57

Added regression test for #1607. fixes #1607


1 files changed, 15 insertions(+), 0 deletions(-)

test/stage1/behavior/bugs/1607.zig created+15
...@@ -0,0 +1,15 @@
1const std = @import("std");
2const testing = std.testing;
3
4const a = []u8{1,2,3};
5
6fn checkAddress(s: []const u8) void {
7 for (s) |*i, j| {
8 testing.expect(i == &a[j]);
9 }
10}
11
12test "slices pointing at the same address as global array." {
13 checkAddress(a);
14 comptime checkAddress(a);
15}
\ No newline at end of file