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 967f9f2..772544f 100644 (file)
@@ -7,7 +7,9 @@ C CoRR+poonceonce+Once
  * reads from the same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index 4635739..5faae98 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 bb068c9..77c9cc9 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 0d9f0a9..85ef746 100644 (file)
@@ -7,7 +7,9 @@ C CoWW+poonceonce
  * writes to the same variable are ordered.
  *)
 
-{}
+{
+       int x;
+}
 
 P0(int *x)
 {
index e729d27..87aa900 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 4b54dd6..f84022d 100644 (file)
@@ -10,7 +10,10 @@ C IRIW+poonceonces+OnceOnce
  * different process?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index 094d58d..398f624 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 b321aa6..212a432 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 025b046..7afd856 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 4727f5a..c8a93c7 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 07b9904..2fa0295 100644 (file)
@@ -8,7 +8,10 @@ C LB+poacquireonce+pooncerelease
  * to the other?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 74c49cb..2107306 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 a273da9..e04b71b 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 97731b4..18df682 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 abf81e7..867c75d 100644 (file)
@@ -11,6 +11,8 @@ C MP+polockonce+poacquiresilsil
  *)
 
 {
+       spinlock_t lo;
+       int x;
 }
 
 P0(spinlock_t *lo, int *x)
index 712a4fc..63e0f67 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 172f014..68180a4 100644 (file)
@@ -7,7 +7,10 @@ C MP+poonceonces
  * no ordering at all?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index d52c684..19f3e68 100644 (file)
@@ -8,7 +8,10 @@ C MP+pooncerelease+poacquireonce
  * pattern.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 72c9276..4ac189a 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 222a0b8..af9463b 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 5386f12..bcd5574 100644 (file)
@@ -8,7 +8,10 @@ C R+poonceonces
  * store propagation delays.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 1847982..c36341d 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 8c9c2f8..7775c23 100644 (file)
@@ -9,7 +9,10 @@ C S+poonceonces
  * READ_ONCE(), is ordering preserved?
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index ed5fff1..833cdfe 100644 (file)
@@ -9,7 +9,10 @@ C SB+fencembonceonces
  * suffice, but not much else.)
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x, int *y)
 {
index 10d5507..c92211e 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 04a1660..84344b4 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 6a2bc12..4314947 100644 (file)
@@ -8,7 +8,10 @@ C WRC+poonceonces+Once
  * test has no ordering at all.
  *)
 
-{}
+{
+       int x;
+       int y;
+}
 
 P0(int *x)
 {
index 415248f..265a95f 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 10a2aa0..0c9aea8 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 88e70b8..661f9aa 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)
 {