aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-12-15 19:25:41 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-12-15 16:23:42 -0500
commit59de23dfa010c5556f79fbb8b4c637c8d150fd88 (patch)
tree0b54e104539ef236d979d26bae14283f49ef44ea /test
parentb169f7b0d51fa9e7cf570479079369b9736093ff (diff)
downloadzig-59de23dfa010c5556f79fbb8b4c637c8d150fd88.tar.gz
zig-59de23dfa010c5556f79fbb8b4c637c8d150fd88.zip
Don't assume TLS storage has a fixed address
Fixes #3433
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/misc.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stage1/behavior/misc.zig b/test/stage1/behavior/misc.zig
index dd3ad29878..0b29189cde 100644
--- a/test/stage1/behavior/misc.zig
+++ b/test/stage1/behavior/misc.zig
@@ -773,3 +773,11 @@ test "result location is optional inside error union" {
const x = maybe(true) catch unreachable;
expect(x.? == 42);
}
+
+threadlocal var buffer: [11]u8 = undefined;
+
+test "pointer to thread local array" {
+ const s = "Hello world";
+ std.mem.copy(u8, buffer[0..], s);
+ std.testing.expectEqualSlices(u8, buffer[0..], s);
+}