< prev index next >

test/compiler/intrinsics/sha/cli/SHAOptionsBase.java

Print this page




  25 import jdk.test.lib.cli.CommandLineOptionTest;
  26 import sha.predicate.IntrinsicPredicates;
  27 
  28 import java.util.function.BooleanSupplier;
  29 
  30 /**
  31  * Base class for all CLI tests on SHA-related options.
  32  *
  33  * Instead of using huge complex tests for each option, each test is constructed
  34  * from several test cases shared among different tests.
  35  */
  36 public class SHAOptionsBase extends CommandLineOptionTest {
  37     protected static final String USE_SHA_OPTION = "UseSHA";
  38     protected static final String USE_SHA1_INTRINSICS_OPTION
  39             = "UseSHA1Intrinsics";
  40     protected static final String USE_SHA256_INTRINSICS_OPTION
  41             = "UseSHA256Intrinsics";
  42     protected static final String USE_SHA512_INTRINSICS_OPTION
  43             = "UseSHA512Intrinsics";
  44 





  45     // Note that strings below will be passed to
  46     // CommandLineOptionTest.verifySameJVMStartup and thus are regular
  47     // expressions, not just a plain strings.
  48     protected static final String SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE
  49             = "SHA instructions are not available on this CPU";
  50     protected static final String SHA1_INTRINSICS_ARE_NOT_AVAILABLE
  51             = "Intrinsics for SHA-1 crypto hash functions not available on this CPU.";
  52     protected static final String SHA256_INTRINSICS_ARE_NOT_AVAILABLE
  53             = "Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.";
  54     protected static final String SHA512_INTRINSICS_ARE_NOT_AVAILABLE
  55             = "Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.";
  56 
  57     private final TestCase[] testCases;
  58 
  59     /**
  60      * Returns warning message that should occur in VM output if an option with
  61      * the name {@code optionName} was turned on and CPU does not support
  62      * required instructions.
  63      *
  64      * @param optionName The name of the option for which warning message should




  25 import jdk.test.lib.cli.CommandLineOptionTest;
  26 import sha.predicate.IntrinsicPredicates;
  27 
  28 import java.util.function.BooleanSupplier;
  29 
  30 /**
  31  * Base class for all CLI tests on SHA-related options.
  32  *
  33  * Instead of using huge complex tests for each option, each test is constructed
  34  * from several test cases shared among different tests.
  35  */
  36 public class SHAOptionsBase extends CommandLineOptionTest {
  37     protected static final String USE_SHA_OPTION = "UseSHA";
  38     protected static final String USE_SHA1_INTRINSICS_OPTION
  39             = "UseSHA1Intrinsics";
  40     protected static final String USE_SHA256_INTRINSICS_OPTION
  41             = "UseSHA256Intrinsics";
  42     protected static final String USE_SHA512_INTRINSICS_OPTION
  43             = "UseSHA512Intrinsics";
  44 
  45     // Intrinsics flags are of diagnostic type
  46     // and must be preceded by UnlockDiagnosticVMOptions.
  47     protected static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
  48             = "-XX:+UnlockDiagnosticVMOptions";
  49 
  50     // Note that strings below will be passed to
  51     // CommandLineOptionTest.verifySameJVMStartup and thus are regular
  52     // expressions, not just a plain strings.
  53     protected static final String SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE
  54             = "SHA instructions are not available on this CPU";
  55     protected static final String SHA1_INTRINSICS_ARE_NOT_AVAILABLE
  56             = "Intrinsics for SHA-1 crypto hash functions not available on this CPU.";
  57     protected static final String SHA256_INTRINSICS_ARE_NOT_AVAILABLE
  58             = "Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.";
  59     protected static final String SHA512_INTRINSICS_ARE_NOT_AVAILABLE
  60             = "Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.";
  61 
  62     private final TestCase[] testCases;
  63 
  64     /**
  65      * Returns warning message that should occur in VM output if an option with
  66      * the name {@code optionName} was turned on and CPU does not support
  67      * required instructions.
  68      *
  69      * @param optionName The name of the option for which warning message should


< prev index next >