diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/testsuite/libjava.jni/invocation | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'libjava/testsuite/libjava.jni/invocation')
-rw-r--r-- | libjava/testsuite/libjava.jni/invocation/PR16923.c | 43 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/invocation/PR16923.jar | bin | 0 -> 673 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.jni/invocation/PR16923.java | 7 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/invocation/PR16923.out | 1 |
4 files changed, 51 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jni/invocation/PR16923.c b/libjava/testsuite/libjava.jni/invocation/PR16923.c new file mode 100644 index 000000000..881738b61 --- /dev/null +++ b/libjava/testsuite/libjava.jni/invocation/PR16923.c @@ -0,0 +1,43 @@ +#include <assert.h> +#include <jni.h> + +union env_union +{ + void *void_env; + JNIEnv *jni_env; +}; + +int +main (int argc, const char** argv) +{ + union env_union tmp; + JNIEnv* env; + JavaVM* jvm; + JavaVMInitArgs vm_args; + JavaVMOption options[1]; + jclass class_id; + jmethodID method_id; + jint result; + + options[0].optionString = "-DPR16923=optionReceived"; + + vm_args.version = JNI_VERSION_1_2; + vm_args.ignoreUnrecognized = JNI_TRUE; + vm_args.options = options; + vm_args.nOptions = 1; + + result = JNI_CreateJavaVM (&jvm, &tmp.void_env, &vm_args); + assert (result >= 0); + + env = tmp.jni_env; + + class_id = (*env)->FindClass (env, "PR16923"); + assert (class_id); + + method_id = (*env)->GetStaticMethodID (env, class_id, "printIt", "()V"); + assert (method_id); + + (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL); + + return 0; +} diff --git a/libjava/testsuite/libjava.jni/invocation/PR16923.jar b/libjava/testsuite/libjava.jni/invocation/PR16923.jar Binary files differnew file mode 100644 index 000000000..a1a7b8804 --- /dev/null +++ b/libjava/testsuite/libjava.jni/invocation/PR16923.jar diff --git a/libjava/testsuite/libjava.jni/invocation/PR16923.java b/libjava/testsuite/libjava.jni/invocation/PR16923.java new file mode 100644 index 000000000..efda4bd75 --- /dev/null +++ b/libjava/testsuite/libjava.jni/invocation/PR16923.java @@ -0,0 +1,7 @@ +public class PR16923 +{ + public static void printIt () + { + System.out.println (System.getProperty ("PR16923")); + } +} diff --git a/libjava/testsuite/libjava.jni/invocation/PR16923.out b/libjava/testsuite/libjava.jni/invocation/PR16923.out new file mode 100644 index 000000000..58bf3fe19 --- /dev/null +++ b/libjava/testsuite/libjava.jni/invocation/PR16923.out @@ -0,0 +1 @@ +optionReceived |