tools/memory-model: Add types to litmus tests
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 5 Nov 2020 21:20:56 +0000 (13:20 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 7 Nov 2020 01:25:16 +0000 (17:25 -0800)
This commit adds type information for global variables in the litmus
tests in order to allow easier use with klitmus7.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
32 files changed:
tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoWW+poonceonce.litmus
tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus
tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus
tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus
tools/memory-model/litmus-tests/ISA2+poonceonces.litmus
tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus
tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus
tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus
tools/memory-model/litmus-tests/LB+poonceonces.litmus
tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus
tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus
tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus
tools/memory-model/litmus-tests/MP+polocks.litmus
tools/memory-model/litmus-tests/MP+poonceonces.litmus
tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus
tools/memory-model/litmus-tests/MP+porevlocks.litmus
tools/memory-model/litmus-tests/R+fencembonceonces.litmus
tools/memory-model/litmus-tests/R+poonceonces.litmus
tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus
tools/memory-model/litmus-tests/S+poonceonces.litmus
tools/memory-model/litmus-tests/SB+fencembonceonces.litmus
tools/memory-model/litmus-tests/SB+poonceonces.litmus
tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus
tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus
tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus
tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus
tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus
tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus

index 967f9f2a6226ba62ed593e6aff9e99d1fae02c85..772544f03fb5f0ff459cfaf773bba5e1181edcaf 100644 (file)
@@ -7,7 +7,9 @@ C CoRR+poonceonce+Once
  * reads from the same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index 4635739f3974dd76925b2a20f874f03a2e55ce5f..5faae98f7ffb3f9890e8f6674967ea6ef3ea53e1 100644 (file)
@@ -7,7 +7,9 @@ C CoRW+poonceonce+Once
  * a given variable and a later write to that same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index bb068c92d8da27fad692b9d168875bc9c5de815c..77c9cc9f8dc663652eaa0465e0d8e28ac3cff333 100644 (file)
@@ -7,7 +7,9 @@ C CoWR+poonceonce+Once
  * given variable and a later read from that same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index 0d9f0a9587996cd37950a7fd4e12eed1e7a7faf9..85ef746f511a7aad10b9844587e543e15a63aee3 100644 (file)
@@ -7,7 +7,9 @@ C CoWW+poonceonce
  * writes to the same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index e729d2776e89a7854bc8d2dfc8a856213e4b6a35..87aa900125ab232d14eefe6cb00568dece5e4621 100644 (file)
@@ -10,7 +10,10 @@ C IRIW+fencembonceonces+OnceOnce
  * process?  This litmus test exercises LKMM's "propagation" rule.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index 4b54dd6a6cd9464ace77b470fc38f4ef86ce5cef..f84022dca5551e111c045da83668e65d3795e88e 100644 (file)
@@ -10,7 +10,10 @@ C IRIW+poonceonces+OnceOnce
  * different process?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index 094d58df778969c836e97b945e92d3329e1c509f..398f624daa7717e1f521d109646643840867a023 100644 (file)
@@ -7,7 +7,12 @@ C ISA2+pooncelock+pooncelock+pombonce
  * (in P0() and P1()) is visible to external process P2().
  *)
 
-{}
+{
+       spinlock_t mylock;
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index b321aa6f4ea52d4125b750cd6517d1feddb522d0..212a432ba16ba5341fdf1420ed2938bed0c44e18 100644 (file)
@@ -9,7 +9,11 @@ C ISA2+poonceonces
  * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
  *)
 
-{}
+{
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y)
 {
index 025b0462ec9bcdb56c35150ab52716aea1b1589c..7afd85672ccdeaedeb99903a24ed0a284a5ebff8 100644 (file)
@@ -11,7 +11,11 @@ C ISA2+pooncerelease+poacquirerelease+poacquireonce
  * (AKA non-rf) link, so release-acquire is all that is needed.
  *)
 
-{}
+{
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y)
 {
index 4727f5aaf03b05b1c98a6d2d53ded40c8d7023e4..c8a93c7ee556a11ffbfcecdf0890745b1b03d459 100644 (file)
@@ -11,7 +11,10 @@ C LB+fencembonceonce+ctrlonceonce
  * another control dependency and order would still be maintained.)
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 07b9904b0e49f058f8b0f7505078ffb213aa5a6c..2fa029568fa1ca9c2d2489ff248a33b57b8bb202 100644 (file)
@@ -8,7 +8,10 @@ C LB+poacquireonce+pooncerelease
  * to the other?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 74c49cb3c37bf78df023689161b09678f78ce2a1..2107306e8625b9acbbeb9a07c6e57e535b3314c0 100644 (file)
@@ -7,7 +7,10 @@ C LB+poonceonces
  * be prevented even with no explicit ordering?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index a273da9faa6d3646a83a5f802bede59cc09459cc..e04b71b0ce2b0d403d43856eb9495bf45ad5117d 100644 (file)
@@ -8,7 +8,10 @@ C MP+fencewmbonceonce+fencermbonceonce
  * is usually better to use smp_store_release() and smp_load_acquire().
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 97731b4bbdd8eb1d15685162665c5d27b18ed970..18df682b08b2c706c107788d0c7332ce0dc0d6d6 100644 (file)
@@ -10,8 +10,9 @@ C MP+onceassign+derefonce
  *)
 
 {
-y=z;
-z=0;
+       int x;
+       int *y=z;
+       int z=0;
 }
 
 P0(int *x, int **y)
index 50f4d62bbf0ea550626b1c55c9211f5ff60df403..b1b1266fb49a2166ab2d5783763f6b3787870f8a 100644 (file)
@@ -11,6 +11,8 @@ C MP+polockmbonce+poacquiresilsil
  *)
 
 {
+       spinlock_t lo;
+       int x;
 }
 
 P0(spinlock_t *lo, int *x)
index abf81e7a0895b8e941a1bb6ecab87e083aef8829..867c75d8b96080a89a6cb64289c54d21ca465aa2 100644 (file)
@@ -11,6 +11,8 @@ C MP+polockonce+poacquiresilsil
  *)
 
 {
+       spinlock_t lo;
+       int x;
 }
 
 P0(spinlock_t *lo, int *x)
index 712a4fcdf6ce88f35e533d84e143777b37906123..63e0f67c9b9d77407ac6056cf56c37ec5a900d34 100644 (file)
@@ -11,7 +11,11 @@ C MP+polocks
  * to see all prior accesses by those other CPUs.
  *)
 
-{}
+{
+       spinlock_t mylock;
+       int x;
+       int y;
+}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 172f0145301c563b7e92eac992ddf73662cf9714..68180a403e5c3bb15ceda79f3491342cc044c8eb 100644 (file)
@@ -7,7 +7,10 @@ C MP+poonceonces
  * no ordering at all?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index d52c68429722646edf72e8aebf7723cfb6c4323d..19f3e6874b50e53f1e58f29558bf6ef161eef763 100644 (file)
@@ -8,7 +8,10 @@ C MP+pooncerelease+poacquireonce
  * pattern.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 72c9276b363ee4cea6194aec7253707cc5e3f853..4ac189adf41ed7f8531700592c458afeddb01499 100644 (file)
@@ -11,7 +11,11 @@ C MP+porevlocks
  * see all prior accesses by those other CPUs.
  *)
 
-{}
+{
+       spinlock_t mylock;
+       int x;
+       int y;
+}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 222a0b850b4a5d98d087c2d94ab5158e928c43ae..af9463b39b4a5daacd517d7e552f49ac963f1206 100644 (file)
@@ -9,7 +9,10 @@ C R+fencembonceonces
  * cause the resulting test to be allowed.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 5386f128a131dfa50852e6fc5869700d0fe09d17..bcd5574e304ae762c0a32064e215b6a3d200fd38 100644 (file)
@@ -8,7 +8,10 @@ C R+poonceonces
  * store propagation delays.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 18479823cd6ccd1315b6723a215bf8df7f38daf2..c36341d1aed66d2e53df3197526726be1e5ed40b 100644 (file)
@@ -7,7 +7,10 @@ C S+fencewmbonceonce+poacquireonce
  * store against a subsequent store?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 8c9c2f81a58055cdba5eeea5c502ef24d9416a69..7775c23143a0caa635cff6873ae5edd04ae8c174 100644 (file)
@@ -9,7 +9,10 @@ C S+poonceonces
  * READ_ONCE(), is ordering preserved?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index ed5fff18d2232b722ab4aab2d8bc8403a6fb908b..833cdfeb7c093ce9ebb2a616b4e7567d6ee72c79 100644 (file)
@@ -9,7 +9,10 @@ C SB+fencembonceonces
  * suffice, but not much else.)
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 10d550730b25fdd800f2dd5ec8a9f0e555d65415..c92211ecbfdf70b6b820585b4e59f78f7d106637 100644 (file)
@@ -8,7 +8,10 @@ C SB+poonceonces
  * variable that the preceding process reads.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 04a16603660bd29716912acb18d03e894f3a73f3..84344b455eb7144ba9378cf5eeba68e2bd0ae399 100644 (file)
@@ -6,7 +6,10 @@ C SB+rfionceonce-poonceonces
  * This litmus test demonstrates that LKMM is not fully multicopy atomic.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 6a2bc12a1af1ad6b6bf75c5a902e01acd54f3af7..431494708611bfe41cfd744d2b132516e30e536e 100644 (file)
@@ -8,7 +8,10 @@ C WRC+poonceonces+Once
  * test has no ordering at all.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index e9947250d7de6a06ca67a33e9214284fe421a723..554999c64db587ba7b5d1b8dd018ef5fc91c7dbc 100644 (file)
@@ -10,7 +10,10 @@ C WRC+pooncerelease+fencermbonceonce+Once
  * is A-cumulative in LKMM.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index 415248fb669902a9b1c77e0abf905fabfc9634f5..265a95ffef1373bfe605230a718828bf75063f86 100644 (file)
@@ -9,7 +9,12 @@ C Z6.0+pooncelock+poonceLock+pombonce
  * by CPUs not holding that lock.
  *)
 
-{}
+{
+       spinlock_t mylock;
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 10a2aa04cd078d9b55898887bb4373437b7b9288..0c9aea8e80df08425721ef252f5f4b3884ba97f6 100644 (file)
@@ -8,7 +8,12 @@ C Z6.0+pooncelock+pooncelock+pombonce
  * seen as ordered by a third process not holding that lock.
  *)
 
-{}
+{
+       spinlock_t mylock;
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 88e70b87a683e045ddf3148b7a6a9808214cc5c0..661f9aaa57914b76ca2759d3deeeb8937c96eaec 100644 (file)
@@ -14,7 +14,11 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce
  * involving locking.)
  *)
 
-{}
+{
+       int x;
+       int y;
+       int z;
+}
 
 P0(int *x, int *y)
 {