SB+rfionceonce-poonceonces.litmus 452 B

1234567891011121314151617181920212223242526272829303132
  1. C SB+rfionceonce-poonceonces
  2. (*
  3. * Result: Sometimes
  4. *
  5. * This litmus test demonstrates that LKMM is not fully multicopy atomic.
  6. *)
  7. {}
  8. P0(int *x, int *y)
  9. {
  10. int r1;
  11. int r2;
  12. WRITE_ONCE(*x, 1);
  13. r1 = READ_ONCE(*x);
  14. r2 = READ_ONCE(*y);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r3;
  19. int r4;
  20. WRITE_ONCE(*y, 1);
  21. r3 = READ_ONCE(*y);
  22. r4 = READ_ONCE(*x);
  23. }
  24. locations [0:r1; 1:r3; x; y] (* Debug aid: Print things not in "exists". *)
  25. exists (0:r2=0 /\ 1:r4=0)