; A failed compare-exchange is a read: no release part (spec 04 ยง24.1). ; expect: reject E4201 ; phase: 5 ; spec: docs/spec/04-concurrency-and-atomics.md module test.cmpxchg_failure_release air 0 lang 0.1 features [atomics, effects, ownership] fn @main() -> u64 effects [atomic, atomic.weak] entry: %z = const.u64 0 %c = atomic.new %z %r = borrow.ref %c %one = const.u64 1 %o, %ok = atomic.cmpxchg.acq_rel.acq_rel %r, %z, %one borrow.end %r %v = atomic.take %c %k = const.u64 0 ret %k