test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 4807
1feda2e9f044
child 6876
710a3c8b516e
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

ctornqvi@4563 1 /*
ctornqvi@4563 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
ctornqvi@4563 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ctornqvi@4563 4 *
ctornqvi@4563 5 * This code is free software; you can redistribute it and/or modify it
ctornqvi@4563 6 * under the terms of the GNU General Public License version 2 only, as
ctornqvi@4563 7 * published by the Free Software Foundation.
ctornqvi@4563 8 *
ctornqvi@4563 9 * This code is distributed in the hope that it will be useful, but WITHOUT
ctornqvi@4563 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ctornqvi@4563 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ctornqvi@4563 12 * version 2 for more details (a copy is included in the LICENSE file that
ctornqvi@4563 13 * accompanied this code).
ctornqvi@4563 14 *
ctornqvi@4563 15 * You should have received a copy of the GNU General Public License version
ctornqvi@4563 16 * 2 along with this work; if not, write to the Free Software Foundation,
ctornqvi@4563 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ctornqvi@4563 18 *
ctornqvi@4563 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ctornqvi@4563 20 * or visit www.oracle.com if you need additional information or have any
ctornqvi@4563 21 * questions.
ctornqvi@4563 22 */
ctornqvi@4563 23
ctornqvi@4563 24 /*
ctornqvi@4563 25 * @test
ctornqvi@4563 26 * @bug 8006298
ctornqvi@4563 27 * @summary Using a bool (+/-) prefix on non-bool flag should result in a useful error message
ctornqvi@4563 28 * @library /testlibrary
ctornqvi@4563 29 */
ctornqvi@4563 30
ctornqvi@4563 31 import com.oracle.java.testlibrary.*;
ctornqvi@4563 32
ctornqvi@4563 33 public class NonBooleanFlagWithInvalidBooleanPrefix {
ctornqvi@4563 34 public static void main(String[] args) throws Exception {
ctornqvi@4563 35 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
ctornqvi@4807 36 "-XX:-MaxRAMFraction=16", "-version");
ctornqvi@4563 37
ctornqvi@4563 38 OutputAnalyzer output = new OutputAnalyzer(pb.start());
ctornqvi@4807 39 output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'");
ctornqvi@4563 40 output.shouldHaveExitValue(1);
ctornqvi@4563 41
ctornqvi@4563 42 pb = ProcessTools.createJavaProcessBuilder(
ctornqvi@4807 43 "-XX:+MaxRAMFraction=16", "-version");
ctornqvi@4563 44
ctornqvi@4563 45 output = new OutputAnalyzer(pb.start());
ctornqvi@4807 46 output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'");
ctornqvi@4563 47 output.shouldHaveExitValue(1);
ctornqvi@4563 48
ctornqvi@4563 49 }
ctornqvi@4563 50 }

mercurial