< prev index next >

test/jdk/java/lang/invoke/condy/CondyNestedResolutionTest.java

Print this page

27  * @summary Test JVMs 5.4.3.6 with respect to a dynamically-computed constant and circularity.
28  * @modules java.base/jdk.internal.misc
29  * @library /test/lib
30  * @compile CondyNestedResolution.jcod
31  * @run main/othervm CondyNestedResolutionTest
32  */
33 
34 import jdk.test.lib.process.ProcessTools;
35 import jdk.test.lib.process.OutputAnalyzer;
36 import jdk.test.lib.compiler.InMemoryJavaCompiler;
37 
38 /*
39  * JVMs section 5.4.3.6 Dynamically-Computed Constant and Call Site Resolution
40  *     "Let X be the symbolic reference currently being resolved, and let Y be a static argument of X
41  *      to be resolved as described above. If X and Y are both dynamically-computed constants, and if Y
42  *      is either the same as X or has a static argument that references X through its static arguments,
43  *      directly or indirectly, resolution fails with a StackOverflowError.
44  */
45 public class CondyNestedResolutionTest {
46     public static void main(String args[]) throws Throwable {
47         ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("CondyNestedResolution");
48         OutputAnalyzer oa = new OutputAnalyzer(pb.start());
49         oa.shouldContain("StackOverflowError");
50         oa.shouldContain("bsm1arg");
51         oa.shouldContain("hello1");
52         oa.shouldContain("hello2");
53         oa.shouldContain("hello4");
54         oa.shouldContain("hello6");
55         oa.shouldNotContain("hello3");
56         oa.shouldNotContain("hello5");
57         oa.shouldNotContain("bsm2arg");
58         oa.shouldNotContain("bsm3arg");
59         oa.shouldNotContain("bsm4arg");
60         oa.shouldHaveExitValue(1);
61     }
62 }

27  * @summary Test JVMs 5.4.3.6 with respect to a dynamically-computed constant and circularity.
28  * @modules java.base/jdk.internal.misc
29  * @library /test/lib
30  * @compile CondyNestedResolution.jcod
31  * @run main/othervm CondyNestedResolutionTest
32  */
33 
34 import jdk.test.lib.process.ProcessTools;
35 import jdk.test.lib.process.OutputAnalyzer;
36 import jdk.test.lib.compiler.InMemoryJavaCompiler;
37 
38 /*
39  * JVMs section 5.4.3.6 Dynamically-Computed Constant and Call Site Resolution
40  *     "Let X be the symbolic reference currently being resolved, and let Y be a static argument of X
41  *      to be resolved as described above. If X and Y are both dynamically-computed constants, and if Y
42  *      is either the same as X or has a static argument that references X through its static arguments,
43  *      directly or indirectly, resolution fails with a StackOverflowError.
44  */
45 public class CondyNestedResolutionTest {
46     public static void main(String args[]) throws Throwable {
47         ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("CondyNestedResolution");
48         OutputAnalyzer oa = new OutputAnalyzer(pb.start());
49         oa.shouldContain("StackOverflowError");
50         oa.shouldContain("bsm1arg");
51         oa.shouldContain("hello1");
52         oa.shouldContain("hello2");
53         oa.shouldContain("hello4");
54         oa.shouldContain("hello6");
55         oa.shouldNotContain("hello3");
56         oa.shouldNotContain("hello5");
57         oa.shouldNotContain("bsm2arg");
58         oa.shouldNotContain("bsm3arg");
59         oa.shouldNotContain("bsm4arg");
60         oa.shouldHaveExitValue(1);
61     }
62 }
< prev index next >