changeset 72:c0c94345c955

test-gen: Eliminate a few useless volatile.seqcst.* tests.
author shade
date Fri, 24 Jan 2014 22:01:08 +0400
parents 3f2823789f2f
children e4bf3cd3108c
files jcstress-test-gen/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java tests-generated/pom.xml
diffstat 2 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-test-gen/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java	Fri Jan 24 21:34:38 2014 +0400
+++ b/jcstress-test-gen/src/main/java/org/openjdk/jcstress/tracer/TraceGen.java	Fri Jan 24 22:01:08 2014 +0400
@@ -115,7 +115,7 @@
 
         int testCount = 0;
         for (MultiTrace mt : multiTraces) {
-            if (!processedMultitraces.add(mt.id())) continue;
+            if (!processedMultitraces.add(mt.canonicalId())) continue;
 
             List<Trace> linearTraces = mt.linearize();
             Set<Map<Integer, Integer>> scResults = new HashSet<Map<Integer, Integer>>();
@@ -382,6 +382,14 @@
             return count;
         }
 
+        public int getStoreCount() {
+            int count = 0;
+            for (Op op : ops) {
+                if (op.getType() == Op.Type.STORE) count++;
+            }
+            return count;
+        }
+
         public String id() {
             StringBuilder sb = new StringBuilder();
             for (Op op : ops) {
@@ -539,6 +547,16 @@
             }
             return sb.toString();
         }
+
+        public String canonicalId() {
+            StringBuilder sb = new StringBuilder();
+            for (Trace trace : traces) {
+                if (trace.getLoadCount() == 1 && trace.getStoreCount() == 0) continue;
+                sb.append(trace.id());
+                sb.append("_");
+            }
+            return sb.toString();
+        }
     }
 
 }
--- a/tests-generated/pom.xml	Fri Jan 24 21:34:38 2014 +0400
+++ b/tests-generated/pom.xml	Fri Jan 24 22:01:08 2014 +0400
@@ -263,5 +263,10 @@
             <artifactId>jcstress-core</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.openjdk.jcstress</groupId>
+            <artifactId>jcstress-test-gen</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 </project>