never@922: /* trims@1907: * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. never@922: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. never@922: * never@922: * This code is free software; you can redistribute it and/or modify it never@922: * under the terms of the GNU General Public License version 2 only, as never@922: * published by the Free Software Foundation. never@922: * never@922: * This code is distributed in the hope that it will be useful, but WITHOUT never@922: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or never@922: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License never@922: * version 2 for more details (a copy is included in the LICENSE file that never@922: * accompanied this code). never@922: * never@922: * You should have received a copy of the GNU General Public License version never@922: * 2 along with this work; if not, write to the Free Software Foundation, never@922: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. never@922: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. never@922: */ never@922: never@922: /** never@922: * @test never@922: * @bug 6758234 never@922: * @summary if (k cond (a ? : b: c)) returns reversed answer if k is constant and b and c are longs never@922: * @run main/othervm -Xcomp -XX:CompileOnly=Test6758234.main Test6758234 never@922: */ never@922: never@922: public class Test6758234 { never@922: static int x = 0; never@922: static int y = 1; never@922: never@922: public static void main(String[] args) { never@922: if (1 != ((x < y) ? 1L : 0)) { never@922: throw new InternalError(); never@922: } never@922: } never@922: }