fix cmpxchg behavior test

This has to be a `@cmpxchgStrong` instead of a `@cmpxchgWeak` otherwise
this test will fail spuriously on LL/SC architectures like PowerPC.
This commit is contained in:
Justus Klausecker 2026-02-23 17:07:47 +01:00 committed by Alex Rønne Petersen
parent ee82d926a6
commit 360bc28c96

View file

@ -143,7 +143,7 @@ test "cmpxchg on a global variable" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
_ = @cmpxchgWeak(u32, &a_global_variable, 1234, 42, .acquire, .monotonic);
_ = @cmpxchgStrong(u32, &a_global_variable, 1234, 42, .acquire, .monotonic);
try expect(a_global_variable == 42);
}