diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-23 19:58:13 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-23 19:58:13 -0700 |
| commit | aca42c62598523b92de7a51d3d84f2f2e5146536 (patch) | |
| tree | 18914e86afb1bfcbbd940198087e2c30782eecea /test/behavior/pointers.zig | |
| parent | 74ccd0c40b6871093f52769d342c1316e9ded0c0 (diff) | |
| download | zig-aca42c62598523b92de7a51d3d84f2f2e5146536.tar.gz zig-aca42c62598523b92de7a51d3d84f2f2e5146536.zip | |
Sema: fix comptime elem_ptr compare fixed address
Diffstat (limited to 'test/behavior/pointers.zig')
| -rw-r--r-- | test/behavior/pointers.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/behavior/pointers.zig b/test/behavior/pointers.zig index 297c9be7b8..5b9c3c8cf0 100644 --- a/test/behavior/pointers.zig +++ b/test/behavior/pointers.zig @@ -366,11 +366,10 @@ test "pointer sentinel with +inf" { } test "pointer to array at fixed address" { - if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO - - const array = @intToPtr(*volatile [1]u32, 0x10); + const array = @intToPtr(*volatile [2]u32, 0x10); // Silly check just to reference `array` try expect(@ptrToInt(&array[0]) == 0x10); + try expect(@ptrToInt(&array[1]) == 0x14); } test "pointer arithmetic affects the alignment" { |
