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  * @test
27  * @summary This is a test case for creating an AOT cache using the setup_aot/TestSetupAOT.java program, which
28  *          is used for running HotSpot tests in the "AOT mode"
29  *          (E.g., make test JTREG=AOT_JDK=true TEST=open/test/hotspot/jtreg/runtime/invokedynamic)
30  * @requires vm.cds
31  * @requires vm.cds.supports.aot.class.linking
32  * @comment work around JDK-8345635
33  * @requires !vm.jvmci.enabled
34  * @library /test/lib /test/setup_aot
35  * @build TestSetupAOTTest JavacBenchApp TestSetupAOT
36  * @run driver jdk.test.lib.helpers.ClassFileInstaller
37  *                 TestSetupAOT
38  * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar
39  *                 TestSetupAOT
40  *                 TestSetupAOT$ToolOutput
41  *                 JavacBenchApp
42  *                 JavacBenchApp$ClassFile
43  *                 JavacBenchApp$FileManager
44  *                 JavacBenchApp$SourceFile
45  * @run driver TestSetupAOTTest
46  */
47 
48 import jdk.test.lib.cds.SimpleCDSAppTester;
49 import jdk.test.lib.process.OutputAnalyzer;
50 
51 public class TestSetupAOTTest {
52     public static void main(String... args) throws Exception {
53         SimpleCDSAppTester.of("TestSetupAOT")
54             .classpath("app.jar")
55             .appCommandLine("TestSetupAOT", ".")
56             .runAOTWorkflow();
57     }
58 }