8222302: [TESTBUG]test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java fails on any other CPU
authorjiefu
Sat, 18 May 2019 12:13:38 -0700
changeset 54933 24c0eeb3ebe7
parent 54932 0f934da77390
child 54934 39814e0a8964
8222302: [TESTBUG]test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java fails on any other CPU Reviewed-by: kvn, dlong
test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java
test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java	Sat May 18 18:49:39 2019 +0200
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java	Sat May 18 12:13:38 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, 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
@@ -74,23 +74,17 @@
      *         instructions required by the option are not supported.
      */
     public static String getWarningForUnsupportedCPU(String optionName) {
-        if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc()
-            || Platform.isX64() || Platform.isX86() || Platform.isPPC()) {
-            switch (optionName) {
-            case SHAOptionsBase.USE_SHA_OPTION:
-                return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
-            case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
-                return SHAOptionsBase.SHA1_INTRINSICS_ARE_NOT_AVAILABLE;
-            case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
-                return SHAOptionsBase.SHA256_INTRINSICS_ARE_NOT_AVAILABLE;
-            case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
-                return SHAOptionsBase.SHA512_INTRINSICS_ARE_NOT_AVAILABLE;
-            default:
-                throw new Error("Unexpected option " + optionName);
-            }
-        } else {
-            throw new Error("Support for CPUs different from AARCH64, S390x,"
-                            + " SPARC, X86, and PPC is not implemented");
+        switch (optionName) {
+        case SHAOptionsBase.USE_SHA_OPTION:
+            return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
+        case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
+            return SHAOptionsBase.SHA1_INTRINSICS_ARE_NOT_AVAILABLE;
+        case SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION:
+            return SHAOptionsBase.SHA256_INTRINSICS_ARE_NOT_AVAILABLE;
+        case SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION:
+            return SHAOptionsBase.SHA512_INTRINSICS_ARE_NOT_AVAILABLE;
+        default:
+            throw new Error("Unexpected option " + optionName);
         }
     }
 
--- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Sat May 18 18:49:39 2019 +0200
+++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Sat May 18 12:13:38 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, 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
@@ -32,12 +32,12 @@
 
 /**
  * Generic test case for SHA-related options targeted to any CPU except
- * AArch64, S390x, SPARC and X86.
+ * AArch64, PPC, S390x, SPARC and X86.
  */
 public class GenericTestCaseForOtherCPU extends
         SHAOptionsBase.TestCase {
     public GenericTestCaseForOtherCPU(String optionName) {
-        // Execute the test case on any CPU except AArch64, S390x, SPARC and X86.
+        // Execute the test case on any CPU except AArch64, PPC, S390x, SPARC and X86.
         super(optionName, new NotPredicate(
                               new OrPredicate(Platform::isAArch64,
                               new OrPredicate(Platform::isS390x,