test/script/basic/arity.js

Mon, 01 Jul 2013 19:52:07 +0530

author
sundar
date
Mon, 01 Jul 2013 19:52:07 +0530
changeset 390
ab3ea5b3e507
parent 7
5a1b0714df0e
child 952
6d5471a497fb
child 962
ac62e33a99b0
permissions
-rw-r--r--

8019488: switch on literals result in NoSuchMethodError or VerifyError
Reviewed-by: hannesw

     1 /*
     2  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * 
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     8  * 
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12  * version 2 for more details (a copy is included in the LICENSE file that
    13  * accompanied this code).
    14  * 
    15  * You should have received a copy of the GNU General Public License version
    16  * 2 along with this work; if not, write to the Free Software Foundation,
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18  * 
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    22  */
    24 /**
    25  * arity test.
    26  *
    27  * @test
    28  * @run 
    29  */
    31 function func1(a) { print(a); }
    32 function func2(a, b) { print(a, b); }
    33 function func3(a, b, c) { print(a, b, c); }
    34 function func4(a, b, c, d) { print(a, b, c, d); }
    35 function func5(a, b, c, d, e) { print(a, b, c, d, e); }
    36 function func6(a, b, c, d, e, f) { print(a, b, c, d, e, f); }
    37 function func7(a, b, c, d, e, f, g) { print(a, b, c, d, e, f, g); }
    38 function func8(a, b, c, d, e, f, g, h) { print(a, b, c, d, e, f, g, h); }
    39 function func9(a, b, c, d, e, f, g, h, i) { print(a, b, c, d, e, f, g, h, i); }
    40 function func10(a, b, c, d, e, f, g, h, i, j) { print(a, b, c, d, e, f, g, h, i, j); }
    41 function func11(a, b, c, d, e, f, g, h, i, j, k) { print(a, b, c, d, e, f, g, h, i, j, k); }
    42 function func12(a, b, c, d, e, f, g, h, i, j, k, l) { print(a, b, c, d, e, f, g, h, i, j, k, l); }
    43 function func13(a, b, c, d, e, f, g, h, i, j, k, l, m) { print(a, b, c, d, e, f, g, h, i, j, k, l, m); }
    45 function vfunc1(a) { print(a); arguments; }
    46 function vfunc2(a, b) { print(a, b); arguments; }
    47 function vfunc3(a, b, c) { print(a, b, c); arguments; }
    48 function vfunc4(a, b, c, d) { print(a, b, c, d); arguments; }
    49 function vfunc5(a, b, c, d, e) { print(a, b, c, d, e); arguments; }
    50 function vfunc6(a, b, c, d, e, f) { print(a, b, c, d, e, f); arguments; }
    51 function vfunc7(a, b, c, d, e, f, g) { print(a, b, c, d, e, f, g); arguments; }
    52 function vfunc8(a, b, c, d, e, f, g, h) { print(a, b, c, d, e, f, g, h); arguments; }
    53 function vfunc9(a, b, c, d, e, f, g, h, i) { print(a, b, c, d, e, f, g, h, i); arguments; }
    54 function vfunc10(a, b, c, d, e, f, g, h, i, j) { print(a, b, c, d, e, f, g, h, i, j); arguments; }
    55 function vfunc11(a, b, c, d, e, f, g, h, i, j, k) { print(a, b, c, d, e, f, g, h, i, j, k); arguments; }
    56 function vfunc12(a, b, c, d, e, f, g, h, i, j, k, l) { print(a, b, c, d, e, f, g, h, i, j, k, l); arguments; }
    57 function vfunc13(a, b, c, d, e, f, g, h, i, j, k, l, m) { print(a, b, c, d, e, f, g, h, i, j, k, l, m); arguments; }
    59 func1(1);
    60 func2(1, 2);
    61 func3(1, 2, 3);
    62 func4(1, 2, 3, 4);
    63 func5(1, 2, 3, 4, 5);
    64 func6(1, 2, 3, 4, 5, 6);
    65 func7(1, 2, 3, 4, 5, 6, 7);
    66 func8(1, 2, 3, 4, 5, 6, 7, 8);
    67 func9(1, 2, 3, 4, 5, 6, 7, 8, 9);
    68 func10(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
    69 func11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
    70 func12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
    71 func13(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    73 func1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    74 func13(1);
    76 vfunc1(1);
    77 vfunc2(1, 2);
    78 vfunc3(1, 2, 3);
    79 vfunc4(1, 2, 3, 4);
    80 vfunc5(1, 2, 3, 4, 5);
    81 vfunc6(1, 2, 3, 4, 5, 6);
    82 vfunc7(1, 2, 3, 4, 5, 6, 7);
    83 vfunc8(1, 2, 3, 4, 5, 6, 7, 8);
    84 vfunc9(1, 2, 3, 4, 5, 6, 7, 8, 9);
    85 vfunc10(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
    86 vfunc11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
    87 vfunc12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
    88 vfunc13(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    90 vfunc1(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    91 vfunc13(1);

mercurial