authorgravatar for fncontroloption@noreply.codeberg.orgFnControlOption <fncontroloption@noreply.codeberg.org> 2021-08-07 12:16:40-07:00
committergravatar for fncontroloption@noreply.codeberg.orgFnControlOption <fncontroloption@noreply.codeberg.org> 2021-08-07 12:22:10-07:00
logd19e1709b315d03d32138211140108308e540e3e
tree558a86b1dbfcdf2cf151e313ecb071de4eaa9486
parentade85471e2cdab466ba685a38c2c7949c9dd1632

Re-enable 128-bit cmpxchg test


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

test/behavior/atomics.zig+16-20
...@@ -74,26 +74,22 @@ test "cmpxchg with ptr" {...@@ -74,26 +74,22 @@ test "cmpxchg with ptr" {
74 try expect(x == &data2);74 try expect(x == &data2);
75}75}
7676
77// TODO this test is disabled until this issue is resolved:77test "128-bit cmpxchg" {
78// https://github.com/ziglang/zig/issues/288378 var x: u128 = 1234;
79// otherwise cross compiling will result in:79 if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {
80// lld: error: undefined symbol: __sync_val_compare_and_swap_1680 try expect(x1 == 1234);
81//test "128-bit cmpxchg" {81 } else {
82// var x: u128 align(16) = 1234; // TODO: https://github.com/ziglang/zig/issues/298782 @panic("cmpxchg should have failed");
83// if (@cmpxchgWeak(u128, &x, 99, 5678, .SeqCst, .SeqCst)) |x1| {83 }
84// try expect(x1 == 1234);84
85// } else {85 while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {
86// @panic("cmpxchg should have failed");86 try expect(x1 == 1234);
87// }87 }
88//88 try expect(x == 5678);
89// while (@cmpxchgWeak(u128, &x, 1234, 5678, .SeqCst, .SeqCst)) |x1| {89
90// try expect(x1 == 1234);90 try expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
91// }91 try expect(x == 42);
92// try expect(x == 5678);92}
93//
94// try expect(@cmpxchgStrong(u128, &x, 5678, 42, .SeqCst, .SeqCst) == null);
95// try expect(x == 42);
96//}
9793
98test "cmpxchg with ignored result" {94test "cmpxchg with ignored result" {
99 var x: i32 = 1234;95 var x: i32 = 1234;