hotspot/test/compiler/6695810/Test.java
changeset 589 a44a1e70a3e4
child 961 7fb3b13d4205
child 993 ef1ed5e7d732
equal deleted inserted replaced
588:96be33305a55 589:a44a1e70a3e4
       
     1 /*
       
     2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
       
     3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
       
     4  *
       
     5  *
       
     6  *
       
     7  *
       
     8  *
       
     9  *
       
    10  *
       
    11  *
       
    12  *
       
    13  *
       
    14  *
       
    15  *
       
    16  *
       
    17  *
       
    18  *
       
    19  *
       
    20  *
       
    21  *
       
    22  *
       
    23  */
       
    24 
       
    25 /*
       
    26  * @test
       
    27  * @bug 6695810
       
    28  * @summary null oop passed to encode_heap_oop_not_null
       
    29  * @run main/othervm -Xbatch Test
       
    30  */
       
    31 
       
    32 public class Test {
       
    33     Test _t;
       
    34 
       
    35     static void test(Test t1, Test t2) {
       
    36         if (t2 != null)
       
    37             t1._t = t2;
       
    38 
       
    39         if (t2 != null)
       
    40             t1._t = t2;
       
    41     }
       
    42 
       
    43     public static void main(String[] args) {
       
    44         Test t = new Test();
       
    45         for (int i = 0; i < 50; i++) {
       
    46             for (int j = 0; j < 100; j++) {
       
    47                 test(t, t);
       
    48             }
       
    49             test(t, null);
       
    50         }
       
    51         for (int i = 0; i < 10000; i++) {
       
    52             test(t, t);
       
    53         }
       
    54         test(t, null);
       
    55     }
       
    56 }