|
28 | 28 |
|
29 | 29 | import org.junit.Test;
|
30 | 30 |
|
31 |
| -/** |
32 |
| - * This test shall fail because it makes the analysis code itself reachable if the classes are not |
33 |
| - * separated by classloaders. |
34 |
| - * |
35 |
| - * The exception stack is: |
36 |
| - * |
37 |
| - * <pre> |
38 |
| - * Exception:com.oracle.graal.pointsto.util.ParallelExecutionException |
39 |
| - * at com.oracle.graal.pointsto.util.CompletionExecutor.complete(CompletionExecutor.java:261) |
40 |
| - * at com.oracle.graal.pointsto.PointsToAnalysis.doTypeflow(PointsToAnalysis.java:528) |
41 |
| - * at com.oracle.graal.pointsto.PointsToAnalysis.finish(PointsToAnalysis.java:516) |
42 |
| - * at com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:161) |
43 |
| - * at com.oracle.graal.pointsto.standalone.PointsToAnalyzer.run(PointsToAnalyzer.java:278) |
44 |
| - * at com.oracle.graal.pointsto.standalone.test.PointstoAnalyzerTester.runAnalysisAndAssert(PointstoAnalyzerTester.java:159) |
45 |
| - * at com.oracle.graal.pointsto.standalone.test.PointstoAnalyzerTester.runAnalysisAndAssert(PointstoAnalyzerTester.java:145) |
46 |
| - * at com.oracle.graal.pointsto.standalone.test.StandaloneConstantScanDynamicTest.test(StandaloneConstantScanDynamicTest.java:43) |
47 |
| - * at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |
48 |
| - * at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) |
49 |
| - * at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) |
50 |
| - * at java.base/java.lang.reflect.Method.invoke(Method.java:568) |
51 |
| - * at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) |
52 |
| - * at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) |
53 |
| - * at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) |
54 |
| - * at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) |
55 |
| - * at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) |
56 |
| - * at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) |
57 |
| - * at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) |
58 |
| - * at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) |
59 |
| - * at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) |
60 |
| - * at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) |
61 |
| - * at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) |
62 |
| - * at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) |
63 |
| - * at org.junit.runners.ParentRunner.run(ParentRunner.java:363) |
64 |
| - * at org.junit.runners.Suite.runChild(Suite.java:128) |
65 |
| - * at org.junit.runners.Suite.runChild(Suite.java:27) |
66 |
| - * at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) |
67 |
| - * at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) |
68 |
| - * at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) |
69 |
| - * at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) |
70 |
| - * at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) |
71 |
| - * at org.junit.runners.ParentRunner.run(ParentRunner.java:363) |
72 |
| - * at org.junit.runner.JUnitCore.run(JUnitCore.java:137) |
73 |
| - * at org.junit.runner.JUnitCore.run(JUnitCore.java:115) |
74 |
| - * at com.oracle.mxtool.junit.MxJUnitWrapper.runRequest(MxJUnitWrapper.java:375) |
75 |
| - * at com.oracle.mxtool.junit.MxJUnitWrapper.main(MxJUnitWrapper.java:230) |
76 |
| - * cause 0jdk.graal.compiler.debug.GraalError: jdk.graal.compiler.debug.GraalError: jdk.graal.compiler.debug.GraalError: |
77 |
| - * should not reach here: Double wrapping of constant. Most likely, the reachability analysis code itself is seen as reachable. java.lang.Object[] |
78 |
| - * at com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49) |
79 |
| - * at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:269) |
80 |
| - * at com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63) |
81 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapObjectArray.readElementValue(ImageHeapObjectArray.java:84) |
82 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:463) |
83 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$5(ImageHeapScanner.java:451) |
84 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$14(ImageHeapScanner.java:690) |
85 |
| - * at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:187) |
86 |
| - * at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:171) |
87 |
| - * at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395) |
88 |
| - * at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) |
89 |
| - * at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) |
90 |
| - * at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) |
91 |
| - * at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) |
92 |
| - * at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) |
93 |
| - * Caused by: jdk.graal.compiler.debug.GraalError: jdk.graal.compiler.debug.GraalError: should not reach here: Double wrapping of constant. Most likely, the reachability analysis code itself is seen as reachable. java.lang.Object[] |
94 |
| - * at com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49) |
95 |
| - * at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:269) |
96 |
| - * at com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63) |
97 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.getOrCreateImageHeapConstant(ImageHeapScanner.java:212) |
98 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.createImageHeapConstant(ImageHeapScanner.java:186) |
99 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$createImageHeapObjectArray$3(ImageHeapScanner.java:270) |
100 |
| - * at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) |
101 |
| - * ... 13 more |
102 |
| - * Caused by: jdk.graal.compiler.debug.GraalError: should not reach here: Double wrapping of constant. Most likely, the reachability analysis code itself is seen as reachable. java.lang.Object[] |
103 |
| - * at jdk.graal.compiler/jdk.graal.compiler.debug.GraalError.shouldNotReachHere(GraalError.java:57) |
104 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.maybeReplace(ImageHeapScanner.java:307) |
105 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.createImageHeapObject(ImageHeapScanner.java:225) |
106 |
| - * at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$getOrCreateImageHeapConstant$2(ImageHeapScanner.java:205) |
107 |
| - * at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) |
108 |
| - * ... 18 more |
109 |
| - * </pre> |
110 |
| - */ |
111 | 31 | public class StandaloneConstantScanDynamicTest {
|
112 | 32 |
|
113 | 33 | @Test
|
114 | 34 | public void test() throws NoSuchMethodException {
|
115 | 35 | PointstoAnalyzerTester tester = new PointstoAnalyzerTester(StandaloneConstantScanDynamicCase.class);
|
116 | 36 | tester.setAnalysisArguments(tester.getTestClassName(),
|
117 | 37 | "-H:AnalysisTargetAppCP=" + tester.getTestClassJar());
|
118 |
| - tester.setExpectedReachableMethods(tester.getTestClass().getDeclaredMethod("run"), |
119 |
| - tester.getTestClass().getDeclaredMethod("doSomething")); |
| 38 | + tester.setExpectedReachableMethods(tester.getTestClass().getDeclaredMethod("run")); |
120 | 39 | tester.runAnalysisAndAssert();
|
121 | 40 | }
|
122 | 41 | }
|
0 commit comments