18c2ecf20Sopenharmony_ciC SB+rfionceonce-poonceonces 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci(* 48c2ecf20Sopenharmony_ci * Result: Sometimes 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This litmus test demonstrates that LKMM is not fully multicopy atomic. 78c2ecf20Sopenharmony_ci *) 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci{} 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ciP0(int *x, int *y) 128c2ecf20Sopenharmony_ci{ 138c2ecf20Sopenharmony_ci int r1; 148c2ecf20Sopenharmony_ci int r2; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci WRITE_ONCE(*x, 1); 178c2ecf20Sopenharmony_ci r1 = READ_ONCE(*x); 188c2ecf20Sopenharmony_ci r2 = READ_ONCE(*y); 198c2ecf20Sopenharmony_ci} 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciP1(int *x, int *y) 228c2ecf20Sopenharmony_ci{ 238c2ecf20Sopenharmony_ci int r3; 248c2ecf20Sopenharmony_ci int r4; 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci WRITE_ONCE(*y, 1); 278c2ecf20Sopenharmony_ci r3 = READ_ONCE(*y); 288c2ecf20Sopenharmony_ci r4 = READ_ONCE(*x); 298c2ecf20Sopenharmony_ci} 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_cilocations [0:r1; 1:r3; x; y] (* Debug aid: Print things not in "exists". *) 328c2ecf20Sopenharmony_ciexists (0:r2=0 /\ 1:r4=0) 33