26 * @bug 8136421
27 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
28 * @library / /testlibrary /test/lib
29 * @library ../common/patches
30 * @modules java.base/jdk.internal.misc
31 * @modules jdk.vm.ci/jdk.vm.ci.hotspot
32 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
33 * @build compiler.jvmci.compilerToVM.GetClassInitializerTest
34 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
35 * compiler.jvmci.compilerToVM.GetClassInitializerTest
36 */
37
38 package compiler.jvmci.compilerToVM;
39
40 import compiler.jvmci.common.testcases.AbstractClass;
41 import compiler.jvmci.common.testcases.AbstractClassExtender;
42 import compiler.jvmci.common.testcases.DoNotExtendClass;
43 import compiler.jvmci.common.testcases.MultipleImplementersInterfaceExtender;
44 import compiler.jvmci.common.testcases.SingleImplementer;
45 import compiler.jvmci.common.testcases.SingleImplementerInterface;
46 import java.util.HashSet;
47 import java.util.Set;
48 import jdk.vm.ci.hotspot.CompilerToVMHelper;
49 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
50 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
51 import jdk.test.lib.Asserts;
52 import jdk.test.lib.Utils;
53
54 public class GetClassInitializerTest {
55
56 public static void main(String args[]) {
57 GetClassInitializerTest test = new GetClassInitializerTest();
58 for (TestCase tcase : createTestCases()) {
59 test.runTest(tcase);
60 }
61 }
62
63 private static Set<TestCase> createTestCases() {
64 Set<TestCase> result = new HashSet<>();
65 // a simple class with initializer
66 result.add(new TestCase(SingleImplementer.class, true));
67 // an interface with initializer
68 result.add(new TestCase(SingleImplementerInterface.class, true));
69 // an abstract class with initializer
70 result.add(new TestCase(AbstractClass.class, true));
71 // a class without initializer, extending class with initializer
72 result.add(new TestCase(AbstractClassExtender.class, false));
73 // an interface without initializer
|
26 * @bug 8136421
27 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
28 * @library / /testlibrary /test/lib
29 * @library ../common/patches
30 * @modules java.base/jdk.internal.misc
31 * @modules jdk.vm.ci/jdk.vm.ci.hotspot
32 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
33 * @build compiler.jvmci.compilerToVM.GetClassInitializerTest
34 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
35 * compiler.jvmci.compilerToVM.GetClassInitializerTest
36 */
37
38 package compiler.jvmci.compilerToVM;
39
40 import compiler.jvmci.common.testcases.AbstractClass;
41 import compiler.jvmci.common.testcases.AbstractClassExtender;
42 import compiler.jvmci.common.testcases.DoNotExtendClass;
43 import compiler.jvmci.common.testcases.MultipleImplementersInterfaceExtender;
44 import compiler.jvmci.common.testcases.SingleImplementer;
45 import compiler.jvmci.common.testcases.SingleImplementerInterface;
46 import jdk.test.lib.Asserts;
47 import jdk.test.lib.Utils;
48 import jdk.vm.ci.hotspot.CompilerToVMHelper;
49 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
50 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
51
52 import java.util.HashSet;
53 import java.util.Set;
54
55 public class GetClassInitializerTest {
56
57 public static void main(String args[]) {
58 GetClassInitializerTest test = new GetClassInitializerTest();
59 for (TestCase tcase : createTestCases()) {
60 test.runTest(tcase);
61 }
62 }
63
64 private static Set<TestCase> createTestCases() {
65 Set<TestCase> result = new HashSet<>();
66 // a simple class with initializer
67 result.add(new TestCase(SingleImplementer.class, true));
68 // an interface with initializer
69 result.add(new TestCase(SingleImplementerInterface.class, true));
70 // an abstract class with initializer
71 result.add(new TestCase(AbstractClass.class, true));
72 // a class without initializer, extending class with initializer
73 result.add(new TestCase(AbstractClassExtender.class, false));
74 // an interface without initializer
|