S+fencewmbonceonce+poacquireonce.litmus 356 B

123456789101112131415161718192021222324252627
  1. C S+fencewmbonceonce+poacquireonce
  2. (*
  3. * Result: Never
  4. *
  5. * Can a smp_wmb(), instead of a release, and an acquire order a prior
  6. * store against a subsequent store?
  7. *)
  8. {}
  9. P0(int *x, int *y)
  10. {
  11. WRITE_ONCE(*x, 2);
  12. smp_wmb();
  13. WRITE_ONCE(*y, 1);
  14. }
  15. P1(int *x, int *y)
  16. {
  17. int r0;
  18. r0 = smp_load_acquire(y);
  19. WRITE_ONCE(*x, 1);
  20. }
  21. exists (x=2 /\ 1:r0=1)