JDK-8019808.js revision 406:961cffae0828
1193323Sed/*
2193323Sed * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3193323Sed * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4193323Sed *
5193323Sed * This code is free software; you can redistribute it and/or modify it
6193323Sed * under the terms of the GNU General Public License version 2 only, as
7193323Sed * published by the Free Software Foundation.
8193323Sed *
9193323Sed * This code is distributed in the hope that it will be useful, but WITHOUT
10193323Sed * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11193323Sed * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12193323Sed * version 2 for more details (a copy is included in the LICENSE file that
13193323Sed * accompanied this code).
14243830Sdim *
15243830Sdim * You should have received a copy of the GNU General Public License version
16193323Sed * 2 along with this work; if not, write to the Free Software Foundation,
17239462Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18249423Sdim *
19193323Sed * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20239462Sdim * or visit www.oracle.com if you need additional information or have any
21249423Sdim * questions.
22249423Sdim */
23243830Sdim
24239462Sdim/**
25239462Sdim * JDK-8019808: Switch on empty array breaks codegen
26193323Sed *
27239462Sdim * @test
28239462Sdim * @run
29239462Sdim */
30193323Sed
31193323SedFunction("switch([]) { case 7: }");
32239462Sdim
33239462Sdimfunction f() {
34243830Sdim    switch([]) {
35243830Sdim    case 7:
36243830Sdim    }
37243830Sdim}
38243830Sdim
39243830Sdimf();
40243830Sdim