authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-16 11:21:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-16 11:21:56-07:00
logab84ba39d03f59599ddfad91c00edf78a40edd70
tree51f03581a27a454564ad7770333ee4d8bdf470d8
parentdc214e041eda1461cc2317523e1656c5a0f55c1a

move behavior test to "passing for stage2" section


3 files changed, 12 insertions(+), 13 deletions(-)

test/behavior.zig+4-5
...@@ -1,7 +1,6 @@...@@ -1,7 +1,6 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
22
3test {3test {
4 // Tests that pass for both.
5 _ = @import("behavior/bool.zig");4 _ = @import("behavior/bool.zig");
6 _ = @import("behavior/basic.zig");5 _ = @import("behavior/basic.zig");
7 _ = @import("behavior/generics.zig");6 _ = @import("behavior/generics.zig");
...@@ -13,8 +12,10 @@ test {...@@ -13,8 +12,10 @@ test {
13 _ = @import("behavior/usingnamespace.zig");12 _ = @import("behavior/usingnamespace.zig");
14 _ = @import("behavior/atomics.zig");13 _ = @import("behavior/atomics.zig");
1514
16 if (!builtin.zig_is_stage2) {15 if (builtin.zig_is_stage2) {
17 // Tests that only pass for stage1.16 // When all comptime_memory.zig tests pass, #9646 can be closed.
17 // _ = @import("behavior/comptime_memory.zig");
18 } else {
18 _ = @import("behavior/align.zig");19 _ = @import("behavior/align.zig");
19 _ = @import("behavior/alignof.zig");20 _ = @import("behavior/alignof.zig");
20 _ = @import("behavior/array_stage1.zig");21 _ = @import("behavior/array_stage1.zig");
...@@ -91,8 +92,6 @@ test {...@@ -91,8 +92,6 @@ test {
91 _ = @import("behavior/byval_arg_var.zig");92 _ = @import("behavior/byval_arg_var.zig");
92 _ = @import("behavior/call.zig");93 _ = @import("behavior/call.zig");
93 _ = @import("behavior/cast_stage1.zig");94 _ = @import("behavior/cast_stage1.zig");
94 // When these tests pass, #9646 can be closed.
95 // _ = @import("behavior/comptime_memory.zig");
96 _ = @import("behavior/const_slice_child.zig");95 _ = @import("behavior/const_slice_child.zig");
97 _ = @import("behavior/defer.zig");96 _ = @import("behavior/defer.zig");
98 _ = @import("behavior/enum.zig");97 _ = @import("behavior/enum.zig");
test/behavior/atomics.zig+8
...@@ -73,3 +73,11 @@ test "cmpxchg with ptr" {...@@ -73,3 +73,11 @@ test "cmpxchg with ptr" {
73 try expect(@cmpxchgStrong(*i32, &x, &data3, &data2, .SeqCst, .SeqCst) == null);73 try expect(@cmpxchgStrong(*i32, &x, &data3, &data2, .SeqCst, .SeqCst) == null);
74 try expect(x == &data2);74 try expect(x == &data2);
75}75}
76
77test "cmpxchg with ignored result" {
78 var x: i32 = 1234;
79
80 _ = @cmpxchgStrong(i32, &x, 1234, 5678, .Monotonic, .Monotonic);
81
82 try expect(5678 == x);
83}
test/behavior/atomics_stage1.zig-8
...@@ -28,14 +28,6 @@ fn test_u128_cmpxchg() !void {...@@ -28,14 +28,6 @@ fn test_u128_cmpxchg() !void {
28 try expect(x == 42);28 try expect(x == 42);
29}29}
3030
31test "cmpxchg with ignored result" {
32 var x: i32 = 1234;
33
34 _ = @cmpxchgStrong(i32, &x, 1234, 5678, .Monotonic, .Monotonic);
35
36 try expectEqual(@as(i32, 5678), x);
37}
38
39var a_global_variable = @as(u32, 1234);31var a_global_variable = @as(u32, 1234);
4032
41test "cmpxchg on a global variable" {33test "cmpxchg on a global variable" {