hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java
author zgu
Thu, 04 Sep 2014 14:50:31 -0400
changeset 26561 e104c9397ca1
parent 20688 663a6dd0bcbf
child 29678 dd2f3932c21e
permissions -rw-r--r--
8055289: Internal Error: mallocTracker.cpp:146 fatal error: Should not use malloc for big memory block, use virtual memory instead Summary: Return NULL if memory allocation size is bigger than MAX_MALLOC_SIZE when NMT is on Reviewed-by: coleenp, gtriantafill
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
/*
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
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.
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    29
 * @library /testlibrary
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    30
 *
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    31
 */
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    32
import com.oracle.java.testlibrary.*;
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    33
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    34
public class CheckReservedInitialCodeCacheSizeArgOrder {
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    35
  public static void main(String[] args) throws Exception {
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    36
    ProcessBuilder pb1,  pb2;
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    37
    OutputAnalyzer out1, out2;
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    38
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    39
    pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    40
    pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    41
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    42
    out1 = new OutputAnalyzer(pb1.start());
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    43
    out2 = new OutputAnalyzer(pb2.start());
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    44
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    45
    // Check that the outputs are equal
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    46
    if (out1.getStdout().compareTo(out2.getStdout()) != 0) {
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    47
      throw new RuntimeException("Test failed");
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    48
    }
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    49
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    50
    out1.shouldHaveExitValue(0);
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    51
    out2.shouldHaveExitValue(0);
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    52
  }
663a6dd0bcbf 8025656: compiler/8013496/Test8013496.sh fails on assert
anoll
parents:
diff changeset
    53
}