1154N/A/*
1154N/A * Copyright 2009 SAP. All Rights Reserved.
1154N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1154N/A *
1154N/A * This code is free software; you can redistribute it and/or modify it
1154N/A * under the terms of the GNU General Public License version 2 only, as
1154N/A * published by the Free Software Foundation.
1154N/A *
1154N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1154N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1154N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1154N/A * version 2 for more details (a copy is included in the LICENSE file that
1154N/A * accompanied this code).
1154N/A *
1154N/A * You should have received a copy of the GNU General Public License version
1154N/A * 2 along with this work; if not, write to the Free Software Foundation,
1154N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1154N/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.
1154N/A */
1154N/A
1154N/A/**
1154N/A * @test
1154N/A * @bug 6910484
1154N/A * @summary incorrect integer optimization (loosing and op-r in a given example)
1154N/A *
1154N/A * @run main/othervm -Xbatch Test
1154N/A */
1154N/A
1154N/Apublic class Test {
1154N/A
1154N/A public static void main(String[] args) {
1154N/A long iteration = 0;
1154N/A for(int i = 0; i <11000; i++) {
1154N/A iteration++;
1154N/A int result = test(255);
1154N/A if (result != 112) {
1154N/A System.out.println("expected 112, but got " + result + " after iteration " + iteration);
1154N/A System.exit(97);
1154N/A }
1154N/A }
1154N/A }
1154N/A
1154N/A private static int test(int x) {
1154N/A return (x & -32) / 2;
1154N/A }
1154N/A
1154N/A}