25 /**
26 * @test
27 * @bug 8031320
28 * @summary Verify UseRTMLocking option processing on CPU with rtm support and
29 * on VM with rtm-locking support.
30 * @library /test/lib /
31 * @modules java.base/jdk.internal.misc
32 * java.management
33 *
34 * @build sun.hotspot.WhiteBox
35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
36 * sun.hotspot.WhiteBox$WhiteBoxPermission
37 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
38 * -XX:+WhiteBoxAPI
39 * compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig
40 */
41
42 package compiler.rtm.cli;
43
44 import compiler.testlibrary.rtm.predicate.SupportedCPU;
45 import compiler.testlibrary.rtm.predicate.SupportedVM;
46 import jdk.test.lib.process.ExitCode;
47 import jdk.test.lib.cli.CommandLineOptionTest;
48 import jdk.test.lib.cli.predicate.AndPredicate;
49
50 public class TestUseRTMLockingOptionOnSupportedConfig
51 extends CommandLineOptionTest {
52 private static final String DEFAULT_VALUE = "false";
53
54 private TestUseRTMLockingOptionOnSupportedConfig() {
55 super(new AndPredicate(new SupportedVM(), new SupportedCPU()));
56 }
57
58 @Override
59 public void runTestCases() throws Throwable {
60 String unrecongnizedOption
61 = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
62 "UseRTMLocking");
63 String shouldPassMessage = "VM option 'UseRTMLocking' is experimental"
64 + "%nJVM startup should pass with "
65 + "-XX:+UnlockExperimentalVMOptions flag";
66 // verify that there are no warning or error in VM output
67 CommandLineOptionTest.verifySameJVMStartup(null,
68 new String[]{
69 RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
70 unrecongnizedOption
71 }, shouldPassMessage, "There should not be any warning when use"
72 + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK,
73 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
74 "-XX:+UseRTMLocking"
75 );
|
25 /**
26 * @test
27 * @bug 8031320
28 * @summary Verify UseRTMLocking option processing on CPU with rtm support and
29 * on VM with rtm-locking support.
30 * @library /test/lib /
31 * @modules java.base/jdk.internal.misc
32 * java.management
33 *
34 * @build sun.hotspot.WhiteBox
35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
36 * sun.hotspot.WhiteBox$WhiteBoxPermission
37 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
38 * -XX:+WhiteBoxAPI
39 * compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig
40 */
41
42 package compiler.rtm.cli;
43
44 import compiler.testlibrary.rtm.predicate.SupportedCPU;
45 import compiler.testlibrary.rtm.predicate.SupportedOS;
46 import compiler.testlibrary.rtm.predicate.SupportedVM;
47 import jdk.test.lib.process.ExitCode;
48 import jdk.test.lib.cli.CommandLineOptionTest;
49 import jdk.test.lib.cli.predicate.AndPredicate;
50
51 public class TestUseRTMLockingOptionOnSupportedConfig
52 extends CommandLineOptionTest {
53 private static final String DEFAULT_VALUE = "false";
54
55 private TestUseRTMLockingOptionOnSupportedConfig() {
56 super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
57 }
58
59 @Override
60 public void runTestCases() throws Throwable {
61 String unrecongnizedOption
62 = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
63 "UseRTMLocking");
64 String shouldPassMessage = "VM option 'UseRTMLocking' is experimental"
65 + "%nJVM startup should pass with "
66 + "-XX:+UnlockExperimentalVMOptions flag";
67 // verify that there are no warning or error in VM output
68 CommandLineOptionTest.verifySameJVMStartup(null,
69 new String[]{
70 RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
71 unrecongnizedOption
72 }, shouldPassMessage, "There should not be any warning when use"
73 + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK,
74 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
75 "-XX:+UseRTMLocking"
76 );
|