Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / memory-model / litmus-tests / LB+poacquireonce+pooncerelease.litmus
blob2fa029568fa1ca9c2d2489ff248a33b57b8bb202
1 C LB+poacquireonce+pooncerelease
3 (*
4  * Result: Never
5  *
6  * Does a release-acquire pair suffice for the load-buffering litmus
7  * test, where each process reads from one of two variables then writes
8  * to the other?
9  *)
12         int x;
13         int y;
16 P0(int *x, int *y)
18         int r0;
20         r0 = READ_ONCE(*x);
21         smp_store_release(y, 1);
24 P1(int *x, int *y)
26         int r0;
28         r0 = smp_load_acquire(y);
29         WRITE_ONCE(*x, 1);
32 exists (0:r0=1 /\ 1:r0=1)