From dfe9cae4eb9ebd1409759f82a6f7ab9336a6da6b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 27 Oct 2023 12:19:03 -0700 Subject: [PATCH] categorize globals behavior tests moves some tests that store to global variables to their own category instead of being named after a GitHub issue. --- test/behavior.zig | 2 +- test/behavior/bugs/13063.zig | 21 --------------------- test/behavior/globals.zig | 31 +++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 22 deletions(-) delete mode 100644 test/behavior/bugs/13063.zig create mode 100644 test/behavior/globals.zig diff --git a/test/behavior.zig b/test/behavior.zig index 1579a97cbc..39662e91cd 100644 --- a/test/behavior.zig +++ b/test/behavior.zig @@ -169,6 +169,7 @@ test { _ = @import("behavior/fn_in_struct_in_comptime.zig"); _ = @import("behavior/for.zig"); _ = @import("behavior/generics.zig"); + _ = @import("behavior/globals.zig"); _ = @import("behavior/hasdecl.zig"); _ = @import("behavior/hasfield.zig"); _ = @import("behavior/if.zig"); @@ -252,7 +253,6 @@ test { builtin.zig_backend != .stage2_c and builtin.zig_backend != .stage2_spirv64) { - _ = @import("behavior/bugs/13063.zig"); _ = @import("behavior/bugs/11227.zig"); _ = @import("behavior/bugs/14198.zig"); _ = @import("behavior/export.zig"); diff --git a/test/behavior/bugs/13063.zig b/test/behavior/bugs/13063.zig deleted file mode 100644 index 30b086e721..0000000000 --- a/test/behavior/bugs/13063.zig +++ /dev/null @@ -1,21 +0,0 @@ -const std = @import("std"); -const builtin = @import("builtin"); -const expect = std.testing.expect; - -var pos = [2]f32{ 0.0, 0.0 }; -test "store to global array" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - - try expect(pos[1] == 0.0); - pos = [2]f32{ 0.0, 1.0 }; - try expect(pos[1] == 1.0); -} - -var vpos = @Vector(2, f32){ 0.0, 0.0 }; -test "store to global vector" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - - try expect(vpos[1] == 0.0); - vpos = @Vector(2, f32){ 0.0, 1.0 }; - try expect(vpos[1] == 1.0); -} diff --git a/test/behavior/globals.zig b/test/behavior/globals.zig new file mode 100644 index 0000000000..2dc2b904d2 --- /dev/null +++ b/test/behavior/globals.zig @@ -0,0 +1,31 @@ +const std = @import("std"); +const builtin = @import("builtin"); +const expect = std.testing.expect; + +var pos = [2]f32{ 0.0, 0.0 }; +test "store to global array" { + if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; + + try expect(pos[1] == 0.0); + pos = [2]f32{ 0.0, 1.0 }; + try expect(pos[1] == 1.0); +} + +var vpos = @Vector(2, f32){ 0.0, 0.0 }; +test "store to global vector" { + if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; + if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; + + try expect(vpos[1] == 0.0); + vpos = @Vector(2, f32){ 0.0, 1.0 }; + try expect(vpos[1] == 1.0); +}