Mercurial > hg > truffle
annotate test/gc/arguments/TestHeapFreeRatio.java @ 19147:609480dfa0d8
Create ExplodeLoop plugin prototype. Special sort for blocks from bci block map builder for explode loop methods. Graph builder plugin for customizing static field accesses. New Truffle option TruffleExcludeAssertions default true that excludes assertion code from being partial evaluated in the new partial evaluator.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 05 Feb 2015 03:25:21 +0100 |
parents | 027006a47a6d |
children |
rev | line source |
---|---|
12896
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
1 /* |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
4 * |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
8 * |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
13 * accompanied this code). |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
14 * |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
18 * |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
21 * questions. |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
22 */ |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
23 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
24 /* |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
25 * @test TestHeapFreeRatio |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
26 * @key gc |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
27 * @bug 8025661 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
28 * @summary Test parsing of -Xminf and -Xmaxf |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
29 * @library /testlibrary |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
30 * @run main/othervm TestHeapFreeRatio |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
31 */ |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
32 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
33 import com.oracle.java.testlibrary.*; |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
34 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
35 public class TestHeapFreeRatio { |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
36 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
37 enum Validation { |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
38 VALID, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
39 MIN_INVALID, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
40 MAX_INVALID, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
41 COMBINATION_INVALID |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
42 } |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
43 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
44 private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception { |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
46 "-Xminf" + min, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
47 "-Xmaxf" + max, |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
48 "-version"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
49 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
50 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
51 switch (type) { |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
52 case VALID: |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
53 output.shouldNotContain("Error"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
54 output.shouldHaveExitValue(0); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
55 break; |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
56 case MIN_INVALID: |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
57 output.shouldContain("Bad min heap free percentage size: -Xminf" + min); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
58 output.shouldContain("Error"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
59 output.shouldHaveExitValue(1); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
60 break; |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
61 case MAX_INVALID: |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
62 output.shouldContain("Bad max heap free percentage size: -Xmaxf" + max); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
63 output.shouldContain("Error"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
64 output.shouldHaveExitValue(1); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
65 break; |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
66 case COMBINATION_INVALID: |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
67 output.shouldContain("must be less than or equal to MaxHeapFreeRatio"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
68 output.shouldContain("Error"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
69 output.shouldHaveExitValue(1); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
70 break; |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
71 default: |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
72 throw new IllegalStateException("Must specify expected validation type"); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
73 } |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
74 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
75 System.out.println(output.getOutput()); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
76 } |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
77 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
78 public static void main(String args[]) throws Exception { |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
79 testMinMaxFreeRatio( "0.1", "0.5", Validation.VALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
80 testMinMaxFreeRatio( ".1", ".5", Validation.VALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
81 testMinMaxFreeRatio( "0.5", "0.5", Validation.VALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
82 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
83 testMinMaxFreeRatio("-0.1", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
84 testMinMaxFreeRatio( "1.1", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
85 testMinMaxFreeRatio("=0.1", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
86 testMinMaxFreeRatio("0.1f", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
87 testMinMaxFreeRatio( |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
88 "INVALID", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
89 testMinMaxFreeRatio( |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
90 "2147483647", "0.5", Validation.MIN_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
91 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
92 testMinMaxFreeRatio( "0.1", "-0.5", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
93 testMinMaxFreeRatio( "0.1", "1.5", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
94 testMinMaxFreeRatio( "0.1", "0.5f", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
95 testMinMaxFreeRatio( "0.1", "=0.5", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
96 testMinMaxFreeRatio( |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
97 "0.1", "INVALID", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
98 testMinMaxFreeRatio( |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
99 "0.1", "2147483647", Validation.MAX_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
100 |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
101 testMinMaxFreeRatio( "0.5", "0.1", Validation.COMBINATION_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
102 testMinMaxFreeRatio( ".5", ".10", Validation.COMBINATION_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
103 testMinMaxFreeRatio("0.12","0.100", Validation.COMBINATION_INVALID); |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
104 } |
027006a47a6d
8025661: Ill-formed -Xminf and -Xmaxf options values interpreted as 0
sjohanss
parents:
diff
changeset
|
105 } |