5ef0a07a79
herdtools 7.56 has enhanced herd7's C parser so that the "(void)expr" construct in Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus is accepted. This is independent of LKMM's cat model, so mention the required version in the header of the litmus test and its entry in README. CC: Boqun Feng <boqun.feng@gmail.com> Reported-by: Andrea Parri <parri.andrea@gmail.com> Acked-by: Andrea Parri <parri.andrea@gmail.com> Signed-off-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
26 lines
357 B
Plaintext
26 lines
357 B
Plaintext
C Atomic-RMW-ops-are-atomic-WRT-atomic_set
|
|
|
|
(*
|
|
* Result: Never
|
|
*
|
|
* Test that atomic_set() cannot break the atomicity of atomic RMWs.
|
|
* NOTE: This requires herd7 7.56 or later which supports "(void)expr".
|
|
*)
|
|
|
|
{
|
|
atomic_t v = ATOMIC_INIT(1);
|
|
}
|
|
|
|
P0(atomic_t *v)
|
|
{
|
|
(void)atomic_add_unless(v, 1, 0);
|
|
}
|
|
|
|
P1(atomic_t *v)
|
|
{
|
|
atomic_set(v, 0);
|
|
}
|
|
|
|
exists
|
|
(v=2)
|