diff options
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 |