hotspot/test/compiler/startup/NumCompilerThreadsCheck.java
author ykantser
Mon, 04 May 2015 16:30:07 +0200
changeset 30604 b8d532cb6420
parent 30146 a5809dde4617
child 31371 311143309e73
permissions -rw-r--r--
8067013: Rename the com.oracle.java.testlibary package Reviewed-by: dholmes, gtriantafill, sla Contributed-by: alexander.kulyakhtin@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 24338
diff changeset
     2
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     4
 *
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     8
 *
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    13
 * accompanied this code).
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    14
 *
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    18
 *
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    21
 * questions.
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    22
 */
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    23
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    24
/*
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    25
 * @test
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    26
 * @bug 8034775
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    27
 * @summary Ensures correct minimal number of compiler threads (provided by -XX:CICompilerCount=)
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    28
 * @library /testlibrary
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 24338
diff changeset
    29
 * @modules java.base/sun.misc
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 24338
diff changeset
    30
 *          java.management
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    31
 */
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 30146
diff changeset
    32
import jdk.test.lib.*;
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    33
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    34
public class NumCompilerThreadsCheck {
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    35
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    36
  public static void main(String[] args) throws Exception {
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    37
    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    38
    OutputAnalyzer out = new OutputAnalyzer(pb.start());
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    39
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    40
    String expectedOutput = "CICompilerCount of -1 is invalid";
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    41
    out.shouldContain(expectedOutput);
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    42
30110
20d4dc1409a6 8075533: Zero JVM segfaults for -version after JDK-8074552
sgehwolf
parents: 24338
diff changeset
    43
    if (Platform.isZero()) {
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    44
      String expectedLowWaterMarkText = "must be at least 0";
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    45
      out.shouldContain(expectedLowWaterMarkText);
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    46
    }
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    47
  }
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    48
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    49
}