xref: /linux/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
11c27b644SPaul E. McKenneyC ISA2+poonceonces
21c27b644SPaul E. McKenney
38f32543bSPaul E. McKenney(*
48f32543bSPaul E. McKenney * Result: Sometimes
58f32543bSPaul E. McKenney *
68f32543bSPaul E. McKenney * Given a release-acquire chain ordering the first process's store
78f32543bSPaul E. McKenney * against the last process's load, is ordering preserved if all of the
88f32543bSPaul E. McKenney * smp_store_release() invocations are replaced by WRITE_ONCE() and all
98f32543bSPaul E. McKenney * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
108f32543bSPaul E. McKenney *)
118f32543bSPaul E. McKenney
12*5c587f9bSAkira Yokosawa{}
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