Commit 6960cd156a
Changed files (1)
test
stage1
behavior
bugs
test/stage1/behavior/bugs/1607.zig
@@ -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);
+}
\ No newline at end of file