mcimadamore@120: /* mcimadamore@120: * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@120: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@120: * mcimadamore@120: * This code is free software; you can redistribute it and/or modify it mcimadamore@120: * under the terms of the GNU General Public License version 2 only, as mcimadamore@120: * published by the Free Software Foundation. mcimadamore@120: * mcimadamore@120: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@120: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@120: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@120: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@120: * accompanied this code). mcimadamore@120: * mcimadamore@120: * You should have received a copy of the GNU General Public License version mcimadamore@120: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@120: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@120: * mcimadamore@120: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@120: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@120: * have any questions. mcimadamore@120: */ mcimadamore@120: mcimadamore@120: /* mcimadamore@120: * @test mcimadamore@120: * @bug 6500343 mcimadamore@120: * @summary compiler generates bad code when translating conditional expressions mcimadamore@120: * @author Maurizio Cimadamore mcimadamore@120: * mcimadamore@120: */ mcimadamore@120: mcimadamore@120: public class T6500343b { mcimadamore@120: mcimadamore@120: final static int i1 = 0; mcimadamore@120: final static int i2 = 1; mcimadamore@120: mcimadamore@120: static void crash(int i) { mcimadamore@120: switch (i) { mcimadamore@120: case (true ? 0 : 1): mcimadamore@120: case (i1 == 5 ? 1 : 2): mcimadamore@120: case (i1 == i2 ? 2 : 3): mcimadamore@120: } mcimadamore@120: } mcimadamore@120: mcimadamore@120: public static void main(String[] args) { mcimadamore@120: T6500343b.crash(0); mcimadamore@120: } mcimadamore@120: }