diff options
Diffstat (limited to 'libjava/testsuite')
-rw-r--r-- | libjava/testsuite/Makefile.in | 1 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/assign2.java | 21 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/assign2.out | 1 | ||||
-rw-r--r-- | libjava/testsuite/libjava.loader/loader.exp | 18 |
4 files changed, 37 insertions, 4 deletions
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in index 2e51cd9e63a..2fe07c88e31 100644 --- a/libjava/testsuite/Makefile.in +++ b/libjava/testsuite/Makefile.in @@ -134,6 +134,7 @@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@ LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@ LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@ LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@ +LIBGCJ_LD_SYMBOLIC = @LIBGCJ_LD_SYMBOLIC@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ diff --git a/libjava/testsuite/libjava.lang/assign2.java b/libjava/testsuite/libjava.lang/assign2.java new file mode 100644 index 00000000000..41fdcb594d9 --- /dev/null +++ b/libjava/testsuite/libjava.lang/assign2.java @@ -0,0 +1,21 @@ +// Test for an array assignment bug we've had. + +public class assign2 +{ + public static Object[][] c () { return new Long[5][5]; } + + public static Object[] d () { return new Integer[3]; } + + public static void main(String[] args) + { + try + { + Object[][] x = c(); + x[0] = d(); + } + catch (ArrayStoreException _) + { + System.out.println("good"); + } + } +} diff --git a/libjava/testsuite/libjava.lang/assign2.out b/libjava/testsuite/libjava.lang/assign2.out new file mode 100644 index 00000000000..12799ccbe7c --- /dev/null +++ b/libjava/testsuite/libjava.lang/assign2.out @@ -0,0 +1 @@ +good diff --git a/libjava/testsuite/libjava.loader/loader.exp b/libjava/testsuite/libjava.loader/loader.exp index e306a312c83..86e518170c4 100644 --- a/libjava/testsuite/libjava.loader/loader.exp +++ b/libjava/testsuite/libjava.loader/loader.exp @@ -1,5 +1,15 @@ # Tests for ClassLoader and native library loader code. +# Compute the correct name for an object file. +# This is an awful hack. +proc gcj_object_file_name {compiler base} { + verbose "OBJECT: compiler = $compiler" + if {[string match *libtool* $compiler]} { + return $base.lo + } + return $base.o +} + # Do all the work for a single JNI test. Return 0 on failure. proc gcj_loader_test_one {srcfile} { global objdir srcdir subdir @@ -9,9 +19,9 @@ proc gcj_loader_test_one {srcfile} { regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out set executable "${objdir}/$out.exe" - set errname [file rootname [file tail $srcfile]] - set args [libjava_arguments link] - lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o" + set errname [file rootname [file tail $srcfile]] + set args [libjava_arguments link] + lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/[gcj_object_file_name $args dummy]" set x [libjava_prune_warnings \ [libjava_tcompile $srcfile "$executable" executable $args]] @@ -47,7 +57,7 @@ proc gcj_loader_run {} { set args [libjava_arguments compile] lappend args "additional_flags=--resource $objdir/dummy.class" set x [libjava_prune_warnings \ - [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]] + [libjava_tcompile "$objdir/dummy.class" "$objdir/[gcj_object_file_name $args dummy]" object $args]] if { $x != "" } { verbose "resource compilation failed: $x" 2 |