From 0ccadf458df125985960ccff8a7d065ae5166908 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 7 Feb 2007 22:02:40 +0000 Subject: [PATCH] init.c: New file. * 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. From-SVN: r121698 --- libjava/ChangeLog | 9 ++++++ .../testsuite/libjava.jni/init$NativeClass.h | 19 +++++++++++++ libjava/testsuite/libjava.jni/init.c | 8 ++++++ libjava/testsuite/libjava.jni/init.h | 18 ++++++++++++ libjava/testsuite/libjava.jni/init.jar | Bin 0 -> 1294 bytes libjava/testsuite/libjava.jni/init.java | 26 ++++++++++++++++++ libjava/testsuite/libjava.jni/init.out | 3 ++ 7 files changed, 83 insertions(+) create mode 100644 libjava/testsuite/libjava.jni/init$NativeClass.h create mode 100644 libjava/testsuite/libjava.jni/init.c create mode 100644 libjava/testsuite/libjava.jni/init.h create mode 100644 libjava/testsuite/libjava.jni/init.jar create mode 100644 libjava/testsuite/libjava.jni/init.java create mode 100644 libjava/testsuite/libjava.jni/init.out diff --git a/libjava/ChangeLog b/libjava/ChangeLog index cc6a25fcd7d..06c1a1f9e97 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2007-02-07 Tom Tromey + + * 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. + 2007-02-07 Jakub Jelinek PR libgomp/28468 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 + +#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 +#include + +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 + +#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 new file mode 100644 index 0000000000000000000000000000000000000000..1bf20ac9827e0ba41ba1e4c3727cbf82d1dddc46 GIT binary patch literal 1294 zcmWIWW@h1H00HY%cQY^pN^k;cU)K;vT~9wZ{QwkYJ9Kjsb%4?!EP|}e*U`_@%{4eg z&)3a2F)uSMwYWq#EVZaOGe6Ht!BEeD%eg2uu_QG`*QwGnTrc%ItSPh z75_sbr!g`xEN5b1068r)FSA51IVZ8WI5*(57qg*=ZD#gz6 zt7B`Ibofh&ES0$vXNFwZf2p;L+x|emQ2wHfsc91n&fE4^fByIJ7h8g~G@lWVrKIOu zh2sV_XY(t4KduP1&W!60Fcv9uPW@HQbMw_N%Z=Y3dp|tnx}W)d|B}M#Sr@-OOl~+) z*nTCsG57S2vRNlQ%uAFicE=qMIGnL+=d{G5GrZS5+3TToTh1+@C?G}StH3XbqY}-< z$qJ$qYfWEtU1!<;D(%=p2e(H%F6VVU=`o+0putvn;;NINokqZ{E>;k1}5+pZrl-cFlQVh)gh3cF~8%-wfJeGHQgT$Z38bY0>qD$Vr=Q_yrVtJyU80!~B|E=J)8cJUm0`7LL)#}^$n9WJ4%^-D~vB=^=zpP%t(>Qmhxsvq}r%sAF_@_^2> zeMhaY@toM3@UK2)=9S5@zhtIuOtM`4EzbFBkz}pbVXHg-sIlj%`G0K>F!myVu_p$N zJr%#ilFYJHXHXnMV{*b-zuOKXt>;w){vT1C@Zq+QhobI6?nPw>)mF^*STS{th^EHx zPGc{2-yD;9E?oIn^=@^s@*i*x-D~VRC9LA%>*{xZ&&izsyZ*K{!}|;00umyot~6O| zXI`XN)%AR5yK2z-A9Kn@{MF~4U#vY*g6+RfVA*$O=Z&>CDG{$ylLZwVZaV+qH;Q=T z=A-Pg;zE&`a+Pvf^2}1bEk0)tWE@-`D<9hS_0ENto|k6mwDVqc+C4Y8(R`&P5^c$lVy_@a}L)^|P%zo)I z$2(i(##>?OX^Ow5EOWAUyRbL-#wTIvJxq7y-UPSwr%qY%eTB8_!Ij$gA6yUHm%Me` zPvP6~o|+GqUX>LU5MJbTXWi_E7snR6w`(ol_2(P=w||S4+Anfm)c#(Lm65x^A$WKB zi+j3zmPuL7Hn(v4ARXY%$ixNCY1j(^U?d^|q#^-T8+xID(4!7y!nGk45eSR1XMBVS otw1KC7(myDp5zevoPmiDqz^Lz26(fwfz+`8;a4Ed%mU&802Jcnr~m)} literal 0 HcmV?d00001 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 -- 2.30.2