Merge tag 'timers-core-2023-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / tools / memory-model / litmus-tests / WRC+poonceonces+Once.litmus
CommitLineData
1c27b644
PM
1C WRC+poonceonces+Once
2
8f32543b
PM
3(*
4 * Result: Sometimes
5 *
6 * This litmus test is an extension of the message-passing pattern,
7 * where the first write is moved to a separate process. Note that this
8 * test has no ordering at all.
9 *)
10
5c587f9b 11{}
1c27b644
PM
12
13P0(int *x)
14{
15 WRITE_ONCE(*x, 1);
16}
17
18P1(int *x, int *y)
19{
20 int r0;
21
22 r0 = READ_ONCE(*x);
23 WRITE_ONCE(*y, 1);
24}
25
26P2(int *x, int *y)
27{
28 int r0;
29 int r1;
30
31 r0 = READ_ONCE(*y);
32 r1 = READ_ONCE(*x);
33}
34
35exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)