diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-12-20 09:44:10 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-20 15:47:43 -0500 |
| commit | f077c3c4ccd03f48f785ee812ab2c88c85792014 (patch) | |
| tree | c7b83ad5642f4064c200a9feade04bfb3134e3ad /test | |
| parent | 9daa7e1e193a693b4415d3db8031633236f28876 (diff) | |
| download | zig-f077c3c4ccd03f48f785ee812ab2c88c85792014.tar.gz zig-f077c3c4ccd03f48f785ee812ab2c88c85792014.zip | |
Fix comptime evaluation of runtime array access
Fix #3951
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage1/behavior/pointers.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stage1/behavior/pointers.zig b/test/stage1/behavior/pointers.zig index 1dd07c8986..e1004243fc 100644 --- a/test/stage1/behavior/pointers.zig +++ b/test/stage1/behavior/pointers.zig @@ -282,3 +282,9 @@ test "pointer sentinel with +inf" { S.doTheTest(); comptime S.doTheTest(); } + +test "pointer to array at fixed address" { + const array = @intToPtr(*volatile [1]u32, 0x10); + // Silly check just to reference `array` + expect(@ptrToInt(&array[0]) == 0x10); +} |
