authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 21:48:48-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-07 04:01:04-05:00
log1310ef75777209f061bfd61473db75911538b5ff
tree2c2c07b20a61089315e9f557c933697b28c77e3c
parent53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c

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

and enable CI checks for the C backend on Windows.

5 files changed, 59 insertions(+), 60 deletions(-)

test/behavior.zig+1-1
...@@ -68,7 +68,6 @@ test {...@@ -68,7 +68,6 @@ test {
68 _ = @import("behavior/bugs/7003.zig");68 _ = @import("behavior/bugs/7003.zig");
69 _ = @import("behavior/bugs/7047.zig");69 _ = @import("behavior/bugs/7047.zig");
70 _ = @import("behavior/bugs/7187.zig");70 _ = @import("behavior/bugs/7187.zig");
71 _ = @import("behavior/bugs/7250.zig");
72 _ = @import("behavior/bugs/9584.zig");71 _ = @import("behavior/bugs/9584.zig");
73 _ = @import("behavior/bugs/10138.zig");72 _ = @import("behavior/bugs/10138.zig");
74 _ = @import("behavior/bugs/10147.zig");73 _ = @import("behavior/bugs/10147.zig");
...@@ -182,6 +181,7 @@ test {...@@ -182,6 +181,7 @@ test {
182 _ = @import("behavior/switch_prong_err_enum.zig");181 _ = @import("behavior/switch_prong_err_enum.zig");
183 _ = @import("behavior/switch_prong_implicit_cast.zig");182 _ = @import("behavior/switch_prong_implicit_cast.zig");
184 _ = @import("behavior/this.zig");183 _ = @import("behavior/this.zig");
184 _ = @import("behavior/threadlocal.zig");
185 _ = @import("behavior/translate_c_macros.zig");185 _ = @import("behavior/translate_c_macros.zig");
186 _ = @import("behavior/truncate.zig");186 _ = @import("behavior/truncate.zig");
187 _ = @import("behavior/try.zig");187 _ = @import("behavior/try.zig");
test/behavior/basic.zig-28
...@@ -711,20 +711,6 @@ test "comptime manyptr concatenation" {...@@ -711,20 +711,6 @@ test "comptime manyptr concatenation" {
711 try expect(expected[len] == 0);711 try expect(expected[len] == 0);
712}712}
713713
714test "thread local variable" {
715 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
716 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
717 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
718 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
719 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
720
721 const S = struct {
722 threadlocal var t: i32 = 1234;
723 };
724 S.t += 1;
725 try expect(S.t == 1235);
726}
727
728test "result location is optional inside error union" {714test "result location is optional inside error union" {
729 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO715 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
730 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO716 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
...@@ -740,20 +726,6 @@ fn maybe(x: bool) anyerror!?u32 {...@@ -740,20 +726,6 @@ fn maybe(x: bool) anyerror!?u32 {
740 };726 };
741}727}
742728
743test "pointer to thread local array" {
744 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
745 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
746 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
747 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
748 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
749
750 const s = "Hello world";
751 std.mem.copy(u8, buffer[0..], s);
752 try std.testing.expectEqualSlices(u8, buffer[0..], s);
753}
754
755threadlocal var buffer: [11]u8 = undefined;
756
757test "auto created variables have correct alignment" {729test "auto created variables have correct alignment" {
758 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO730 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
759731
test/behavior/bugs/7250.zig deleted-24
...@@ -1,24 +0,0 @@
1const builtin = @import("builtin");
2const nrfx_uart_t = extern struct {
3 p_reg: [*c]u32,
4 drv_inst_idx: u8,
5};
6
7pub fn nrfx_uart_rx(p_instance: [*c]const nrfx_uart_t) void {
8 _ = p_instance;
9}
10
11threadlocal var g_uart0 = nrfx_uart_t{
12 .p_reg = 0,
13 .drv_inst_idx = 0,
14};
15
16test "reference a global threadlocal variable" {
17 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
18 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
19 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
20 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
21 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
22
23 _ = nrfx_uart_rx(&g_uart0);
24}
test/behavior/threadlocal.zig created+58
...@@ -0,0 +1,58 @@
1const std = @import("std");
2const builtin = @import("builtin");
3const expect = std.testing.expect;
4
5test "thread local variable" {
6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
8 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
9 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
10 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
11 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
12
13 const S = struct {
14 threadlocal var t: i32 = 1234;
15 };
16 S.t += 1;
17 try expect(S.t == 1235);
18}
19
20test "pointer to thread local array" {
21 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
23 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
24 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
25 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
27
28 const s = "Hello world";
29 std.mem.copy(u8, buffer[0..], s);
30 try std.testing.expectEqualSlices(u8, buffer[0..], s);
31}
32
33threadlocal var buffer: [11]u8 = undefined;
34
35test "reference a global threadlocal variable" {
36 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
37 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
38 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
39 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
40 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch != .x86_64) return error.SkipZigTest; // TODO
41 if (builtin.zig_backend == .stage2_c and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
42
43 _ = nrfx_uart_rx(&g_uart0);
44}
45
46const nrfx_uart_t = extern struct {
47 p_reg: [*c]u32,
48 drv_inst_idx: u8,
49};
50
51pub fn nrfx_uart_rx(p_instance: [*c]const nrfx_uart_t) void {
52 _ = p_instance;
53}
54
55threadlocal var g_uart0 = nrfx_uart_t{
56 .p_reg = 0,
57 .drv_inst_idx = 0,
58};
test/tests.zig-7
...@@ -682,13 +682,6 @@ pub fn addPkgTests(...@@ -682,13 +682,6 @@ pub fn addPkgTests(
682 } else false;682 } else false;
683 if (!want_this_mode) continue;683 if (!want_this_mode) continue;
684684
685 if (test_target.backend) |backend| {
686 if (backend == .stage2_c and builtin.os.tag == .windows) {
687 // https://github.com/ziglang/zig/issues/12415
688 continue;
689 }
690 }
691
692 const libc_prefix = if (test_target.target.getOs().requiresLibC())685 const libc_prefix = if (test_target.target.getOs().requiresLibC())
693 ""686 ""
694 else if (test_target.link_libc)687 else if (test_target.link_libc)