test/compiler/c2/6857159/Test6857159.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff test/compiler/c2/6857159/Test6857159.java

test/compiler/c2/6857159/Test6857159.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 24,58 **** /** * @test * @bug 6857159 * @summary local schedule failed with checkcast of Thread.currentThread() ! * ! * @run shell Test6857159.sh */ ! public class Test6857159 extends Thread { ! static class ct0 extends Test6857159 { ! public void message() { ! // System.out.println("message"); } public void run() { message(); ct0 ct = (ct0) Thread.currentThread(); ct.message(); } } static class ct1 extends ct0 { ! public void message() { ! // System.out.println("message"); ! } } static class ct2 extends ct0 { ! public void message() { ! // System.out.println("message"); ! } } public static void main(String[] args) throws Exception { for (int i = 0; i < 20000; i++) { Thread t = null; --- 24,62 ---- /** * @test * @bug 6857159 * @summary local schedule failed with checkcast of Thread.currentThread() ! * @library /testlibrary */ ! import com.oracle.java.testlibrary.*; ! ! public class Test6857159 { ! public static void main(String[] args) throws Exception { ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbatch", "-XX:+PrintCompilation", ! "-XX:CompileOnly=Test$ct.run", "Test"); ! OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); ! analyzer.shouldNotContain("COMPILE SKIPPED"); } + } + + class Test extends Thread { + static class ct0 extends Test { + public void message() { } public void run() { message(); ct0 ct = (ct0) Thread.currentThread(); ct.message(); } } static class ct1 extends ct0 { ! public void message() { } } static class ct2 extends ct0 { ! public void message() { } } public static void main(String[] args) throws Exception { for (int i = 0; i < 20000; i++) { Thread t = null;
test/compiler/c2/6857159/Test6857159.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File