hotspot/test/compiler/6857159/Test6857159.java
author trims
Mon, 03 Jan 2011 15:30:05 -0800
changeset 7662 5f31baaff55b
parent 7097 767197e73343
permissions -rw-r--r--
7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass Summary: Update the copyright to be 2010 on all changed files in OpenJDK Reviewed-by: jcoomes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3272
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     1
/*
7662
5f31baaff55b 7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass
trims
parents: 7097
diff changeset
     2
 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3272
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     4
 *
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     8
 *
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    13
 * accompanied this code).
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    14
 *
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3272
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3272
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3272
diff changeset
    21
 * questions.
3272
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    22
 *
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    23
 */
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    24
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    25
/**
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    26
 * @test
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    27
 * @bug 6857159
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    28
 * @summary local schedule failed with checkcast of Thread.currentThread()
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    29
 *
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    30
 * @run shell Test6857159.sh
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    31
 */
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    32
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    33
public class Test6857159 extends Thread {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    34
    static class ct0 extends Test6857159 {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    35
        public void message() {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    36
            // System.out.println("message");
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    37
        }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    38
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    39
        public void run() {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    40
             message();
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    41
             ct0 ct = (ct0) Thread.currentThread();
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    42
             ct.message();
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    43
        }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    44
    }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    45
    static class ct1 extends ct0 {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    46
        public void message() {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    47
            // System.out.println("message");
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    48
        }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    49
    }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    50
    static class ct2 extends ct0 {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    51
        public void message() {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    52
            // System.out.println("message");
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    53
        }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    54
    }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    55
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    56
    public static void main(String[] args) throws Exception {
7097
767197e73343 6997495: correction of regression test compiler/6857159/Test6857159
ptisnovs
parents: 5547
diff changeset
    57
        for (int i = 0; i < 20000; i++) {
3272
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    58
            Thread t = null;
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    59
            switch (i % 3) {
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    60
              case 0: t = new ct0(); break;
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    61
              case 1: t = new ct1(); break;
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    62
              case 2: t = new ct2(); break;
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    63
            }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    64
            t.start();
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    65
            t.join();
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    66
        }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    67
    }
5a1e113bfed5 6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
diff changeset
    68
}