# HG changeset patch # User jiefu # Date 1558206818 25200 # Node ID 24c0eeb3ebe79612ea22b2d9db3409a804c8aa43 # Parent 0f934da77390452c750382b761d1d7a264349ca4 8222302: [TESTBUG]test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java fails on any other CPU Reviewed-by: kvn, dlong diff -r 0f934da77390 -r 24c0eeb3ebe7 test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.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); } } diff -r 0f934da77390 -r 24c0eeb3ebe7 test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java --- 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,