hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java
changeset 46515 dbb676a40899
parent 41705 332239c052cc
equal deleted inserted replaced
46514:38a2f229b094 46515:dbb676a40899
    27  * @summary Verify UseRTMLocking option processing on CPU without
    27  * @summary Verify UseRTMLocking option processing on CPU without
    28  *          rtm support.
    28  *          rtm support.
    29  * @library /test/lib /
    29  * @library /test/lib /
    30  * @modules java.base/jdk.internal.misc
    30  * @modules java.base/jdk.internal.misc
    31  *          java.management
    31  *          java.management
    32  *
    32  * @requires (!vm.rtm.cpu) & (vm.flavor == "server" & !vm.emulatedClient)
    33  * @build sun.hotspot.WhiteBox
    33  * @build sun.hotspot.WhiteBox
    34  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    34  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    35  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
    35  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
    36  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
    36  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
    37  *                   -XX:+WhiteBoxAPI
    37  *                   -XX:+WhiteBoxAPI
    38  *                   compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU
    38  *                   compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU
    39  */
    39  */
    40 
    40 
    41 package compiler.rtm.cli;
    41 package compiler.rtm.cli;
    42 
    42 
    43 import compiler.testlibrary.rtm.predicate.SupportedCPU;
       
    44 import compiler.testlibrary.rtm.predicate.SupportedVM;
       
    45 import jdk.test.lib.process.ExitCode;
    43 import jdk.test.lib.process.ExitCode;
    46 import jdk.test.lib.Platform;
    44 import jdk.test.lib.Platform;
    47 import jdk.test.lib.cli.CommandLineOptionTest;
    45 import jdk.test.lib.cli.CommandLineOptionTest;
    48 import jdk.test.lib.cli.predicate.AndPredicate;
       
    49 import jdk.test.lib.cli.predicate.NotPredicate;
       
    50 
    46 
    51 public class TestUseRTMLockingOptionOnUnsupportedCPU
    47 public class TestUseRTMLockingOptionOnUnsupportedCPU {
    52         extends CommandLineOptionTest {
       
    53     private static final String DEFAULT_VALUE = "false";
    48     private static final String DEFAULT_VALUE = "false";
    54 
    49 
    55     private TestUseRTMLockingOptionOnUnsupportedCPU() {
       
    56         super(new AndPredicate(new NotPredicate(new SupportedCPU()),
       
    57                 new SupportedVM()));
       
    58     }
       
    59 
       
    60     @Override
       
    61     public void runTestCases() throws Throwable {
    50     public void runTestCases() throws Throwable {
    62         String unrecongnizedOption
    51         String unrecongnizedOption
    63                 = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
    52                 = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
    64                 "UseRTMLocking");
    53                 "UseRTMLocking");
    65         String errorMessage = RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR;
    54         String errorMessage = RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR;
   105                     ExitCode.FAIL, "-XX:-UseRTMLocking");
    94                     ExitCode.FAIL, "-XX:-UseRTMLocking");
   106         }
    95         }
   107     }
    96     }
   108 
    97 
   109     public static void main(String args[]) throws Throwable {
    98     public static void main(String args[]) throws Throwable {
   110         new TestUseRTMLockingOptionOnUnsupportedCPU().test();
    99         new TestUseRTMLockingOptionOnUnsupportedCPU().runTestCases();
   111     }
   100     }
   112 }
   101 }