zig/test/cases/bugs/1486.zig
Andrew Kelley 2e27407161
stage1: unify 2 implementations of pointer deref
I found out there were accidentally two code paths
in zig ir for pointer dereference. So this should
fix a few bugs.

closes #1486
2018-09-21 18:47:12 -04:00

12 lines
232 B
Zig

const assert = @import("std").debug.assert;
const ptr = &global;
var global: u64 = 123;
test "constant pointer to global variable causes runtime load" {
global = 1234;
assert(&global == ptr);
assert(ptr.* == 1234);
}