stage1: Add missing bitcast when rendering var ptr

Some types require this extra bitcast, eg. structs or unions with extra
padding fields inserted by the compiler.

Fixes #7250
This commit is contained in:
LemonBoy authored and Andrew Kelley committed 2020-11-29 10:37:06 -08:00
1 parent 48660371a2
commit c80d196094
3 files changed
+38 -7

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ comptime {
_ = @import("behavior/bugs/7027.zig");
_ = @import("behavior/bugs/7047.zig");
_ = @import("behavior/bugs/7003.zig");
_ = @import("behavior/bugs/7250.zig");
_ = @import("behavior/bugs/394.zig");
_ = @import("behavior/bugs/421.zig");
_ = @import("behavior/bugs/529.zig");
+15
View File
@@ -0,0 +1,15 @@
const nrfx_uart_t = extern struct {
p_reg: [*c]u32,
drv_inst_idx: u8,
};
pub fn nrfx_uart_rx(p_instance: [*c]const nrfx_uart_t) void {}
threadlocal var g_uart0 = nrfx_uart_t{
.p_reg = 0,
.drv_inst_idx = 0,
};
test "reference a global threadlocal variable" {
_ = nrfx_uart_rx(&g_uart0);
}