test/hotspot/jtreg/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
author dtitov
Fri, 31 Aug 2018 11:56:43 -0700
changeset 51613 3835dc32de5e
parent 47216 71c04702a3d5
permissions -rw-r--r--
8209585: [Graal] vmTestbase/nsk/jvmti/scenarios/sampling tests fail with "Too small stack of resumed thread" Reviewed-by: sspitsyn, amenkov, cjplummer, jcbeyler
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     1
/*
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
     2
 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     4
 *
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     7
 * published by the Free Software Foundation.
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     8
 *
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    13
 * accompanied this code).
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    14
 *
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    18
 *
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    21
 * questions.
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    22
 */
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    23
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    24
/*
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    25
 * @test
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    26
 * @bug 8013496
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    27
 * @summary Test checks that the order in which ReversedCodeCacheSize and
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    28
 *          InitialCodeCacheSize are passed to the VM is irrelevant.
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    29
 * @library /test/lib
36851
03e2f4d0a421 8153737: Unsupported Module
chegar
parents: 30604
diff changeset
    30
 * @modules java.base/jdk.internal.misc
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 20688
diff changeset
    31
 *          java.management
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    32
 *
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    33
 * @run driver compiler.codecache.CheckReservedInitialCodeCacheSizeArgOrder
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    34
 */
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    35
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    36
package compiler.codecache;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    37
40631
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    38
import jdk.test.lib.process.OutputAnalyzer;
ed82623d7831 8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents: 40059
diff changeset
    39
import jdk.test.lib.process.ProcessTools;
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    40
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    41
public class CheckReservedInitialCodeCacheSizeArgOrder {
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    42
    public static void main(String[] args) throws Exception {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    43
        ProcessBuilder pb1,  pb2;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    44
        OutputAnalyzer out1, out2;
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    45
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    46
        pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    47
        pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    48
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    49
        out1 = new OutputAnalyzer(pb1.start());
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    50
        out2 = new OutputAnalyzer(pb2.start());
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    51
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    52
        // Check that the outputs are equal
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    53
        if (out1.getStdout().compareTo(out2.getStdout()) != 0) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    54
            throw new RuntimeException("Test failed");
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    55
        }
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    56
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    57
        out1.shouldHaveExitValue(0);
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    58
        out2.shouldHaveExitValue(0);
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 36851
diff changeset
    59
    }
20688
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    60
}