mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parent
f00adb47f5
commit
6960cd156a
15
test/stage1/behavior/bugs/1607.zig
Normal file
15
test/stage1/behavior/bugs/1607.zig
Normal 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);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user