Wed, 21 May 2014 10:56:41 -0700
Added tag jdk8u20-b15 for changeset 8c785f9bde6f
twisti@1332 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
twisti@1332 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
twisti@1332 | 4 | * |
twisti@1332 | 5 | * This code is free software; you can redistribute it and/or modify it |
twisti@1332 | 6 | * under the terms of the GNU General Public License version 2 only, as |
twisti@1332 | 7 | * published by the Free Software Foundation. |
twisti@1332 | 8 | * |
twisti@1332 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
twisti@1332 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
twisti@1332 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
twisti@1332 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
twisti@1332 | 13 | * accompanied this code). |
twisti@1332 | 14 | * |
twisti@1332 | 15 | * You should have received a copy of the GNU General Public License version |
twisti@1332 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
twisti@1332 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
twisti@1332 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
twisti@1332 | 22 | */ |
twisti@1332 | 23 | |
twisti@1332 | 24 | /** |
twisti@1332 | 25 | * @test |
twisti@1332 | 26 | * @bug 6863155 |
twisti@1332 | 27 | * @summary Server compiler generates incorrect code (x86, long, bitshift, bitmask) |
twisti@1332 | 28 | * |
twisti@1332 | 29 | * @run main/othervm -Xcomp -XX:CompileOnly=Test6863155.test Test6863155 |
twisti@1332 | 30 | */ |
twisti@1332 | 31 | |
twisti@1332 | 32 | public class Test6863155 { |
twisti@1332 | 33 | private static long test(byte b) { |
twisti@1332 | 34 | return b << 24 & 0xff000000L; |
twisti@1332 | 35 | } |
twisti@1332 | 36 | |
twisti@1332 | 37 | public static void main(String... args) { |
twisti@1332 | 38 | long result = test((byte) 0xc2); |
twisti@1332 | 39 | long expected = 0x00000000c2000000L; |
twisti@1332 | 40 | if (result != expected) |
twisti@1332 | 41 | throw new InternalError(Long.toHexString(result) + " != " + Long.toHexString(expected)); |
twisti@1332 | 42 | } |
twisti@1332 | 43 | } |