diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-06 13:48:04 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-06 13:48:04 -0500 |
| commit | b1775ca168e0bcfba6753346c5226881da49c6c4 (patch) | |
| tree | dc8a194940eca72dc20b692d170a9c1d2a6a4a31 /test/compile_errors.zig | |
| parent | 8c6fa982cd0a02775264b616c37da9907cc603bb (diff) | |
| download | zig-b1775ca168e0bcfba6753346c5226881da49c6c4.tar.gz zig-b1775ca168e0bcfba6753346c5226881da49c6c4.zip | |
thread local storage working for linux x86_64
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 30d9ca5d70..acd1eada06 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,25 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "threadlocal qualifier on const", + \\threadlocal const x: i32 = 1234; + \\export fn entry() i32 { + \\ return x; + \\} + , + ".tmp_source.zig:1:13: error: threadlocal variable cannot be constant", + ); + + cases.add( + "threadlocal qualifier on local variable", + \\export fn entry() void { + \\ threadlocal var x: i32 = 1234; + \\} + , + ".tmp_source.zig:2:5: error: function-local variable 'x' cannot be threadlocal", + ); + + cases.add( "@bitCast same size but bit count mismatch", \\export fn entry(byte: u8) void { \\ var oops = @bitCast(u7, byte); |
