xref: /linux/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus (revision 8f32543b61d7daeddb5b64c80b5ad5f05cc97722)
11c27b644SPaul E. McKenneyC ISA2+poonceonces
21c27b644SPaul E. McKenney
3*8f32543bSPaul E. McKenney(*
4*8f32543bSPaul E. McKenney * Result: Sometimes
5*8f32543bSPaul E. McKenney *
6*8f32543bSPaul E. McKenney * Given a release-acquire chain ordering the first process's store
7*8f32543bSPaul E. McKenney * against the last process's load, is ordering preserved if all of the
8*8f32543bSPaul E. McKenney * smp_store_release() invocations are replaced by WRITE_ONCE() and all
9*8f32543bSPaul E. McKenney * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
10*8f32543bSPaul E. McKenney *)
11*8f32543bSPaul E. McKenney
121c27b644SPaul E. McKenney{}
131c27b644SPaul E. McKenney
141c27b644SPaul E. McKenneyP0(int *x, int *y)
151c27b644SPaul E. McKenney{
161c27b644SPaul E. McKenney	WRITE_ONCE(*x, 1);
171c27b644SPaul E. McKenney	WRITE_ONCE(*y, 1);
181c27b644SPaul E. McKenney}
191c27b644SPaul E. McKenney
201c27b644SPaul E. McKenneyP1(int *y, int *z)
211c27b644SPaul E. McKenney{
221c27b644SPaul E. McKenney	int r0;
231c27b644SPaul E. McKenney
241c27b644SPaul E. McKenney	r0 = READ_ONCE(*y);
251c27b644SPaul E. McKenney	WRITE_ONCE(*z, 1);
261c27b644SPaul E. McKenney}
271c27b644SPaul E. McKenney
281c27b644SPaul E. McKenneyP2(int *x, int *z)
291c27b644SPaul E. McKenney{
301c27b644SPaul E. McKenney	int r0;
311c27b644SPaul E. McKenney	int r1;
321c27b644SPaul E. McKenney
331c27b644SPaul E. McKenney	r0 = READ_ONCE(*z);
341c27b644SPaul E. McKenney	r1 = READ_ONCE(*x);
351c27b644SPaul E. McKenney}
361c27b644SPaul E. McKenney
371c27b644SPaul E. McKenneyexists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)
38