diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-07 22:02:40 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-07 22:02:40 +0000 |
commit | 8f92f0732e74ef17dfb722cf457682843afe61d7 (patch) | |
tree | 04a2d96ba724f8fad6f0f80d8ed7f01534b6c126 /libjava/testsuite/libjava.jni | |
parent | 808f5ffcad6bece52aa7d44f5ddb29259266dd2a (diff) | |
download | ppe42-gcc-8f92f0732e74ef17dfb722cf457682843afe61d7.tar.gz ppe42-gcc-8f92f0732e74ef17dfb722cf457682843afe61d7.zip |
* testsuite/libjava.jni/init.c: New file.
* testsuite/libjava.jni/init.java: New file.
* testsuite/libjava.jni/init.out: New file.
* testsuite/libjava.jni/init.jar: New file.
* testsuite/libjava.jni/init.h: New file.
* testsuite/libjava.jni/init$NativeClass.h: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121698 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/libjava.jni')
-rw-r--r-- | libjava/testsuite/libjava.jni/init$NativeClass.h | 19 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/init.c | 8 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/init.h | 18 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/init.jar | bin | 0 -> 1294 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.jni/init.java | 26 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jni/init.out | 3 |
6 files changed, 74 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jni/init$NativeClass.h b/libjava/testsuite/libjava.jni/init$NativeClass.h new file mode 100644 index 00000000000..0ae6d4cc477 --- /dev/null +++ b/libjava/testsuite/libjava.jni/init$NativeClass.h @@ -0,0 +1,19 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#include <jni.h> + +#ifndef __init_00024NativeClass__ +#define __init_00024NativeClass__ + +#ifdef __cplusplus +extern "C" +{ +#endif + +JNIEXPORT void JNICALL Java_init_00024NativeClass_printHello (JNIEnv *env, jclass); + +#ifdef __cplusplus +} +#endif + +#endif /* __init_00024NativeClass__ */ diff --git a/libjava/testsuite/libjava.jni/init.c b/libjava/testsuite/libjava.jni/init.c new file mode 100644 index 00000000000..458d6d78940 --- /dev/null +++ b/libjava/testsuite/libjava.jni/init.c @@ -0,0 +1,8 @@ +#include <jni.h> +#include <init$NativeClass.h> + +JNIEXPORT void JNICALL +Java_init_00024NativeClass_printHello(JNIEnv *env, jclass cl) +{ + printf("hello\n"); +} diff --git a/libjava/testsuite/libjava.jni/init.h b/libjava/testsuite/libjava.jni/init.h new file mode 100644 index 00000000000..4ad329871e1 --- /dev/null +++ b/libjava/testsuite/libjava.jni/init.h @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#include <jni.h> + +#ifndef __init__ +#define __init__ + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* __init__ */ diff --git a/libjava/testsuite/libjava.jni/init.jar b/libjava/testsuite/libjava.jni/init.jar Binary files differnew file mode 100644 index 00000000000..1bf20ac9827 --- /dev/null +++ b/libjava/testsuite/libjava.jni/init.jar diff --git a/libjava/testsuite/libjava.jni/init.java b/libjava/testsuite/libjava.jni/init.java new file mode 100644 index 00000000000..3303d319e74 --- /dev/null +++ b/libjava/testsuite/libjava.jni/init.java @@ -0,0 +1,26 @@ +// Regression test for JNI and static initializers. + +public class init +{ + public static class NativeClass + { + static + { + System.out.println("static initializer 2"); + System.loadLibrary("init"); // if it's here, this app doesn't work + } + + public static native void printHello(); + } + + static + { + System.out.println("static initializer 1"); + } + + public static void main(String[] args) + { + //System.loadLibrary("test"); // if it's here, this app works + NativeClass.printHello(); + } +} diff --git a/libjava/testsuite/libjava.jni/init.out b/libjava/testsuite/libjava.jni/init.out new file mode 100644 index 00000000000..4e62d1ffe6b --- /dev/null +++ b/libjava/testsuite/libjava.jni/init.out @@ -0,0 +1,3 @@ +static initializer 1 +static initializer 2 +hello |