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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
#include <stdlib.h>
2
#include <assert.h>
3
#include <PR18116.h>
4
 
5
// The purpose of this test is to ensure that signatures with non-top
6
// level class arguments work.
7
 
8
static jint
9
some_random_name (JNIEnv *env, jclass k, jobject v)
10
{
11
  return 555;
12
}
13
 
14
JNIEXPORT jint JNICALL
15
JNI_OnLoad (JavaVM *vm, void *nothing)
16
{
17
  JNIEnv *env;
18
  JNINativeMethod meth;
19
  jclass k;
20
  jint r;
21
 
22
  r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2);
23
  assert (r == JNI_OK);
24
  k = (*env)->FindClass (env, "PR18116");
25
  assert (k != NULL);
26
 
27
  meth.name = "doit";
28
  meth.signature = "(Ljava/lang/String;)I";
29
  meth.fnPtr = some_random_name;
30
 
31
  r = (*env)->RegisterNatives (env, k, &meth, 1);
32
  assert (r == JNI_OK);
33
 
34
  return JNI_VERSION_1_2;
35
}

powered by: WebSVN 2.1.0

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