Skip to content

Commit adcaf01

Browse files
committed
8355237: Upstream AOT test cases from Leyden repo to mainline
Reviewed-by: ccheung, kvn, lmesnik, shade
1 parent bf8a881 commit adcaf01

File tree

3 files changed

+3224
-3
lines changed

3 files changed

+3224
-3
lines changed

test/hotspot/jtreg/TEST.groups

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ hotspot_cds_only = \
408408

409409
hotspot_appcds_dynamic = \
410410
runtime/cds/appcds/ \
411+
-runtime/cds/appcds/aotCache \
411412
-runtime/cds/appcds/aotClassLinking \
412413
-runtime/cds/appcds/applications \
413414
-runtime/cds/appcds/cacheObject \
@@ -507,6 +508,7 @@ hotspot_cds_epsilongc = \
507508
# those that rely on redefining classes that are already archived.
508509
hotspot_aot_classlinking = \
509510
runtime/cds \
511+
-runtime/cds/appcds/aotCache \
510512
-runtime/cds/appcds/aotClassLinking \
511513
-runtime/cds/appcds/BadBSM.java \
512514
-runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java \
@@ -585,9 +587,8 @@ hotspot_metaspace = \
585587

586588
# A subset of AppCDS tests to be run in tier1
587589
tier1_runtime_appcds = \
588-
runtime/cds/appcds/HelloTest.java \
589-
runtime/cds/appcds/sharedStrings/SharedStringsBasic.java \
590-
runtime/cds/appcds/ClassLoaderTest.java
590+
runtime/cds/appcds/aotCache/HelloAOTCache.java \
591+
runtime/cds/appcds/HelloTest.java
591592

592593
tier1_runtime_appcds_exclude = \
593594
runtime/cds/appcds/ \
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (c) 2025, 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+
/*
27+
* @test
28+
* @summary Sanity test for AOTCache
29+
* @requires vm.cds.supports.aot.class.linking
30+
* @comment work around JDK-8345635
31+
* @requires !vm.jvmci.enabled
32+
* @library /test/lib
33+
* @build HelloAOTCache
34+
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar HelloAOTCacheApp
35+
* @run driver HelloAOTCache
36+
*/
37+
38+
import jdk.test.lib.cds.SimpleCDSAppTester;
39+
import jdk.test.lib.process.OutputAnalyzer;
40+
41+
public class HelloAOTCache {
42+
public static void main(String... args) throws Exception {
43+
SimpleCDSAppTester.of("HelloAOTCache")
44+
.addVmArgs("-Xlog:class+load")
45+
.classpath("app.jar")
46+
.appCommandLine("HelloAOTCacheApp")
47+
.setProductionChecker((OutputAnalyzer out) -> {
48+
out.shouldMatch("class,load.*HelloAOTCacheApp.*shared objects");
49+
out.shouldContain("HelloWorld");
50+
})
51+
.runAOTWorkflow();
52+
}
53+
}
54+
55+
class HelloAOTCacheApp {
56+
public static void main(String[] args) {
57+
System.out.println("HelloWorld");
58+
}
59+
}

0 commit comments

Comments
 (0)