Skip to content

Commit fac0f5a

Browse files
committed
8237798: rewrite vmTestbase/jit/tiered from shell to java
Backport-of: fc8d71b
1 parent f5ade3e commit fac0f5a

File tree

4 files changed

+77
-113
lines changed

4 files changed

+77
-113
lines changed

test/hotspot/jtreg/TEST.quick-groups

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ vmTestbase_vm_compiler_quick = \
17851785
vmTestbase/jit/t/t111/TestDescription.java \
17861786
vmTestbase/jit/t/t112/TestDescription.java \
17871787
vmTestbase/jit/t/t113/TestDescription.java \
1788-
vmTestbase/jit/tiered/TestDescription.java \
1788+
vmTestbase/jit/tiered/Test.java \
17891789
vmTestbase/jit/verifier/VerifyInitLocal/VerifyInitLocal.java \
17901790
vmTestbase/jit/verifier/VerifyMergeStack/VerifyMergeStack.java \
17911791
vmTestbase/jit/wide/wide01/wide01.java \
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
25+
/*
26+
* @test
27+
*
28+
* @summary converted from VM Testbase jit/tiered.
29+
* VM Testbase keywords: [jit, quick]
30+
* VM Testbase readme:
31+
* Description
32+
* The test verifies that JVM prints tiered events with -XX:+PrintTieredEvents
33+
* for tiered compilation explicitly enabled with -XX:+TieredCompilation.
34+
* If tiered compilation is explicitly disabled the test verifies that there are no
35+
* output from PrintTieredEvents.
36+
*
37+
* @library /vmTestbase
38+
* /test/lib
39+
* @run driver vmTestbase.jit.tiered.Test
40+
*/
41+
42+
package vmTestbase.jit.tiered;
43+
44+
import jtreg.SkippedException;
45+
import jdk.test.lib.process.OutputAnalyzer;
46+
import jdk.test.lib.process.ProcessTools;
47+
48+
public class Test {
49+
private static String UNSUPPORTED_OPTION_MESSAGE = "-XX:TieredCompilation not supported in this VM";
50+
private static String REGEXP = "^[0-9.]+: \\[compile level=\\d";
51+
public static void main(String[] args) throws Exception {
52+
{
53+
System.out.println("TieredCompilation is enabled");
54+
var pb = ProcessTools.createJavaProcessBuilder(true,
55+
"-XX:+TieredCompilation",
56+
"-XX:+PrintTieredEvents",
57+
"-version");
58+
var output = new OutputAnalyzer(pb.start());
59+
if (output.getStdout().contains(UNSUPPORTED_OPTION_MESSAGE)) {
60+
throw new SkippedException(UNSUPPORTED_OPTION_MESSAGE);
61+
}
62+
output.shouldHaveExitValue(0)
63+
.stdoutShouldMatch(REGEXP);
64+
}
65+
{
66+
System.out.println("TieredCompilation is disabled");
67+
var pb = ProcessTools.createJavaProcessBuilder(true,
68+
"-XX:-TieredCompilation",
69+
"-XX:+PrintTieredEvents",
70+
"-version");
71+
var output = new OutputAnalyzer(pb.start())
72+
.shouldHaveExitValue(0)
73+
.stdoutShouldNotMatch(REGEXP);
74+
}
75+
}
76+
}

test/hotspot/jtreg/vmTestbase/jit/tiered/TestDescription.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

test/hotspot/jtreg/vmTestbase/jit/tiered/tieredTest.sh

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)