test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java

Mon, 11 Aug 2014 19:19:47 +0400

author
fzhinkin
date
Mon, 11 Aug 2014 19:19:47 +0400
changeset 6999
cabe05c85665
parent 6640
9f9257611ade
child 7535
7ae4e26cb1e0
permissions
-rw-r--r--

8054805: Update CLI tests on RTM options to reflect changes in JDK-8054376
Reviewed-by: kvn

iignatyev@6615 1 /*
iignatyev@6615 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
iignatyev@6615 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
iignatyev@6615 4 *
iignatyev@6615 5 * This code is free software; you can redistribute it and/or modify it
iignatyev@6615 6 * under the terms of the GNU General Public License version 2 only, as
iignatyev@6615 7 * published by the Free Software Foundation.
iignatyev@6615 8 *
iignatyev@6615 9 * This code is distributed in the hope that it will be useful, but WITHOUT
iignatyev@6615 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
iignatyev@6615 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
iignatyev@6615 12 * version 2 for more details (a copy is included in the LICENSE file that
iignatyev@6615 13 * accompanied this code).
iignatyev@6615 14 *
iignatyev@6615 15 * You should have received a copy of the GNU General Public License version
iignatyev@6615 16 * 2 along with this work; if not, write to the Free Software Foundation,
iignatyev@6615 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
iignatyev@6615 18 *
iignatyev@6615 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
iignatyev@6615 20 * or visit www.oracle.com if you need additional information or have any
iignatyev@6615 21 * questions.
iignatyev@6615 22 *
iignatyev@6615 23 */
iignatyev@6615 24
iignatyev@6615 25 /**
iignatyev@6615 26 * @test
iignatyev@6615 27 * @bug 8031320
iignatyev@6615 28 * @summary Verify UseRTMDeopt option processing on CPUs without rtm support
iignatyev@6615 29 * or on VMs without rtm locking support.
iignatyev@6640 30 * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
iignatyev@6615 31 * @build TestUseRTMDeoptOptionOnUnsupportedConfig
iignatyev@6615 32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
iignatyev@6615 33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
iignatyev@6615 34 * -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig
iignatyev@6615 35 */
iignatyev@6615 36
iignatyev@6615 37 import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
iignatyev@6615 38
iignatyev@6615 39 import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
iignatyev@6615 40 import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
iignatyev@6615 41 import rtm.predicate.SupportedCPU;
iignatyev@6615 42 import rtm.predicate.SupportedVM;
iignatyev@6615 43
iignatyev@6615 44 public class TestUseRTMDeoptOptionOnUnsupportedConfig
iignatyev@6615 45 extends RTMGenericCommandLineOptionTest {
iignatyev@6615 46 private static final String DEFAULT_VALUE = "false";
iignatyev@6615 47
iignatyev@6615 48 private TestUseRTMDeoptOptionOnUnsupportedConfig() {
iignatyev@6615 49 super(new NotPredicate(new AndPredicate(new SupportedCPU(),
iignatyev@6615 50 new SupportedVM())),
fzhinkin@6999 51 "UseRTMDeopt", true, false,
iignatyev@6615 52 TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, "true");
iignatyev@6615 53 }
iignatyev@6615 54
iignatyev@6615 55 @Override
iignatyev@6615 56 protected void runX86SupportedVMTestCases() throws Throwable {
iignatyev@6615 57 super.verifyJVMStartup();
iignatyev@6615 58 // verify default value
iignatyev@6615 59 CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
fzhinkin@6999 60 defaultValue);
iignatyev@6615 61 // verify that until RTMLocking is not used, value
iignatyev@6615 62 // will be set to default false.
iignatyev@6615 63 CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
fzhinkin@6999 64 defaultValue, "-XX:+UseRTMDeopt");
iignatyev@6615 65 }
iignatyev@6615 66
iignatyev@6615 67 public static void main(String args[]) throws Throwable {
iignatyev@6615 68 new TestUseRTMDeoptOptionOnUnsupportedConfig().test();
iignatyev@6615 69 }
iignatyev@6615 70 }

mercurial