Path: blob/master/test/hotspot/jtreg/compiler/c1/TestManyMethodParameters.java
64474 views
/*1* Copyright (c) 2022 SAP SE. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324/**25* @test26* @bug 828878127* @summary Test if a call with 8 integer + 13 float = 21 parameters can can be compiled.28* On ppc all parameters can be passed in registers.29* @author Richard Reingruber30*31* @run main/othervm -Xbatch -XX:CompileCommand=dontinline,*::*dontinline* compiler.c1.TestManyMethodParameters32*/3334package compiler.c1;3536public class TestManyMethodParameters {37public static void main(String[] args) {38for (int i = 30_000; i >= 0; i--) {39double sum = testMethod_01_dontinline();40if (sum != 127) {41throw new Error("Wrong sum: " + sum);42}43}44}4546public static double testMethod_01_dontinline() {47return testMethod_01_manyArgs(1, 2, 3, 4, 5, 6, 7, 8,481.0d, 2.0d, 3.0d, 4.0d, 5.0d, 6.0d, 7.0d, 8.0d, 9.0d, 10.0d, 11.0d, 12.0d, 13.0d);49}5051public static double testMethod_01_manyArgs(long l1, long l2, long l3, long l4, long l5, long l6, long l7, long l8,52double d1, double d2, double d3, double d4, double d5, double d6, double d7,53double d8, double d9, double d10, double d11, double d12, double d13) {54return l1+l2+l3+l4+l5+l6+l7+l8+d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13;55}56}575859