Merge
authortschatzl
Fri, 18 Dec 2015 13:38:49 +0000
changeset 35192 76f4de26388d
parent 35191 da47979837b4 (current diff)
parent 35188 c058f99ad8fe (diff)
child 35193 1e85994e9f56
child 35194 7151995ee79e
child 35196 c83940b346b2
child 35201 996db89f378e
Merge
--- a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java	Fri Dec 18 14:32:16 2015 +0100
+++ b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java	Fri Dec 18 13:38:49 2015 +0000
@@ -23,6 +23,8 @@
 
 /*
  * @test ReservedStackTest
+ * @library /testlibrary
+ * @build jdk.test.lib.*
  * @run main/othervm -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
  */
 
@@ -107,13 +109,10 @@
  */
 
 import java.util.concurrent.locks.ReentrantLock;
+import jdk.test.lib.Platform;
 
 public class ReservedStackTest {
 
-    private static boolean isWindows() {
-        return System.getProperty("os.name").toLowerCase().startsWith("win");
-    }
-
     static class ReentrantLockTest {
 
         private ReentrantLock lockArray[];
@@ -194,11 +193,22 @@
             System.out.println("Framework got StackOverflowError at frame = " + counter);
             System.out.println("Test started execution at frame = " + (counter - deframe));
             String result = test.getResult();
-            System.out.println(result);
-            // The feature is not fully implemented on Windows platforms,
+            // The feature is not fully implemented on all platforms,
             // corruptions are still possible
-            if (!isWindows() && !result.contains("PASSED")) {
-                System.exit(-1);
+            boolean supportedPlatform = Platform.isSolaris() || Platform.isOSX()
+                || (Platform.isLinux() && (Platform.isX86() || Platform.isX64()));
+            if (supportedPlatform && !result.contains("PASSED")) {
+                System.out.println(result);
+                throw new Error(result);
+            } else {
+                // Either the test passed or this platform is not supported.
+                // On not supported platforms, we only expect the VM to
+                // not crash during the test. This is especially important
+                // on Windows where the detection of SOE in annotated
+                // sections is implemented but the reserved zone mechanism
+                // to avoid the corruption cannot be implemented yet
+                // because of JDK-8067946
+                System.out.println("PASSED");
             }
         }