authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-01 03:36:03-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-01 03:36:03-04:00
log6cb4cac5cd1c68f41c62a3c23b09513988337c8d
treebc27c72e26d25ebf42d8611d33dc42dc2d123348
parent38b5812c4895eb0157f99348f51c40bbd17c3b94
signaturelock-open Commit is signed but in an unrecognized format.

disable behavior test for 128-bit cmpxchg

once #2883 is done this can be revisited

1 files changed, 20 insertions(+), 19 deletions(-)

test/stage1/behavior/atomics.zig+20-19
......@@ -70,22 +70,23 @@ test "cmpxchg with ptr" {
7070 expect(x == &data2);
7171}
7272
73test "128-bit cmpxchg" {
74 if (builtin.arch != .x86_64) {
75 return error.SkipZigTest;
76 }
77 var x: u128 align(16) = 1234; // TODO: https://github.com/ziglang/zig/issues/2987
78 if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {
79 expect(x1 == 1234);
80 } else {
81 @panic("cmpxchg should have failed");
82 }
83
84 while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {
85 expect(x1 == 1234);
86 }
87 expect(x == 5678);
88
89 expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
90 expect(x == 42);
91}
73// TODO this test is disabled until this issue is resolved:
74// https://github.com/ziglang/zig/issues/2883
75// otherwise cross compiling will result in:
76// lld: error: undefined symbol: __sync_val_compare_and_swap_16
77//test "128-bit cmpxchg" {
78// var x: u128 align(16) = 1234; // TODO: https://github.com/ziglang/zig/issues/2987
79// if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {
80// expect(x1 == 1234);
81// } else {
82// @panic("cmpxchg should have failed");
83// }
84//
85// while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {
86// expect(x1 == 1234);
87// }
88// expect(x == 5678);
89//
90// expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
91// expect(x == 42);
92//}