+2004-04-30 Ranjit Mathew <rmathew@hotmail.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
+ additional option "-Wmissing-prototypes" for compiling C sources.
+ Print actual filename for pass/fail rather than $name.c.
+ * testsuite/libjava.jni/PR15133.java: New testcase file.
+ * testsuite/libjava.jni/PR15133.c: Likewise.
+ * testsuite/libjava.jni/PR15133.out: Likewise.
+
2004-04-30 Roger Sayle <roger@eyesopen.com>
* testsuite/libjava.lang/MathBuiltin.java: Add tests for acos, asin,
--- /dev/null
+/* Test case for PR java/15133 */
+public class PR15133
+{
+ public void printIt (String dummy) { }
+
+ public native void printIt (int num);
+
+ public static void main (String[] args)
+ {
+ System.loadLibrary ("PR15133");
+
+ new PR15133( ).printIt( 1729);
+ }
+}
set so_extension "so"
set so_flag "-shared"
}
- set name [file rootname [file tail $file]]
+ set filename [file tail $file]
+ set name [file rootname $filename]
set soname lib${name}.${so_extension}
lappend options "additional_flags=${so_flag} -fPIC"
# Find the generated header.
lappend options "additional_flags=-I. -I.."
+
+ # Ensure that the generated header has correct prototypes.
+ set cfile [file rootname $file].c
+ if { [file exists $cfile]} {
+ # This option is only valid for C sources.
+ lappend options "additional_flags=-Wmissing-prototypes"
+ }
+
# Find jni.h.
lappend options "additional_flags=-I$srcdir/../include"
[target_compile $file $soname executable $options]]
if {$x != ""} {
verbose "target_compile failed: $x" 2
- fail "$name.c compilation"
+ fail "$filename compilation"
return 0
}
- pass "$name.c compilation"
+ pass "$filename compilation"
return 1
}