WRC+pooncerelease+fencermbonceonce+Once.litmus 644 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. C WRC+pooncerelease+fencermbonceonce+Once
  2. (*
  3. * Result: Never
  4. *
  5. * This litmus test is an extension of the message-passing pattern, where
  6. * the first write is moved to a separate process. Because it features
  7. * a release and a read memory barrier, it should be forbidden. More
  8. * specifically, this litmus test is forbidden because smp_store_release()
  9. * is A-cumulative in LKMM.
  10. *)
  11. {}
  12. P0(int *x)
  13. {
  14. WRITE_ONCE(*x, 1);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r0;
  19. r0 = READ_ONCE(*x);
  20. smp_store_release(y, 1);
  21. }
  22. P2(int *x, int *y)
  23. {
  24. int r0;
  25. int r1;
  26. r0 = READ_ONCE(*y);
  27. smp_rmb();
  28. r1 = READ_ONCE(*x);
  29. }
  30. exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)