changeset 292:1be98bc60f39

Chapter 1.b: Ditch causality-testing NoFence tests.
author shade
date Fri, 10 Jun 2016 10:56:33 +0300
parents 354504c9a1c6
children 3a067ac9ecac
files jcstress-test-gen/src/main/java/org/openjdk/jcstress/chapters/Chapter1bTestGenerator.java jcstress-test-gen/src/main/resources/chapter1b/fields/LoadLoadNoFenceTest.java.template jcstress-test-gen/src/main/resources/chapter1b/fields/LoadStoreNoFenceTest1.java.template jcstress-test-gen/src/main/resources/chapter1b/fields/LoadStoreNoFenceTest2.java.template jcstress-test-gen/src/main/resources/chapter1b/fields/StoreLoadNoFenceTest.java.template jcstress-test-gen/src/main/resources/chapter1b/fields/StoreStoreNoFenceTest1.java.template jcstress-test-gen/src/main/resources/chapter1b/fields/StoreStoreNoFenceTest2.java.template
diffstat 7 files changed, 17 insertions(+), 559 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-test-gen/src/main/java/org/openjdk/jcstress/chapters/Chapter1bTestGenerator.java	Thu Jun 09 21:41:43 2016 +0300
+++ b/jcstress-test-gen/src/main/java/org/openjdk/jcstress/chapters/Chapter1bTestGenerator.java	Fri Jun 10 10:56:33 2016 +0300
@@ -78,8 +78,6 @@
 import static org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.T_SETSTORELOADFENCE;
 import static org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.T_WEAKSETSTORELOADFENCE;
 import static org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.T_WEAKSETSTORESTOREFENCE;
-import static org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.T_GET;
-import static org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.T_SET;
 
 import org.openjdk.jcstress.chapters.Chapter1bTestGenerator.Target.Operation;
 
@@ -153,43 +151,24 @@
             final String templateName = template.getKey();
             final Target target = template.getValue();
 
-            String templateFile = "/chapter1b/fields/" + templateName + ".java.template";
-            if (Chapter1bTestGenerator.class.getResource(templateFile) != null) {
-                makeFieldTests(target, "fields", templateName, readFromResource(templateFile),
-                        (pkg, testName, result) -> writeOut(dest, pkg, testName, result));
-            }
+            makeFieldTests(dest, target, "fields", templateName,
+                    readFromResource("/chapter1b/fields/" + templateName + ".java.template"));
 
-            templateFile = "/chapter1b/arrays/" + templateName + ".java.template";
-            if (Chapter1bTestGenerator.class.getResource(templateFile) != null) {
-                makeArrayTests(target, "arrays", templateName, readFromResource(templateFile),
-                        (pkg, testName, result) -> writeOut(dest, pkg, testName, result));
-            }
+            makeArrayTests(dest, target, "arrays", templateName,
+                    readFromResource("/chapter1b/arrays/" + templateName + ".java.template"));
 
-            templateFile = "/chapter1b/byteArray/" + templateName + ".java.template";
-            if (Chapter1bTestGenerator.class.getResource(templateFile) != null) {
-                makeByteBufferTests(target, "byteArray", "byteArray", BufferType.ARRAY, templateName,
-                        readFromResource(templateFile),
-                        (pkg, testName, result) -> writeOut(dest, pkg, testName, result));
-            }
+            makeByteBufferTests(dest, target, "byteArray", "byteArray", BufferType.ARRAY, templateName,
+                    readFromResource("/chapter1b/byteArray/" + templateName + ".java.template"));
 
-            templateFile = "/chapter1b/byteBuffer/" + templateName + ".java.template";
-            if (Chapter1bTestGenerator.class.getResource(templateFile) != null) {
-                makeByteBufferTests(target, "byteBuffer", "byteBuffer", BufferType.HEAP, templateName,
-                        readFromResource(templateFile),
-                        (pkg, testName, result) -> writeOut(dest, pkg, testName, result));
-            }
+            makeByteBufferTests(dest, target, "byteBuffer", "byteBuffer", BufferType.HEAP, templateName,
+                    readFromResource("/chapter1b/byteBuffer/" + templateName + ".java.template"));
 
-            templateFile = "/chapter1b/byteBuffer/" + templateName + ".java.template";
-            if (Chapter1bTestGenerator.class.getResource(templateFile) != null) {
-                makeByteBufferTests(target, "byteBuffer", "byteBuffer", BufferType.DIRECT, templateName,
-                        readFromResource(templateFile),
-                        (pkg, testName, result) -> writeOut(dest, pkg, testName, result));
-            }
+            makeByteBufferTests(dest, target, "byteBuffer", "byteBuffer", BufferType.DIRECT, templateName,
+                    readFromResource("/chapter1b/byteBuffer/" + templateName + ".java.template"));
         }
     }
 
-    private static void makeFieldTests(Target target, String vhType, String templateName, String template,
-            FileWriter writer) throws IOException {
+    private static void makeFieldTests(String dest, Target target, String vhType, String templateName, String template) throws IOException {
         for (Type type : DATA_SOURCE.supportedTypes()) {
             for (Operation operation : target.operations) {
                 if (!DATA_SOURCE.supported(operation.method, type))
@@ -201,7 +180,7 @@
                 String pkg = BASE_PKG + "." + vhType + "." + templateName;
                 String testName = operation.method.name() + upcaseFirst(type.type);
 
-                writer.write(pkg, testName, Spp.spp(result,
+                writeOut(dest, pkg, testName, Spp.spp(result,
                         keys(type),
                         fieldVars(type, "this", pkg, testName)
                 ));
@@ -209,8 +188,7 @@
         }
     }
 
-    private static void makeArrayTests(Target target, String vhType, String templateName, String template,
-            FileWriter writer) throws IOException {
+    private static void makeArrayTests(String dest, Target target, String vhType, String templateName, String template) throws IOException {
         for (Type type : DATA_SOURCE.supportedTypes()) {
             for (Operation operation : target.operations) {
                 if (!DATA_SOURCE.supported(operation.method, type))
@@ -222,7 +200,7 @@
                 String pkg = BASE_PKG + "." + vhType + "." + templateName;
                 String testName = operation.method.name() + upcaseFirst(type.type);
 
-                writer.write(pkg, testName, Spp.spp(result,
+                writeOut(dest, pkg, testName, Spp.spp(result,
                         keys(type),
                         arrayVars(type, "array", pkg, testName)
                 ));
@@ -230,8 +208,8 @@
         }
     }
 
-    private static void makeByteBufferTests(Target target, String vhType, String object,
-            BufferType bufferType, String templateName, String template, FileWriter writer)
+    private static void makeByteBufferTests(String dest, Target target, String vhType, String object,
+            BufferType bufferType, String templateName, String template)
             throws IOException {
         for (Type type : VIEW_SOURCE.supportedTypes()) {
             for (Operation operation : target.operations) {
@@ -245,7 +223,7 @@
                 String pkg = BASE_PKG + "." + vhType + bufferType.pkgAppendix() + "." + templateName;
                 String testName = operation.method.name() + upcaseFirst(type.type);
 
-                writer.write(pkg, testName, Spp.spp(result,
+                writeOut(dest, pkg, testName, Spp.spp(result,
                         keys(type),
                         viewVars(type, object, pkg, testName, bufferType.allocateOp)
                 ));
@@ -305,11 +283,6 @@
         return map;
     }
 
-    @FunctionalInterface
-    private interface FileWriter {
-        void write(String pkg, String testName, String result) throws IOException;
-    }
-
     enum Type {
         INT("int",
                 Integer.BYTES,
@@ -880,19 +853,13 @@
             entry("GetAndAddTest", T_GETANDADD),
             entry("GetAndSetTest", T_GETANDSET),
             entry("LoadLoadFenceTest", T_GETLOADLOADFENCE),
-            entry("LoadLoadNoFenceTest", T_GET),
             entry("LoadStoreFenceTest1", T_LOADSTOREFENCESET),
             entry("LoadStoreFenceTest2", T_GETLOADSTOREFENCE),
-            entry("LoadStoreNoFenceTest1", T_SET),
-            entry("LoadStoreNoFenceTest2", T_GET),
             entry("StoreLoadFenceTest", T_SETSTORELOADFENCE),
             entry("StoreLoadFenceTestWeak", T_WEAKSETSTORELOADFENCE),
-            entry("StoreLoadNoFenceTest", T_SET),
             entry("StoreStoreFenceTest1", T_STORESTOREFENCESET),
             entry("StoreStoreFenceTest2", T_SETSTORESTOREFENCE),
             entry("StoreStoreFenceTest2Weak", T_WEAKSETSTORESTOREFENCE),
-            entry("StoreStoreNoFenceTest1", T_SET),
-            entry("StoreStoreNoFenceTest2", T_SET),
             entry("WeakCASTest", T_WEAKCAS),
             entry("WeakCASContendStrongTest", T_WEAKCAS));
 
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/LoadLoadNoFenceTest.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of load load fence on a volatile variable.")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables before actor1 update")
-@Outcome(id = "$value0$, $value1$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables after x is already updated but var hasn't yet")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE,  desc = "load var is reordered with load x in actor2")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "actor2 observe the variables after actor1 update completely")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-@Outcome(expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, reordering may happen in actor2, both may read half-value")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    $type$ x;
-    
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1() {
-        x = $valueLiteral1$;
-        field = $valueLiteral1$;
-    }
-
-    @Actor
-    public void actor2($Type$Result2 r) {
-        r.r1 = %Get<>%
-        r.r2 = x;
-    }
-
-}
\ No newline at end of file
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/LoadStoreNoFenceTest1.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Arbiter;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of load store fence on a volatile variable.")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "load var in actor2 before store $value1$ to var in actor1, all results are $value0$")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE, desc = "store $value1$ to var in actor1 before load var in actor2")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "load x is reordered with store var in actor1.")
-@Outcome(id = "$value0$, $value1$", expect = Expect.FORBIDDEN,  desc = "this won't happen even if load x after store var because only if r1 = $value1$ x may be assigned to $value1$ and then r2 can be $value1$ from x.")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-@Outcome(expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, when reordering happen, half-value r1 can spread to r2.")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    $type$ x;
-    
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1($Type$Result2 r) {
-        $type$ i = x;
-        %Set<$valueLiteral1$>%
-        r.r2 = i;
-    }
-    
-    @Actor
-    public void actor2($Type$Result2 r) {
-        r.r1 = field;
-        x = r.r1;
-    }
-}
\ No newline at end of file
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/LoadStoreNoFenceTest2.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94, when reordering happen, half-value r1 can spread to r2.065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Arbiter;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of load store fence on a volatile variable.")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "load y in actor2 before store $value1$ to y in actor1, all results are $value0$")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE, desc = "store $value1$ to y in actor1 before load y in actor2")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "load var is reordered with store y in actor1.")
-@Outcome(id = "$value0$, $value1$", expect = Expect.FORBIDDEN,  desc = "this won't happen even if load var after store y because only if r1 = $value1$ var may be assigned to $value1$ and then r2 can be $value1$ from var.")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-@Outcome(expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, when reordering happen, half-value r1 can spread to r2.")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    $type$ y;
-
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1($Type$Result2 r) {
-        $type$ i = %Get<>%
-        y = $valueLiteral1$;
-        r.r2 = i;
-    }
-    
-    @Actor
-    public void actor2($Type$Result2 r) {
-        r.r1 = y;
-        field = r.r1;
-    }
-}
\ No newline at end of file
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/StoreLoadNoFenceTest.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Arbiter;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of store load fence on a volatile variable.")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor1 observe actor2 update, actor2 not yet observe actor1 update")
-@Outcome(id = "$value0$, $value1$", expect = Expect.ACCEPTABLE,  desc = "actor2 observe actor1 update, actor1 not yet observe actor2 update")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "both actor1 and actor2 observe each other update")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "store var is reordered with load x in actor1.")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-//x is volatile, r1 won't be half-value
-@Outcome(id = "$value1$, .*", expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec. r1 get x update")
-@Outcome(id = "$value0$, .*", expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec. t1 not get x update")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    volatile $type$ x;
-       
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1($Type$Result2 r) {
-        %Set<$valueLiteral1$>%
-        r.r1 = x;
-    }
-    
-    @Actor
-    public void actor2($Type$Result2 r) {
-        x = $valueLiteral1$;
-        r.r2 = field;
-    }
-}
\ No newline at end of file
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/StoreStoreNoFenceTest1.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of store store fence on a volatile variable.")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables before actor1 update")
-@Outcome(id = "$value0$, $value1$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables after x is already updated but var hasn't yet")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE,  desc = "store var is reordered with store x")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "actor2 observe the variables after actor1 update completely")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-@Outcome(expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, reordering may happen, both may read half-value")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    $type$ x;
-    
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1() {
-        x = $valueLiteral1$;
-        %Set<$valueLiteral1$>%
-    }
-
-    @Actor
-    public void actor2($Type$Result2 r) {
-        r.r1 = field;
-        r.r2 = x;
-    }
-
-}
\ No newline at end of file
--- a/jcstress-test-gen/src/main/resources/chapter1b/fields/StoreStoreNoFenceTest2.java.template	Thu Jun 09 21:41:43 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package $package$;
-
-import org.openjdk.jcstress.annotations.Actor;
-import org.openjdk.jcstress.annotations.Expect;
-import org.openjdk.jcstress.annotations.JCStressTest;
-import org.openjdk.jcstress.annotations.Outcome;
-import org.openjdk.jcstress.annotations.Ref;
-import org.openjdk.jcstress.annotations.State;
-import org.openjdk.jcstress.annotations.Description;
-import org.openjdk.jcstress.infra.results.$Type$Result2;
-
-import static java.nio.ByteOrder.BIG_ENDIAN;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.VarHandle;
-import java.util.Random;
-import java.nio.ByteBuffer;
-
-
-@JCStressTest
-@Description("Tests VarHandle methods which eliminate effect of store store fence on a volatile variable.")
-@Outcome(id = "$value0$, $value0$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables before actor1 update")
-@Outcome(id = "$value0$, $value1$", expect = Expect.ACCEPTABLE, desc = "actor2 observe the variables after x is already updated but var hasn't yet")
-@Outcome(id = "$value1$, $value0$", expect = Expect.ACCEPTABLE,  desc = "store var is reordered with store y")
-@Outcome(id = "$value1$, $value1$", expect = Expect.ACCEPTABLE,  desc = "actor2 observe the variables after actor1 update completely")
-#if[alwaysAtomic]
-@Outcome(expect = Expect.FORBIDDEN, desc = "Other values are forbidden: atomicity violation.")
-#else[alwaysAtomic]
-@Outcome(expect = Expect.ACCEPTABLE_SPEC, desc = "Non-atomic access detected, allowed by spec, reordering may happen, both may read half-value")
-@Ref("http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7")
-#end[alwaysAtomic]
-@State
-public class $TestClassName$ {
-
-    $type$ y;
-    
-    volatile $type$ field;
-
-    static final VarHandle vh;
-
-    static {
-        try {
-            vh = MethodHandles.lookup().findVarHandle($TestClassName$.class, "field", $type$.class);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    @Actor
-    public void actor1() {
-        %Set<$valueLiteral1$>%
-        y = $valueLiteral1$;
-    }
-
-    @Actor
-    public void actor2($Type$Result2 r) {
-        r.r1 = y;
-        VarHandle.fullFence();
-        r.r2 = field;
-    }
-
-}
\ No newline at end of file