From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/testsuite/libjava.jni/calls.c | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 libjava/testsuite/libjava.jni/calls.c (limited to 'libjava/testsuite/libjava.jni/calls.c') diff --git a/libjava/testsuite/libjava.jni/calls.c b/libjava/testsuite/libjava.jni/calls.c new file mode 100644 index 000000000..709e55d13 --- /dev/null +++ b/libjava/testsuite/libjava.jni/calls.c @@ -0,0 +1,75 @@ +#include +#include + +JNIEXPORT jint JNICALL +Java_calls_docall (JNIEnv *env, jobject _this) +{ + jmethodID method; + jclass klass, super; + + jbyte b; + jshort s; + jchar c; + jint i; + jlong l; + jfloat f; + jdouble d; + + jvalue val; + + jint fails = 0; + + klass = (*env)->GetObjectClass (env, _this); + super = (*env)->GetSuperclass (env, klass); + + method = (*env)->GetMethodID (env, klass, "byte_f", "()B"); + b = (*env)->CallByteMethod (env, _this, method); + if (b != 23) + ++fails; + + method = (*env)->GetMethodID (env, klass, "char_f", "(I)C"); + val.i = 10; + c = (*env)->CallCharMethodA (env, _this, method, &val); + if (c != ('a' + 10)) + ++fails; + + method = (*env)->GetMethodID (env, super, "int_f", "()I"); + i = (*env)->CallNonvirtualIntMethod (env, _this, super, method); + if (i != 27) + ++fails; + + i = (*env)->CallIntMethod (env, _this, method); + if (i != 1023) + ++fails; + + method = (*env)->GetStaticMethodID (env, klass, "long_f", "(J)J"); + l = (*env)->CallStaticLongMethod (env, klass, method, (jlong) 10); + if (l != 2033) + ++fails; + + method = (*env)->GetStaticMethodID (env, klass, "longpb_f", "(BJBJBJ)J"); + l = (*env)->CallStaticLongMethod (env, klass, method, (jbyte) 13, (jlong) 3, + (jbyte) 13, (jlong) 3, (jbyte) 13, (jlong) 4); + if (l != 3033) + ++fails; + + method = (*env)->GetMethodID (env, klass, "void_f", "()V"); + (*env)->CallVoidMethod (env, _this, method); + + method = (*env)->GetStaticMethodID (env, klass, "short_f", "()S"); + s = (*env)->CallStaticShortMethod (env, klass, method); + if (s != 2) + ++fails; + + method = (*env)->GetMethodID (env, klass, "double_f", "()D"); + d = (*env)->CallDoubleMethod (env, _this, method); + if (d != -1.0) + ++fails; + + method = (*env)->GetMethodID (env, klass, "float_f", "()F"); + f = (*env)->CallFloatMethod (env, _this, method); + if (f != 1.0) + ++fails; + + return fails; +} -- cgit v1.2.3