Mon, 02 Sep 2013 22:38:36 +0100
8016177: structural most specific and stuckness
Reviewed-by: jjg, vromero
Contributed-by: maurizio.cimadamore@oracle.com
mcimadamore@120 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
mcimadamore@120 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@120 | 4 | * |
mcimadamore@120 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@120 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@120 | 7 | * published by the Free Software Foundation. |
mcimadamore@120 | 8 | * |
mcimadamore@120 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@120 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@120 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@120 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@120 | 13 | * accompanied this code). |
mcimadamore@120 | 14 | * |
mcimadamore@120 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@120 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@120 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@120 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
mcimadamore@120 | 22 | */ |
mcimadamore@120 | 23 | |
mcimadamore@120 | 24 | /* |
mcimadamore@120 | 25 | * @test |
mcimadamore@120 | 26 | * @bug 6500343 |
mcimadamore@120 | 27 | * @summary compiler generates bad code when translating conditional expressions |
mcimadamore@120 | 28 | * @author Maurizio Cimadamore |
mcimadamore@120 | 29 | * |
mcimadamore@120 | 30 | */ |
mcimadamore@120 | 31 | |
mcimadamore@120 | 32 | public class T6500343b { |
mcimadamore@120 | 33 | |
mcimadamore@120 | 34 | final static int i1 = 0; |
mcimadamore@120 | 35 | final static int i2 = 1; |
mcimadamore@120 | 36 | |
mcimadamore@120 | 37 | static void crash(int i) { |
mcimadamore@120 | 38 | switch (i) { |
mcimadamore@120 | 39 | case (true ? 0 : 1): |
mcimadamore@120 | 40 | case (i1 == 5 ? 1 : 2): |
mcimadamore@120 | 41 | case (i1 == i2 ? 2 : 3): |
mcimadamore@120 | 42 | } |
mcimadamore@120 | 43 | } |
mcimadamore@120 | 44 | |
mcimadamore@120 | 45 | public static void main(String[] args) { |
mcimadamore@120 | 46 | T6500343b.crash(0); |
mcimadamore@120 | 47 | } |
mcimadamore@120 | 48 | } |