1 /*
   2  * Copyright (c) 2015, 2016. All rights reserved.
   3  * Copyright (c) 2018 Red Hat, Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 #include <jni.h>
  26 
  27 #ifdef __cplusplus
  28 extern "C" {
  29 #endif
  30 
  31 JNIEXPORT jfloat JNICALL Java_TestFloatJNIArgs_add15floats
  32   (JNIEnv *env, jclass cls,
  33    jfloat  f1, jfloat  f2, jfloat  f3, jfloat  f4,
  34    jfloat  f5, jfloat  f6, jfloat  f7, jfloat  f8,
  35    jfloat  f9, jfloat f10, jfloat f11, jfloat f12,
  36    jfloat f13, jfloat f14, jfloat f15) {
  37   return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15;
  38 }
  39 
  40 JNIEXPORT jfloat JNICALL Java_TestFloatJNIArgs_add10floats
  41   (JNIEnv *env, jclass cls,
  42    jfloat  f1, jfloat  f2, jfloat  f3, jfloat  f4,
  43    jfloat  f5, jfloat  f6, jfloat  f7, jfloat  f8,
  44    jfloat  f9, jfloat f10) {
  45   return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10;
  46 }
  47 
  48 JNIEXPORT jfloat JNICALL Java_TestFloatJNIArgs_addFloatsInts
  49   (JNIEnv *env, jclass cls,
  50    jfloat  f1, jfloat  f2, jfloat  f3, jfloat  f4,
  51    jfloat  f5, jfloat  f6, jfloat  f7, jfloat  f8,
  52    jfloat  f9, jfloat f10, jfloat f11, jfloat f12,
  53    jfloat f13, jfloat f14, jfloat f15, jint a16, jint a17) {
  54   return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15 + a16 + a17;
  55 }
  56 
  57 JNIEXPORT jdouble JNICALL Java_TestFloatJNIArgs_add15doubles
  58   (JNIEnv *env, jclass cls,
  59    jdouble  f1, jdouble  f2, jdouble  f3, jdouble  f4,
  60    jdouble  f5, jdouble  f6, jdouble  f7, jdouble  f8,
  61    jdouble  f9, jdouble f10, jdouble f11, jdouble f12,
  62    jdouble f13, jdouble f14, jdouble f15) {
  63   return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15;
  64 }
  65 
  66 
  67 #ifdef __cplusplus
  68 }
  69 #endif