tools/memory-model: Remove redundant initialization in litmus tests
authorAkira Yokosawa <akiyks@gmail.com>
Fri, 27 Nov 2020 23:43:45 +0000 (08:43 +0900)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Jan 2021 22:40:49 +0000 (14:40 -0800)
This is a revert of commit 1947bfcf81a9 ("tools/memory-model: Add types
to litmus tests") with conflict resolutions.

klitmus7 [1] is aware of default types of "int" and "int*".
It accepts litmus tests for herd7 without extra type info unless
non-"int" variables are referenced by an "exists", "locations",
or "filter" directive.

[1]: Tested with klitmus7 versions 7.49 or later.

Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
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 772544f..967f9f2 100644 (file)
@@ -7,9 +7,7 @@ C CoRR+poonceonce+Once
  * reads from the same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 5faae98..4635739 100644 (file)
@@ -7,9 +7,7 @@ C CoRW+poonceonce+Once
  * a given variable and a later write to that same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 77c9cc9..bb068c9 100644 (file)
@@ -7,9 +7,7 @@ C CoWR+poonceonce+Once
  * given variable and a later read from that same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 85ef746..0d9f0a9 100644 (file)
@@ -7,9 +7,7 @@ C CoWW+poonceonce
  * writes to the same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 87aa900..e729d27 100644 (file)
@@ -10,10 +10,7 @@ C IRIW+fencembonceonces+OnceOnce
  * process?  This litmus test exercises LKMM's "propagation" rule.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index f84022d..4b54dd6 100644 (file)
@@ -10,10 +10,7 @@ C IRIW+poonceonces+OnceOnce
  * different process?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index 398f624..094d58d 100644 (file)
@@ -7,12 +7,7 @@ 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 212a432..b321aa6 100644 (file)
@@ -9,11 +9,7 @@ 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 7afd856..025b046 100644 (file)
@@ -11,11 +11,7 @@ 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 c8a93c7..4727f5a 100644 (file)
@@ -11,10 +11,7 @@ C LB+fencembonceonce+ctrlonceonce
  * another control dependency and order would still be maintained.)
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 2fa0295..07b9904 100644 (file)
@@ -8,10 +8,7 @@ C LB+poacquireonce+pooncerelease
  * to the other?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 2107306..74c49cb 100644 (file)
@@ -7,10 +7,7 @@ C LB+poonceonces
  * be prevented even with no explicit ordering?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c5c168d..f8ca122 100644 (file)
@@ -8,10 +8,7 @@ C MP+fencewmbonceonce+fencermbonceonce
  * is usually better to use smp_store_release() and smp_load_acquire().
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index 20ff626..d84160b 100644 (file)
@@ -10,9 +10,7 @@ C MP+onceassign+derefonce
  *)
 
 {
-       int *p=y;
-       int x;
-       int y=0;
+p=y;
 }
 
 P0(int *x, int **p) // Producer
index 153917a..ba91cc6 100644 (file)
@@ -10,10 +10,7 @@ C MP+polockmbonce+poacquiresilsil
  * executed before the lock was acquired (loosely speaking).
  *)
 
-{
-       spinlock_t lo;
-       int x;
-}
+{}
 
 P0(spinlock_t *lo, int *x) // Producer
 {
index aad6439..a5ea3ed 100644 (file)
@@ -10,10 +10,7 @@ C MP+polockonce+poacquiresilsil
  * speaking).
  *)
 
-{
-       spinlock_t lo;
-       int x;
-}
+{}
 
 P0(spinlock_t *lo, int *x) // Producer
 {
index 21cbca6..e6af05f 100644 (file)
@@ -11,11 +11,7 @@ C MP+polocks
  * to see all prior accesses by those other CPUs.
  *)
 
-{
-       spinlock_t mylock;
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag, spinlock_t *mylock) // Producer
 {
index 9f9769d..ba9c99c 100644 (file)
@@ -7,10 +7,7 @@ C MP+poonceonces
  * no ordering at all?
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index cbe28e7..f174bfe 100644 (file)
@@ -8,10 +8,7 @@ C MP+pooncerelease+poacquireonce
  * pattern.
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index 012041b..b959914 100644 (file)
@@ -11,11 +11,7 @@ C MP+porevlocks
  * see all prior accesses by those other CPUs.
  *)
 
-{
-       spinlock_t mylock;
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag, spinlock_t *mylock) // Consumer
 {
index af9463b..222a0b8 100644 (file)
@@ -9,10 +9,7 @@ C R+fencembonceonces
  * cause the resulting test to be allowed.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index bcd5574..5386f12 100644 (file)
@@ -8,10 +8,7 @@ C R+poonceonces
  * store propagation delays.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c36341d..1847982 100644 (file)
@@ -7,10 +7,7 @@ C S+fencewmbonceonce+poacquireonce
  * store against a subsequent store?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 7775c23..8c9c2f8 100644 (file)
@@ -9,10 +9,7 @@ C S+poonceonces
  * READ_ONCE(), is ordering preserved?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 833cdfe..ed5fff1 100644 (file)
@@ -9,10 +9,7 @@ C SB+fencembonceonces
  * suffice, but not much else.)
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c92211e..10d5507 100644 (file)
@@ -8,10 +8,7 @@ C SB+poonceonces
  * variable that the preceding process reads.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 84344b4..04a1660 100644 (file)
@@ -6,10 +6,7 @@ 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 4314947..6a2bc12 100644 (file)
@@ -8,10 +8,7 @@ C WRC+poonceonces+Once
  * test has no ordering at all.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index 265a95f..415248f 100644 (file)
@@ -9,12 +9,7 @@ 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 0c9aea8..10a2aa0 100644 (file)
@@ -8,12 +8,7 @@ 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 661f9aa..88e70b8 100644 (file)
@@ -14,11 +14,7 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce
  * involving locking.)
  *)
 
-{
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y)
 {