< prev index next >
test/compiler/intrinsics/sha/cli/SHAOptionsBase.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
*** 19,31 ****
* 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.
*/
import jdk.test.lib.Platform;
import jdk.test.lib.cli.CommandLineOptionTest;
- import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
import java.util.function.BooleanSupplier;
/**
* Base class for all CLI tests on SHA-related options.
--- 19,33 ----
* 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 compiler.intrinsics.sha.cli;
+
+ import compiler.testlibrary.sha.predicate.IntrinsicPredicates;
import jdk.test.lib.Platform;
import jdk.test.lib.cli.CommandLineOptionTest;
import java.util.function.BooleanSupplier;
/**
* Base class for all CLI tests on SHA-related options.
*** 32,52 ****
*
* Instead of using huge complex tests for each option, each test is constructed
* from several test cases shared among different tests.
*/
public class SHAOptionsBase extends CommandLineOptionTest {
! protected static final String USE_SHA_OPTION = "UseSHA";
! protected static final String USE_SHA1_INTRINSICS_OPTION
= "UseSHA1Intrinsics";
! protected static final String USE_SHA256_INTRINSICS_OPTION
= "UseSHA256Intrinsics";
! protected static final String USE_SHA512_INTRINSICS_OPTION
= "UseSHA512Intrinsics";
// Intrinsics flags are of diagnostic type
// and must be preceded by UnlockDiagnosticVMOptions.
! protected static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
= "-XX:+UnlockDiagnosticVMOptions";
// Note that strings below will be passed to
// CommandLineOptionTest.verifySameJVMStartup and thus are regular
// expressions, not just a plain strings.
--- 34,54 ----
*
* Instead of using huge complex tests for each option, each test is constructed
* from several test cases shared among different tests.
*/
public class SHAOptionsBase extends CommandLineOptionTest {
! public static final String USE_SHA_OPTION = "UseSHA";
! public static final String USE_SHA1_INTRINSICS_OPTION
= "UseSHA1Intrinsics";
! public static final String USE_SHA256_INTRINSICS_OPTION
= "UseSHA256Intrinsics";
! public static final String USE_SHA512_INTRINSICS_OPTION
= "UseSHA512Intrinsics";
// Intrinsics flags are of diagnostic type
// and must be preceded by UnlockDiagnosticVMOptions.
! public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
= "-XX:+UnlockDiagnosticVMOptions";
// Note that strings below will be passed to
// CommandLineOptionTest.verifySameJVMStartup and thus are regular
// expressions, not just a plain strings.
*** 69,79 ****
* @param optionName The name of the option for which warning message should
* be returned.
* @return A warning message that will be printed out to VM output if CPU
* instructions required by the option are not supported.
*/
! protected static String getWarningForUnsupportedCPU(String optionName) {
if (Platform.isSparc() || Platform.isAArch64() ||
Platform.isX64() || Platform.isX86()) {
switch (optionName) {
case SHAOptionsBase.USE_SHA_OPTION:
return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
--- 71,81 ----
* @param optionName The name of the option for which warning message should
* be returned.
* @return A warning message that will be printed out to VM output if CPU
* instructions required by the option are not supported.
*/
! public static String getWarningForUnsupportedCPU(String optionName) {
if (Platform.isSparc() || Platform.isAArch64() ||
Platform.isX64() || Platform.isX86()) {
switch (optionName) {
case SHAOptionsBase.USE_SHA_OPTION:
return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
*** 99,109 ****
* @param optionName The name of the option for which a predicate should be
* returned.
* @return The predicate on availability of CPU instructions required by the
* option.
*/
! protected static BooleanSupplier getPredicateForOption(String optionName) {
switch (optionName) {
case SHAOptionsBase.USE_SHA_OPTION:
return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
--- 101,111 ----
* @param optionName The name of the option for which a predicate should be
* returned.
* @return The predicate on availability of CPU instructions required by the
* option.
*/
! public static BooleanSupplier getPredicateForOption(String optionName) {
switch (optionName) {
case SHAOptionsBase.USE_SHA_OPTION:
return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE;
case SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION:
return IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE;
< prev index next >