Skip to content

Commit

Permalink
disable behavior test for 128-bit cmpxchg
Browse files Browse the repository at this point in the history
once #2883 is done this can be revisited
  • Loading branch information
andrewrk committed Aug 1, 2019
1 parent 38b5812 commit 6cb4cac
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions test/stage1/behavior/atomics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,23 @@ test "cmpxchg with ptr" {
expect(x == &data2);
}

test "128-bit cmpxchg" {
if (builtin.arch != .x86_64) {
return error.SkipZigTest;
}
var x: u128 align(16) = 1234; // TODO: https://github.com/ziglang/zig/issues/2987
if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {
expect(x1 == 1234);
} else {
@panic("cmpxchg should have failed");
}

while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {
expect(x1 == 1234);
}
expect(x == 5678);

expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
expect(x == 42);
}
// TODO this test is disabled until this issue is resolved:

This comment has been minimized.

Copy link
@Mouvedia
// https://github.com/ziglang/zig/issues/2883
// otherwise cross compiling will result in:
// lld: error: undefined symbol: __sync_val_compare_and_swap_16
//test "128-bit cmpxchg" {
// var x: u128 align(16) = 1234; // TODO: https://github.com/ziglang/zig/issues/2987

This comment has been minimized.

Copy link
@Mouvedia
// if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {
// expect(x1 == 1234);
// } else {
// @panic("cmpxchg should have failed");
// }
//
// while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {
// expect(x1 == 1234);
// }
// expect(x == 5678);
//
// expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
// expect(x == 42);
//}

0 comments on commit 6cb4cac

Please sign in to comment.