test/hotspot/jtreg/compiler/startup/NumCompilerThreadsCheck.java
author jiangli
Fri, 02 Nov 2018 19:30:31 -0400
changeset 52397 1322829d1501
parent 47216 71c04702a3d5
permissions -rw-r--r--
8209564: runtime/appcds/CDSandJFR.java timeout on tier6 on sparc Summary: Set timeout 500 in CDSandJFR.java Reviewed-by: dcubed
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
/*
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
     2
 * Copyright (c) 2014, 2016, 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=)
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    28
 * @library /test/lib
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 31371
diff changeset
    29
 * @modules java.base/jdk.internal.misc
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 24338
diff changeset
    30
 *          java.management
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    31
 *
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    32
 * @run driver compiler.startup.NumCompilerThreadsCheck
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    33
 */
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    34
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    35
package compiler.startup;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    36
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    37
import jdk.test.lib.process.OutputAnalyzer;
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    38
import jdk.test.lib.Platform;
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    39
import jdk.test.lib.process.ProcessTools;
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    40
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    41
public class NumCompilerThreadsCheck {
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    42
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    43
  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
    44
    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
    45
    OutputAnalyzer out = new OutputAnalyzer(pb.start());
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    46
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents: 30604
diff changeset
    47
    String expectedOutput = "outside the allowed range";
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    48
    out.shouldContain(expectedOutput);
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    49
30110
20d4dc1409a6 8075533: Zero JVM segfaults for -version after JDK-8074552
sgehwolf
parents: 24338
diff changeset
    50
    if (Platform.isZero()) {
24338
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    51
      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
    52
      out.shouldContain(expectedLowWaterMarkText);
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    53
    }
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    54
  }
bff6fc677861 8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
anoll
parents: 22913
diff changeset
    55
22913
d80017962061 8034775: Failing to initialize VM when running with negative value for -XX:CICompilerCount
anoll
parents:
diff changeset
    56
}