< prev index next >

test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java

Print this page
rev 60737 : 8252204: AArch64: Implement SHA3 accelerator/intrinsic
Reviewed-by: duke
Contributed-by: dongbo4@huawei.com


  49     @Override
  50     protected void verifyWarnings() throws Throwable {
  51         String shouldPassMessage = String.format("JVM startup should pass when"
  52                         + " %s was passed and all UseSHA*Intrinsics options "
  53                         + "were disabled",
  54                         CommandLineOptionTest.prepareBooleanFlag(
  55                             DigestOptionsBase.USE_SHA_OPTION, true));
  56         // Verify that there will be no warnings when +UseSHA was passed and
  57         // all UseSHA*Intrinsics options were disabled.
  58         CommandLineOptionTest.verifySameJVMStartup(
  59                 null, new String[] { ".*UseSHA.*" }, shouldPassMessage,
  60                 shouldPassMessage, ExitCode.OK,
  61                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
  62                 CommandLineOptionTest.prepareBooleanFlag(
  63                         DigestOptionsBase.USE_SHA_OPTION, true),
  64                 CommandLineOptionTest.prepareBooleanFlag(
  65                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
  66                 CommandLineOptionTest.prepareBooleanFlag(
  67                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
  68                 CommandLineOptionTest.prepareBooleanFlag(
  69                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));


  70     }
  71 
  72     @Override
  73     protected void verifyOptionValues() throws Throwable {
  74         // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
  75         // disabled.
  76         CommandLineOptionTest.verifyOptionValueForSameVM(
  77                 DigestOptionsBase.USE_SHA_OPTION, "false", String.format(
  78                 "'%s' option should be disabled when all UseSHA*Intrinsics are"
  79                         + " disabled", DigestOptionsBase.USE_SHA_OPTION),
  80                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
  81                 CommandLineOptionTest.prepareBooleanFlag(
  82                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
  83                 CommandLineOptionTest.prepareBooleanFlag(
  84                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
  85                 CommandLineOptionTest.prepareBooleanFlag(
  86                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));


  87 
  88         CommandLineOptionTest.verifyOptionValueForSameVM(
  89                 // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
  90                 // disabled even if it was explicitly enabled.
  91                 DigestOptionsBase.USE_SHA_OPTION, "false",
  92                 String.format("'%s' option should be disabled when all "
  93                         + "UseSHA*Intrinsics are disabled even if %s flag set "
  94                         + "to JVM", DigestOptionsBase.USE_SHA_OPTION,
  95                         CommandLineOptionTest.prepareBooleanFlag(
  96                              DigestOptionsBase.USE_SHA_OPTION, true)),
  97                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
  98                 CommandLineOptionTest.prepareBooleanFlag(
  99                         DigestOptionsBase.USE_SHA_OPTION, true),
 100                 CommandLineOptionTest.prepareBooleanFlag(
 101                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
 102                 CommandLineOptionTest.prepareBooleanFlag(
 103                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
 104                 CommandLineOptionTest.prepareBooleanFlag(
 105                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));


 106 
 107         // Verify that explicitly disabled UseSHA option remains disabled even
 108         // if all UseSHA*Intrinsics options were enabled.
 109         CommandLineOptionTest.verifyOptionValueForSameVM(
 110                 DigestOptionsBase.USE_SHA_OPTION, "false",
 111                 String.format("'%s' option should be disabled if %s flag "
 112                         + "set even if all UseSHA*Intrinsics were enabled",
 113                         DigestOptionsBase.USE_SHA_OPTION,
 114                         CommandLineOptionTest.prepareBooleanFlag(
 115                             DigestOptionsBase.USE_SHA_OPTION, false)),
 116                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
 117                 CommandLineOptionTest.prepareBooleanFlag(
 118                         DigestOptionsBase.USE_SHA_OPTION, false),
 119                 CommandLineOptionTest.prepareBooleanFlag(
 120                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
 121                 CommandLineOptionTest.prepareBooleanFlag(
 122                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
 123                 CommandLineOptionTest.prepareBooleanFlag(
 124                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));


 125     }
 126 }


  49     @Override
  50     protected void verifyWarnings() throws Throwable {
  51         String shouldPassMessage = String.format("JVM startup should pass when"
  52                         + " %s was passed and all UseSHA*Intrinsics options "
  53                         + "were disabled",
  54                         CommandLineOptionTest.prepareBooleanFlag(
  55                             DigestOptionsBase.USE_SHA_OPTION, true));
  56         // Verify that there will be no warnings when +UseSHA was passed and
  57         // all UseSHA*Intrinsics options were disabled.
  58         CommandLineOptionTest.verifySameJVMStartup(
  59                 null, new String[] { ".*UseSHA.*" }, shouldPassMessage,
  60                 shouldPassMessage, ExitCode.OK,
  61                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
  62                 CommandLineOptionTest.prepareBooleanFlag(
  63                         DigestOptionsBase.USE_SHA_OPTION, true),
  64                 CommandLineOptionTest.prepareBooleanFlag(
  65                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
  66                 CommandLineOptionTest.prepareBooleanFlag(
  67                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
  68                 CommandLineOptionTest.prepareBooleanFlag(
  69                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false),
  70                 CommandLineOptionTest.prepareBooleanFlag(
  71                         DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION, false));
  72     }
  73 
  74     @Override
  75     protected void verifyOptionValues() throws Throwable {
  76         // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
  77         // disabled.
  78         CommandLineOptionTest.verifyOptionValueForSameVM(
  79                 DigestOptionsBase.USE_SHA_OPTION, "false", String.format(
  80                 "'%s' option should be disabled when all UseSHA*Intrinsics are"
  81                         + " disabled", DigestOptionsBase.USE_SHA_OPTION),
  82                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
  83                 CommandLineOptionTest.prepareBooleanFlag(
  84                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
  85                 CommandLineOptionTest.prepareBooleanFlag(
  86                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
  87                 CommandLineOptionTest.prepareBooleanFlag(
  88                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false),
  89                 CommandLineOptionTest.prepareBooleanFlag(
  90                         DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION, false));
  91 
  92         CommandLineOptionTest.verifyOptionValueForSameVM(
  93                 // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
  94                 // disabled even if it was explicitly enabled.
  95                 DigestOptionsBase.USE_SHA_OPTION, "false",
  96                 String.format("'%s' option should be disabled when all "
  97                         + "UseSHA*Intrinsics are disabled even if %s flag set "
  98                         + "to JVM", DigestOptionsBase.USE_SHA_OPTION,
  99                         CommandLineOptionTest.prepareBooleanFlag(
 100                              DigestOptionsBase.USE_SHA_OPTION, true)),
 101                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
 102                 CommandLineOptionTest.prepareBooleanFlag(
 103                         DigestOptionsBase.USE_SHA_OPTION, true),
 104                 CommandLineOptionTest.prepareBooleanFlag(
 105                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
 106                 CommandLineOptionTest.prepareBooleanFlag(
 107                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
 108                 CommandLineOptionTest.prepareBooleanFlag(
 109                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, false),
 110                 CommandLineOptionTest.prepareBooleanFlag(
 111                         DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION, false));
 112 
 113         // Verify that explicitly disabled UseSHA option remains disabled even
 114         // if all UseSHA*Intrinsics options were enabled.
 115         CommandLineOptionTest.verifyOptionValueForSameVM(
 116                 DigestOptionsBase.USE_SHA_OPTION, "false",
 117                 String.format("'%s' option should be disabled if %s flag "
 118                         + "set even if all UseSHA*Intrinsics were enabled",
 119                         DigestOptionsBase.USE_SHA_OPTION,
 120                         CommandLineOptionTest.prepareBooleanFlag(
 121                             DigestOptionsBase.USE_SHA_OPTION, false)),
 122                 DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
 123                 CommandLineOptionTest.prepareBooleanFlag(
 124                         DigestOptionsBase.USE_SHA_OPTION, false),
 125                 CommandLineOptionTest.prepareBooleanFlag(
 126                         DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
 127                 CommandLineOptionTest.prepareBooleanFlag(
 128                         DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION, true),
 129                 CommandLineOptionTest.prepareBooleanFlag(
 130                         DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION, true),
 131                 CommandLineOptionTest.prepareBooleanFlag(
 132                         DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION, true));
 133     }
 134 }
< prev index next >