163N/A/*
1472N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
253N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
163N/A *
253N/A * This code is free software; you can redistribute it and/or modify it
253N/A * under the terms of the GNU General Public License version 2 only, as
253N/A * published by the Free Software Foundation.
163N/A *
253N/A * This code is distributed in the hope that it will be useful, but WITHOUT
253N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
253N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
253N/A * version 2 for more details (a copy is included in the LICENSE file that
253N/A * accompanied this code).
163N/A *
253N/A * You should have received a copy of the GNU General Public License version
253N/A * 2 along with this work; if not, write to the Free Software Foundation,
253N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
163N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
163N/A */
163N/A
163N/A/*
163N/A * @test
163N/A * @bug 6695810
163N/A * @summary null oop passed to encode_heap_oop_not_null
163N/A * @run main/othervm -Xbatch Test
163N/A */
163N/A
163N/Apublic class Test {
163N/A Test _t;
163N/A
163N/A static void test(Test t1, Test t2) {
163N/A if (t2 != null)
163N/A t1._t = t2;
163N/A
163N/A if (t2 != null)
163N/A t1._t = t2;
163N/A }
163N/A
163N/A public static void main(String[] args) {
163N/A Test t = new Test();
163N/A for (int i = 0; i < 50; i++) {
163N/A for (int j = 0; j < 100; j++) {
163N/A test(t, t);
163N/A }
163N/A test(t, null);
163N/A }
163N/A for (int i = 0; i < 10000; i++) {
163N/A test(t, t);
163N/A }
163N/A test(t, null);
163N/A }
163N/A}