zig/test/behavior/bugs/1486.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

11 lines
233 B
Zig

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