hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java
changeset 38285 20b85a0ba796
parent 38135 e06e2d071465
child 40059 c2304140ed64
equal deleted inserted replaced
38284:772923492a70 38285:20b85a0ba796
    47         // Verify that the tested option could be explicitly disabled without
    47         // Verify that the tested option could be explicitly disabled without
    48         // a warning.
    48         // a warning.
    49         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
    49         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
    50                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
    50                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
    51                 }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
    51                 }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
       
    52                 SHAOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
    52                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
    53                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
    53 
    54 
    54         // Verify that when the tested option is enabled, then
    55         // Verify that when the tested option is enabled, then
    55         // a warning will occur in VM output if UseSHA is disabled.
    56         // a warning will occur in VM output if UseSHA is disabled.
    56         if (!optionName.equals(SHAOptionsBase.USE_SHA_OPTION)) {
    57         if (!optionName.equals(SHAOptionsBase.USE_SHA_OPTION)) {
    58                     new String[] { SHAOptionsBase.getWarningForUnsupportedCPU(optionName) },
    59                     new String[] { SHAOptionsBase.getWarningForUnsupportedCPU(optionName) },
    59                     null,
    60                     null,
    60                     shouldPassMessage,
    61                     shouldPassMessage,
    61                     shouldPassMessage,
    62                     shouldPassMessage,
    62                     ExitCode.OK,
    63                     ExitCode.OK,
       
    64                     SHAOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
    63                     CommandLineOptionTest.prepareBooleanFlag(SHAOptionsBase.USE_SHA_OPTION, false),
    65                     CommandLineOptionTest.prepareBooleanFlag(SHAOptionsBase.USE_SHA_OPTION, false),
    64                     CommandLineOptionTest.prepareBooleanFlag(optionName, true));
    66                     CommandLineOptionTest.prepareBooleanFlag(optionName, true));
    65         }
    67         }
    66     }
    68     }
    67 
    69 
    68     @Override
    70     @Override
    69     protected void verifyOptionValues() throws Throwable {
    71     protected void verifyOptionValues() throws Throwable {
    70         // Verify that the tested option is disabled by default.
    72         // Verify that the tested option is disabled by default.
    71         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    73         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    72                 String.format("Option '%s' should be disabled by default",
    74                 String.format("Option '%s' should be disabled by default",
    73                         optionName));
    75                         optionName),
       
    76                 SHAOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS);
    74 
    77 
    75         // Verify that it is not possible to explicitly enable the option.
    78         // Verify that it is not possible to explicitly enable the option.
    76         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    79         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    77                 String.format("Option '%s' should be off on unsupported "
    80                 String.format("Option '%s' should be off on unsupported "
    78                         + "X86CPU even if set to true directly", optionName),
    81                         + "X86CPU even if set to true directly", optionName),
       
    82                 SHAOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
    79                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
    83                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
    80 
    84 
    81         // Verify that the tested option is disabled even if +UseSHA was passed
    85         // Verify that the tested option is disabled even if +UseSHA was passed
    82         // to JVM.
    86         // to JVM.
    83         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    87         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
    84                 String.format("Option '%s' should be off on unsupported "
    88                 String.format("Option '%s' should be off on unsupported "
    85                         + "X86CPU even if %s flag set to JVM",
    89                         + "X86CPU even if %s flag set to JVM",
    86                         optionName, CommandLineOptionTest.prepareBooleanFlag(
    90                         optionName, CommandLineOptionTest.prepareBooleanFlag(
    87                             SHAOptionsBase.USE_SHA_OPTION, true)),
    91                             SHAOptionsBase.USE_SHA_OPTION, true)),
       
    92                 SHAOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
    88                 CommandLineOptionTest.prepareBooleanFlag(
    93                 CommandLineOptionTest.prepareBooleanFlag(
    89                         SHAOptionsBase.USE_SHA_OPTION, true));
    94                         SHAOptionsBase.USE_SHA_OPTION, true));
    90     }
    95     }
    91 }
    96 }