hotspot/test/compiler/arguments/CheckCICompilerCount.java
author lana
Thu, 23 Feb 2017 17:30:12 +0000
changeset 44011 5eea3031ae7b
parent 40631 ed82623d7831
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     1
/*
37253
45e69c7b0bac 8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents: 32585
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     4
 *
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     8
 *
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    13
 * accompanied this code).
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    14
 *
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    18
 *
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    21
 * questions.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    22
 */
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    23
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    24
/*
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    25
 * @test CheckCheckCICompilerCount
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    26
 * @bug 8130858 8132525 8162881
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    27
 * @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40364
diff changeset
    28
 * @library /test/lib /
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 32585
diff changeset
    29
 * @modules java.base/jdk.internal.misc
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    30
 *          java.management
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 37297
diff changeset
    31
 * @run driver compiler.arguments.CheckCICompilerCount
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    32
 */
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    33
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 37297
diff changeset
    34
package compiler.arguments;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 37297
diff changeset
    35
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40364
diff changeset
    36
import jdk.test.lib.process.OutputAnalyzer;
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40364
diff changeset
    37
import jdk.test.lib.process.ProcessTools;
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 37297
diff changeset
    38
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    39
public class CheckCICompilerCount {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    40
    private static final String[][] NON_TIERED_ARGUMENTS = {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    41
        {
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    42
            "-server",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    43
            "-XX:-TieredCompilation",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    44
            "-XX:+PrintFlagsFinal",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    45
            "-XX:CICompilerCount=0",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    46
            "-version"
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    47
        },
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    48
        {
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    49
            "-server",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    50
            "-XX:-TieredCompilation",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    51
            "-XX:+PrintFlagsFinal",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    52
            "-XX:CICompilerCount=1",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    53
            "-version"
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    54
        },
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    55
        {
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    56
            "-server",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    57
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    58
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    59
            "-XX:-TieredCompilation",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    60
            "-version"
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    61
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    62
        {
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    63
            "-client",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    64
            "-XX:-TieredCompilation",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    65
            "-XX:+PrintFlagsFinal",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    66
            "-XX:CICompilerCount=0",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    67
            "-version"
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    68
        },
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    69
        {
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    70
            "-client",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    71
            "-XX:-TieredCompilation",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    72
            "-XX:+PrintFlagsFinal",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    73
            "-XX:CICompilerCount=1",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    74
            "-version"
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    75
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    76
        {
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    77
            "-client",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    78
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    79
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    80
            "-XX:-TieredCompilation",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    81
            "-version"
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    82
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    83
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    84
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    85
    private static final String[] NON_TIERED_EXPECTED_OUTPUTS = {
32365
5ac17a803e1c 8133678: test fails due to 'CICompilerCount=0 must be at least 1' missing from stdout/stderr
gziemski
parents: 32083
diff changeset
    86
            "CICompilerCount (0) must be at least 1",
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    87
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    88
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    89
            "CICompilerCount (0) must be at least 1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    90
            "intx CICompilerCount                          = 1                                        {product} {command line}",
39960
ec06b2cf8575 8048093: Explicitly setting := vs = in the -XX:+PrintFlagsFinal output
jwilhelm
parents: 37297
diff changeset
    91
            "intx CICompilerCount                          = 1                                        {product} {command line}"
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    92
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    93
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    94
    private static final int[] NON_TIERED_EXIT = {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
    95
        1,
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    96
        0,
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    97
        0,
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    98
        1,
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
    99
        0,
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   100
        0
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   101
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   102
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   103
    private static final String[][] TIERED_ARGUMENTS = {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   104
        {
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   105
            "-server",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   106
            "-XX:+TieredCompilation",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   107
            "-XX:+PrintFlagsFinal",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   108
            "-XX:CICompilerCount=1",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   109
            "-version"
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   110
        },
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   111
        {
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   112
            "-server",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   113
            "-XX:+TieredCompilation",
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   114
            "-XX:TieredStopAtLevel=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   115
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   116
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   117
            "-version"
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   118
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   119
        {
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   120
            "-server",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   121
            "-XX:+TieredCompilation",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   122
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   123
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   124
            "-XX:TieredStopAtLevel=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   125
            "-version"
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   126
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   127
        {
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   128
            "-server",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   129
            "-XX:+TieredCompilation",
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   130
            "-XX:+PrintFlagsFinal",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   131
            "-XX:CICompilerCount=2",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   132
            "-version"
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   133
        },
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   134
        {
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   135
            "-client",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   136
            "-XX:+TieredCompilation",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   137
            "-XX:+PrintFlagsFinal",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   138
            "-XX:CICompilerCount=1",
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   139
            "-version"
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   140
        },
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   141
        {
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   142
            "-client",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   143
            "-XX:+TieredCompilation",
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   144
            "-XX:TieredStopAtLevel=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   145
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   146
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   147
            "-version"
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   148
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   149
        {
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   150
            "-client",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   151
            "-XX:+TieredCompilation",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   152
            "-XX:+PrintFlagsFinal",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   153
            "-XX:CICompilerCount=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   154
            "-XX:TieredStopAtLevel=1",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   155
            "-version"
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   156
        },
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   157
        {
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   158
            "-client",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   159
            "-XX:+TieredCompilation",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   160
            "-XX:+PrintFlagsFinal",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   161
            "-XX:CICompilerCount=2",
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   162
            "-version"
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   163
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   164
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   165
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   166
    private static final String[] TIERED_EXPECTED_OUTPUTS = {
32365
5ac17a803e1c 8133678: test fails due to 'CICompilerCount=0 must be at least 1' missing from stdout/stderr
gziemski
parents: 32083
diff changeset
   167
            "CICompilerCount (1) must be at least 2",
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   168
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   169
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   170
            "intx CICompilerCount                          = 2                                        {product} {command line}",
32585
cffadc776803 8134239: compiler/arguments/CheckCICompilerCount.java still fails
gziemski
parents: 32365
diff changeset
   171
            "CICompilerCount (1) must be at least 2",
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   172
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   173
            "intx CICompilerCount                          = 1                                        {product} {command line}",
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   174
            "intx CICompilerCount                          = 2                                        {product} {command line}",
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   175
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   176
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   177
    private static final int[] TIERED_EXIT = {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   178
        1,
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   179
        0,
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   180
        0,
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   181
        0,
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
   182
        1,
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   183
        0,
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   184
        0,
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   185
        0
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   186
    };
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   187
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   188
    private static void verifyValidOption(String[] arguments, String expected_output, int exit, boolean tiered) throws Exception {
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   189
        ProcessBuilder pb;
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   190
        OutputAnalyzer out;
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   191
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   192
        pb = ProcessTools.createJavaProcessBuilder(arguments);
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   193
        out = new OutputAnalyzer(pb.start());
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   194
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   195
        try {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   196
            out.shouldHaveExitValue(exit);
40364
5bf8fa4fddfd 8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents: 40072
diff changeset
   197
            out.shouldContain(expected_output);
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   198
        } catch (RuntimeException e) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   199
            // Check if tiered compilation is available in this JVM
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   200
            // Version. Throw exception only if it is available.
37253
45e69c7b0bac 8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents: 32585
diff changeset
   201
            if (!(tiered && out.getOutput().contains("-XX:+TieredCompilation not supported in this VM"))) {
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   202
                throw new RuntimeException(e);
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   203
            }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   204
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   205
    }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   206
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   207
    public static void main(String[] args) throws Exception {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   208
        if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length || NON_TIERED_ARGUMENTS.length != NON_TIERED_EXIT.length) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   209
            throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in non-tiered mode of operation do not match.");
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   210
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   211
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   212
        if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length || TIERED_ARGUMENTS.length != TIERED_EXIT.length) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   213
            throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in tiered mode of operation do not match.");
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   214
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   215
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   216
        for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   217
            verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], NON_TIERED_EXIT[i], false);
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   218
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   219
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   220
        for (int i = 0; i < TIERED_ARGUMENTS.length; i++) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   221
            verifyValidOption(TIERED_ARGUMENTS[i], TIERED_EXPECTED_OUTPUTS[i], TIERED_EXIT[i], true);
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   222
        }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   223
    }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents:
diff changeset
   224
}