1060N/A/*
1472N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1060N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1060N/A *
1060N/A * This code is free software; you can redistribute it and/or modify it
1060N/A * under the terms of the GNU General Public License version 2 only, as
1060N/A * published by the Free Software Foundation.
1060N/A *
1060N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1060N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1060N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1060N/A * version 2 for more details (a copy is included in the LICENSE file that
1060N/A * accompanied this code).
1060N/A *
1060N/A * You should have received a copy of the GNU General Public License version
1060N/A * 2 along with this work; if not, write to the Free Software Foundation,
1060N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1060N/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.
1060N/A *
1060N/A */
1060N/A
1060N/A/**
1060N/A * @test
1060N/A * @bug 6769124
1060N/A * @summary int value might not be correctly decoded on deopt with c1 on 64 bit
1060N/A *
1060N/A * @run main/othervm -Xcomp -XX:CompileOnly=TestDeoptInt6769124.m TestDeoptInt6769124
1060N/A */
1060N/A
1060N/Apublic class TestDeoptInt6769124 {
1060N/A
1060N/A static class A {
1060N/A volatile int vl;
1060N/A A(int v) {
1060N/A vl = v;
1060N/A }
1060N/A }
1060N/A
1060N/A static void m(int b) {
1060N/A A a = new A(10);
1060N/A int c;
1060N/A c = b + a.vl; //accessing volatile field of class not loaded at compile time forces a deopt
1060N/A if(c != 20) {
1060N/A System.out.println("a (= " + a.vl + ") + b (= " + b + ") = c (= " + c + ") != 20");
1060N/A throw new InternalError();
1060N/A }
1060N/A }
1060N/A
1060N/A public static void main(String[] args) {
1060N/A m(10);
1060N/A }
1060N/A
1060N/A}