| author | |
| committer | |
| log | b642fa24a67f88082b768d39e443b03c7446be76 |
| tree | 9f63c66c0f70cf297e08a5dd383b23989b00e8a6 |
| parent | b0dc61fae26ab37c41300a8e817cef45992669bb |
3 files changed, 17 insertions(+), 6 deletions(-)
src/codegen.zig+14| ... | ... | @@ -303,6 +303,20 @@ pub fn generateSymbol( |
| 303 | 303 | }, |
| 304 | 304 | }, |
| 305 | 305 | .Pointer => switch (typed_value.val.tag()) { |
| 306 | .zero, .one, .int_u64, .int_big_positive => { | |
| 307 | switch (target.cpu.arch.ptrBitWidth()) { | |
| 308 | 32 => { | |
| 309 | const x = typed_value.val.toUnsignedInt(); | |
| 310 | mem.writeInt(u32, try code.addManyAsArray(4), @intCast(u32, x), endian); | |
| 311 | }, | |
| 312 | 64 => { | |
| 313 | const x = typed_value.val.toUnsignedInt(); | |
| 314 | mem.writeInt(u64, try code.addManyAsArray(8), x, endian); | |
| 315 | }, | |
| 316 | else => unreachable, | |
| 317 | } | |
| 318 | return Result{ .appended = {} }; | |
| 319 | }, | |
| 306 | 320 | .variable => { |
| 307 | 321 | const decl = typed_value.val.castTag(.variable).?.data.owner_decl; |
| 308 | 322 | return lowerDeclRef(bin_file, src_loc, typed_value, decl, code, debug_output, reloc_info); |
test/behavior/basic.zig+1-1| ... | ... | @@ -719,7 +719,7 @@ test "string concatenation" { |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | test "thread local variable" { |
| 722 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO | |
| 722 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 723 | 723 | |
| 724 | 724 | const S = struct { |
| 725 | 725 | threadlocal var t: i32 = 1234; |
test/behavior/bugs/7250.zig+2-5| ... | ... | @@ -14,10 +14,7 @@ threadlocal var g_uart0 = nrfx_uart_t{ |
| 14 | 14 | }; |
| 15 | 15 | |
| 16 | 16 | test "reference a global threadlocal variable" { |
| 17 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | |
| 18 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 19 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | |
| 20 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 21 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | |
| 17 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | |
| 18 | ||
| 22 | 19 | _ = nrfx_uart_rx(&g_uart0); |
| 23 | 20 | } |