test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8130120 Sdiff test/compiler/intrinsics/sha/cli/testcases

test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java

Print this page




  47                 + " '%s' without any warnings", optionName);
  48         // Verify that there are no warning when option is explicitly enabled.
  49         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
  50                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
  51                 }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
  52                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  53 
  54         // Verify that option could be disabled even if +UseSHA was passed to
  55         // JVM.
  56         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
  57                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
  58                 }, shouldPassMessage, String.format("It should be able to "
  59                         + "disable option '%s' even if %s was passed to JVM",
  60                         optionName, CommandLineOptionTest.prepareBooleanFlag(
  61                             SHAOptionsBase.USE_SHA_OPTION, true)),
  62                 ExitCode.OK,
  63                 CommandLineOptionTest.prepareBooleanFlag(
  64                         SHAOptionsBase.USE_SHA_OPTION, true),
  65                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
  66 
  67         // Verify that it is possible to enable the tested option and disable
  68         // all SHA intrinsics via -UseSHA without any warnings.
  69         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
  70                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
  71                 }, shouldPassMessage, String.format("It should be able to "
  72                         + "enable option '%s' even if %s was passed to JVM",
  73                         optionName, CommandLineOptionTest.prepareBooleanFlag(
  74                             SHAOptionsBase.USE_SHA_OPTION, false)),


  75                 ExitCode.OK,
  76                 CommandLineOptionTest.prepareBooleanFlag(
  77                         SHAOptionsBase.USE_SHA_OPTION, false),
  78                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));

  79     }
  80 
  81     @Override
  82     protected void verifyOptionValues() throws Throwable {
  83         // Verify that "It should be able to disable option "
  84 
  85         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  86                 String.format("Option '%s' should be enabled by default",
  87                         optionName));
  88 
  89         // Verify that it is possible to explicitly enable the option.
  90         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  91                 String.format("Option '%s' was set to have value 'true'",
  92                         optionName),
  93                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  94 
  95         // Verify that it is possible to explicitly disable the option.
  96         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
  97                 String.format("Option '%s' was set to have value 'false'",
  98                         optionName),




  47                 + " '%s' without any warnings", optionName);
  48         // Verify that there are no warning when option is explicitly enabled.
  49         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
  50                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
  51                 }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
  52                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  53 
  54         // Verify that option could be disabled even if +UseSHA was passed to
  55         // JVM.
  56         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
  57                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
  58                 }, shouldPassMessage, String.format("It should be able to "
  59                         + "disable option '%s' even if %s was passed to JVM",
  60                         optionName, CommandLineOptionTest.prepareBooleanFlag(
  61                             SHAOptionsBase.USE_SHA_OPTION, true)),
  62                 ExitCode.OK,
  63                 CommandLineOptionTest.prepareBooleanFlag(
  64                         SHAOptionsBase.USE_SHA_OPTION, true),
  65                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
  66 
  67         if (!optionName.equals(SHAOptionsBase.USE_SHA_OPTION)) {
  68             // Verify that if -XX:-UseSHA is passed to the JVM, it is not possible
  69             // to enable the tested option and a warning is printed.
  70             CommandLineOptionTest.verifySameJVMStartup(
  71                     new String[] { SHAOptionsBase.getWarningForUnsupportedCPU(optionName) },
  72                     null,
  73                     shouldPassMessage,
  74                     String.format("Enabling option '%s' should not be possible and should result in a warning if %s was passed to JVM",
  75                                   optionName,
  76                                   CommandLineOptionTest.prepareBooleanFlag(SHAOptionsBase.USE_SHA_OPTION, false)),
  77                     ExitCode.OK,
  78                     CommandLineOptionTest.prepareBooleanFlag(SHAOptionsBase.USE_SHA_OPTION, false),

  79                     CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  80         }
  81     }
  82 
  83     @Override
  84     protected void verifyOptionValues() throws Throwable {
  85         // Verify that "It should be able to disable option "
  86 
  87         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  88                 String.format("Option '%s' should be enabled by default",
  89                         optionName));
  90 
  91         // Verify that it is possible to explicitly enable the option.
  92         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  93                 String.format("Option '%s' was set to have value 'true'",
  94                         optionName),
  95                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  96 
  97         // Verify that it is possible to explicitly disable the option.
  98         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
  99                 String.format("Option '%s' was set to have value 'false'",
 100                         optionName),


test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File