mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-21 15:30:02 +08:00
field.out: New file.
* libjava.jni/field.out: New file. * libjava.jni/field.c: New file. * libjava.jni/field.java: New file. From-SVN: r40776
This commit is contained in:
parent
e4c34f6a43
commit
ae8a67c4c0
@ -1,3 +1,9 @@
|
||||
2001-03-22 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* libjava.jni/field.out: New file.
|
||||
* libjava.jni/field.c: New file.
|
||||
* libjava.jni/field.java: New file.
|
||||
|
||||
2001-03-20 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* libjava.compile/uesc.java: New file.
|
||||
|
24
libjava/testsuite/libjava.jni/field.c
Normal file
24
libjava/testsuite/libjava.jni/field.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <jni.h>
|
||||
#include <field.h>
|
||||
|
||||
jobjectArray
|
||||
Java_field_fetch (JNIEnv *env, jobject this)
|
||||
{
|
||||
jclass cls;
|
||||
jfieldID fid;
|
||||
jobjectArray obj;
|
||||
|
||||
cls = (*env)->GetObjectClass (env, this);
|
||||
if (! cls)
|
||||
return 0;
|
||||
|
||||
fid = (*env)->GetFieldID (env, cls, "F", "[Ljava/lang/Object;");
|
||||
if (! fid)
|
||||
return 0;
|
||||
|
||||
obj = (*env)->GetObjectField (env, this, fid);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
25
libjava/testsuite/libjava.jni/field.java
Normal file
25
libjava/testsuite/libjava.jni/field.java
Normal file
@ -0,0 +1,25 @@
|
||||
// Test for array field lookup.
|
||||
|
||||
public class field
|
||||
{
|
||||
// A field for us to look up.
|
||||
public Object[] F = new Object[7];
|
||||
|
||||
public native Object[] fetch ();
|
||||
|
||||
public void doit ()
|
||||
{
|
||||
System.out.println (F == fetch ());
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
field q = new field ();
|
||||
q.doit ();
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
System.loadLibrary ("field");
|
||||
}
|
||||
}
|
1
libjava/testsuite/libjava.jni/field.out
Normal file
1
libjava/testsuite/libjava.jni/field.out
Normal file
@ -0,0 +1 @@
|
||||
true
|
Loading…
Reference in New Issue
Block a user