mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 10:46:33 +00:00
1947bfcf81
This commit adds type information for global variables in the litmus tests in order to allow easier use with klitmus7. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
28 lines
333 B
Plaintext
28 lines
333 B
Plaintext
C CoRW+poonceonce+Once
|
|
|
|
(*
|
|
* Result: Never
|
|
*
|
|
* Test of read-write coherence, that is, whether or not a read from
|
|
* a given variable and a later write to that same variable are ordered.
|
|
*)
|
|
|
|
{
|
|
int x;
|
|
}
|
|
|
|
P0(int *x)
|
|
{
|
|
int r0;
|
|
|
|
r0 = READ_ONCE(*x);
|
|
WRITE_ONCE(*x, 1);
|
|
}
|
|
|
|
P1(int *x)
|
|
{
|
|
WRITE_ONCE(*x, 2);
|
|
}
|
|
|
|
exists (x=2 /\ 0:r0=2)
|