23
24 /*
25 * @test
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 java.base/jdk.internal.org.objectweb.asm
32 * java.base/jdk.internal.org.objectweb.asm.tree
33 * jdk.vm.ci/jdk.vm.ci.hotspot
34 * jdk.vm.ci/jdk.vm.ci.code
35 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
36 * @build compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
37 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
38 * compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
39 */
40
41 package compiler.jvmci.compilerToVM;
42
43 import compiler.jvmci.common.testcases.MultipleImplementer1;
44 import compiler.jvmci.common.testcases.SingleImplementer;
45 import compiler.jvmci.common.testcases.SingleSubclass;
46 import compiler.jvmci.common.CTVMUtilities;
47 import compiler.jvmci.common.testcases.SingleImplementerInterface;
48 import java.lang.reflect.Method;
49 import java.util.HashSet;
50 import java.util.Set;
51 import jdk.vm.ci.hotspot.CompilerToVMHelper;
52 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
53 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
54 import jdk.test.lib.Asserts;
55 import jdk.test.lib.Utils;
56
57 public class FindUniqueConcreteMethodTest {
58 public static void main(String args[]) {
59 FindUniqueConcreteMethodTest test = new FindUniqueConcreteMethodTest();
60 try {
61 for (TestCase tcase : createTestCases()) {
62 test.runTest(tcase);
63 }
64 } catch (NoSuchMethodException e) {
65 throw new Error("TEST BUG: can't find method", e);
66 }
67 }
68
69 private static Set<TestCase> createTestCases() {
70 Set<TestCase> result = new HashSet<>();
71 // a public method
72 result.add(new TestCase(true, SingleSubclass.class,
73 SingleSubclass.class, "usualMethod"));
74 // overriden method
75 result.add(new TestCase(true, SingleSubclass.class,
76 SingleSubclass.class, "overridenMethod"));
|
23
24 /*
25 * @test
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 java.base/jdk.internal.org.objectweb.asm
32 * java.base/jdk.internal.org.objectweb.asm.tree
33 * jdk.vm.ci/jdk.vm.ci.hotspot
34 * jdk.vm.ci/jdk.vm.ci.code
35 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
36 * @build compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
37 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
38 * compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
39 */
40
41 package compiler.jvmci.compilerToVM;
42
43 import compiler.jvmci.common.CTVMUtilities;
44 import compiler.jvmci.common.testcases.MultipleImplementer1;
45 import compiler.jvmci.common.testcases.SingleImplementer;
46 import compiler.jvmci.common.testcases.SingleImplementerInterface;
47 import compiler.jvmci.common.testcases.SingleSubclass;
48 import jdk.test.lib.Asserts;
49 import jdk.test.lib.Utils;
50 import jdk.vm.ci.hotspot.CompilerToVMHelper;
51 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
52 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
53
54 import java.lang.reflect.Method;
55 import java.util.HashSet;
56 import java.util.Set;
57
58 public class FindUniqueConcreteMethodTest {
59 public static void main(String args[]) {
60 FindUniqueConcreteMethodTest test = new FindUniqueConcreteMethodTest();
61 try {
62 for (TestCase tcase : createTestCases()) {
63 test.runTest(tcase);
64 }
65 } catch (NoSuchMethodException e) {
66 throw new Error("TEST BUG: can't find method", e);
67 }
68 }
69
70 private static Set<TestCase> createTestCases() {
71 Set<TestCase> result = new HashSet<>();
72 // a public method
73 result.add(new TestCase(true, SingleSubclass.class,
74 SingleSubclass.class, "usualMethod"));
75 // overriden method
76 result.add(new TestCase(true, SingleSubclass.class,
77 SingleSubclass.class, "overridenMethod"));
|