Added regression test for #1607. fixes #1607

This commit is contained in:
Jimmi Holst Christensen 2019-04-07 03:18:51 +02:00
parent f00adb47f5
commit 6960cd156a

View File

@ -0,0 +1,15 @@
const std = @import("std");
const testing = std.testing;
const a = []u8{1,2,3};
fn checkAddress(s: []const u8) void {
for (s) |*i, j| {
testing.expect(i == &a[j]);
}
}
test "slices pointing at the same address as global array." {
checkAddress(a);
comptime checkAddress(a);
}