zig/test/link/macho/tls/main.zig
Jakub Konka d84282174c link-test: move tls test to macho/tls
This test was always really testing correct behavior of our in-house
MachO linker to begin with.
2022-08-17 09:00:26 +02:00

16 lines
267 B
Zig

const std = @import("std");
extern threadlocal var a: i32;
extern fn getA() i32;
fn getA2() i32 {
return a;
}
test {
a = 2;
try std.testing.expect(getA() == 2);
try std.testing.expect(2 == getA2());
try std.testing.expect(getA() == getA2());
}