Test6863155.java revision 897
897N/A/*
897N/A * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
897N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
897N/A *
897N/A * This code is free software; you can redistribute it and/or modify it
897N/A * under the terms of the GNU General Public License version 2 only, as
897N/A * published by the Free Software Foundation.
897N/A *
897N/A * This code is distributed in the hope that it will be useful, but WITHOUT
897N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
897N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
897N/A * version 2 for more details (a copy is included in the LICENSE file that
897N/A * accompanied this code).
897N/A *
897N/A * You should have received a copy of the GNU General Public License version
897N/A * 2 along with this work; if not, write to the Free Software Foundation,
897N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
897N/A *
897N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
897N/A * CA 95054 USA or visit www.sun.com if you need additional information or
897N/A * have any questions.
897N/A */
897N/A
897N/A/**
897N/A * @test
897N/A * @bug 6863155
897N/A * @summary Server compiler generates incorrect code (x86, long, bitshift, bitmask)
897N/A *
897N/A * @run main/othervm -Xcomp -XX:CompileOnly=Test6863155.test Test6863155
897N/A */
897N/A
897N/Apublic class Test6863155 {
897N/A private static long test(byte b) {
897N/A return b << 24 & 0xff000000L;
897N/A }
897N/A
897N/A public static void main(String... args) {
897N/A long result = test((byte) 0xc2);
897N/A long expected = 0x00000000c2000000L;
897N/A if (result != expected)
897N/A throw new InternalError(Long.toHexString(result) + " != " + Long.toHexString(expected));
897N/A }
897N/A}