mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
16 lines
267 B
Zig
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());
|
||
|
}
|