repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git]
/
tools
/
memory-model
/
litmus-tests
/
SB+rfionceonce-poonceonces.litmus
blob
04a16603660bd29716912acb18d03e894f3a73f3
1
C SB+rfionceonce-poonceonces
2
3
(*
4
* Result: Sometimes
5
*
6
* This litmus test demonstrates that LKMM is not fully multicopy atomic.
7
*)
8
9
{}
10
11
P0(int *x, int *y)
12
{
13
int r1;
14
int r2;
15
16
WRITE_ONCE(*x, 1);
17
r1 = READ_ONCE(*x);
18
r2 = READ_ONCE(*y);
19
}
20
21
P1(int *x, int *y)
22
{
23
int r3;
24
int r4;
25
26
WRITE_ONCE(*y, 1);
27
r3 = READ_ONCE(*y);
28
r4 = READ_ONCE(*x);
29
}
30
31
locations [0:r1; 1:r3; x; y] (* Debug aid: Print things not in "exists". *)
32
exists (0:r2=0 /\ 1:r4=0)