OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jni/] [invocation/] [PR16923.c] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
#include <assert.h>
2
#include <jni.h>
3
 
4
union env_union
5
{
6
  void *void_env;
7
  JNIEnv *jni_env;
8
};
9
 
10
int
11
main (int argc, const char** argv)
12
{
13
  union env_union tmp;
14
  JNIEnv* env;
15
  JavaVM* jvm;
16
  JavaVMInitArgs vm_args;
17
  JavaVMOption options[1];
18
  jclass class_id;
19
  jmethodID method_id;
20
  jint result;
21
 
22
  options[0].optionString = "-DPR16923=optionReceived";
23
 
24
  vm_args.version = JNI_VERSION_1_2;
25
  vm_args.ignoreUnrecognized = JNI_TRUE;
26
  vm_args.options = options;
27
  vm_args.nOptions = 1;
28
 
29
  result = JNI_CreateJavaVM (&jvm, &tmp.void_env, &vm_args);
30
  assert (result >= 0);
31
 
32
  env = tmp.jni_env;
33
 
34
  class_id = (*env)->FindClass (env, "PR16923");
35
  assert (class_id);
36
 
37
  method_id = (*env)->GetStaticMethodID (env, class_id, "printIt", "()V");
38
  assert (method_id);
39
 
40
  (*env)->CallStaticVoidMethod (env, class_id, method_id, NULL);
41
 
42
  return 0;
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.