< prev index next >
test/compiler/c2/Test6857159.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
@@ -27,49 +27,68 @@
* @bug 6857159
* @summary local schedule failed with checkcast of Thread.currentThread()
* @library /testlibrary
* @modules java.base/jdk.internal.misc
* java.management
+ *
+ * @run driver compiler.c2.Test6857159
*/
-import jdk.test.lib.*;
+package compiler.c2;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
public class Test6857159 {
public static void main(String[] args) throws Throwable {
+ String className = Test.class.getName();
OutputAnalyzer analyzer = ProcessTools.executeTestJvm("-Xbatch",
- "-XX:+PrintCompilation", "-XX:CompileOnly=Test$ct.run", "Test");
+ "-XX:+PrintCompilation",
+ "-XX:CompileOnly="+ className + "$ct::run",
+ className);
analyzer.shouldNotContain("COMPILE SKIPPED");
- analyzer.shouldContain("Test$ct0::run (16 bytes)");
+ analyzer.shouldContain(className + "$ct0::run (16 bytes)");
analyzer.shouldHaveExitValue(0);
}
-}
-class Test extends Thread {
+ static class Test extends Thread {
static class ct0 extends Test {
- public void message() { }
+ public void message() {
+ }
public void run() {
message();
ct0 ct = (ct0) Thread.currentThread();
ct.message();
}
}
+
static class ct1 extends ct0 {
- public void message() { }
+ public void message() {
}
+ }
+
static class ct2 extends ct0 {
- public void message() { }
+ public void message() {
}
+ }
public static void main(String[] args) throws Exception {
for (int i = 0; i < 20000; i++) {
Thread t = null;
switch (i % 3) {
- case 0: t = new ct0(); break;
- case 1: t = new ct1(); break;
- case 2: t = new ct2(); break;
+ case 0:
+ t = new ct0();
+ break;
+ case 1:
+ t = new ct1();
+ break;
+ case 2:
+ t = new ct2();
+ break;
}
t.start();
t.join();
}
}
+ }
}
< prev index next >