disable failing behavior tests with -ofmt=c -target x86_64-windows

and enable CI checks for the C backend on Windows.
This commit is contained in:
Andrew Kelley 2022-12-06 21:48:48 -07:00
parent 53a9ee699a
commit 1310ef7577
5 changed files with 59 additions and 60 deletions

View File

@ -68,7 +68,6 @@ test {
_ = @import("behavior/bugs/7003.zig");
_ = @import("behavior/bugs/7047.zig");
_ = @import("behavior/bugs/7187.zig");
_ = @import("behavior/bugs/7250.zig");
_ = @import("behavior/bugs/9584.zig");
_ = @import("behavior/bugs/10138.zig");
_ = @import("behavior/bugs/10147.zig");
@ -182,6 +181,7 @@ test {
_ = @import("behavior/switch_prong_err_enum.zig");
_ = @import("behavior/switch_prong_implicit_cast.zig");
_ = @import("behavior/this.zig");
_ = @import("behavior/threadlocal.zig");
_ = @import("behavior/translate_c_macros.zig");
_ = @import("behavior/truncate.zig");
_ = @import("behavior/try.zig");

View File

@ -711,20 +711,6 @@ test "comptime manyptr concatenation" {
try expect(expected[len] == 0);
}
test "thread local variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
const S = struct {
threadlocal var t: i32 = 1234;
};
S.t += 1;
try expect(S.t == 1235);
}
test "result location is optional inside error union" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
@ -740,20 +726,6 @@ fn maybe(x: bool) anyerror!?u32 {
};
}
test "pointer to thread local array" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
const s = "Hello world";
std.mem.copy(u8, buffer[0..], s);
try std.testing.expectEqualSlices(u8, buffer[0..], s);
}
threadlocal var buffer: [11]u8 = undefined;
test "auto created variables have correct alignment" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO

View File

@ -1,24 +0,0 @@
const builtin = @import("builtin");
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 {
_ = p_instance;
}
threadlocal var g_uart0 = nrfx_uart_t{
.p_reg = 0,
.drv_inst_idx = 0,
};
test "reference a global threadlocal variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
_ = nrfx_uart_rx(&g_uart0);
}

View File

@ -0,0 +1,58 @@
const std = @import("std");
const builtin = @import("builtin");
const expect = std.testing.expect;
test "thread local variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
const S = struct {
threadlocal var t: i32 = 1234;
};
S.t += 1;
try expect(S.t == 1235);
}
test "pointer to thread local array" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
const s = "Hello world";
std.mem.copy(u8, buffer[0..], s);
try std.testing.expectEqualSlices(u8, buffer[0..], s);
}
threadlocal var buffer: [11]u8 = undefined;
test "reference a global threadlocal variable" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
_ = nrfx_uart_rx(&g_uart0);
}
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 {
_ = p_instance;
}
threadlocal var g_uart0 = nrfx_uart_t{
.p_reg = 0,
.drv_inst_idx = 0,
};

View File

@ -682,13 +682,6 @@ pub fn addPkgTests(
} else false;
if (!want_this_mode) continue;
if (test_target.backend) |backend| {
if (backend == .stage2_c and builtin.os.tag == .windows) {
// https://github.com/ziglang/zig/issues/12415
continue;
}
}
const libc_prefix = if (test_target.target.getOs().requiresLibC())
""
else if (test_target.link_libc)