aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-05-18 18:51:35 +0000
committerTom Tromey <tromey@gcc.gnu.org>2006-05-18 18:51:35 +0000
commite389defe261a3d374812e4bef42774cecd70316e (patch)
treee4a9fab743e1a3d3ae79b7c07306e64e75eac38c /libjava
parenta1d1988f99277ab1208a6d66f8aa27323b583b4c (diff)
downloadgcc-e389defe261a3d374812e4bef42774cecd70316e.zip
gcc-e389defe261a3d374812e4bef42774cecd70316e.tar.gz
gcc-e389defe261a3d374812e4bef42774cecd70316e.tar.bz2
special.exp (gcj_special_pr21115): Renamed.
* testsuite/libjava.special/special.exp (gcj_special_pr21115): Renamed. (gcj_write_and_byte_compile): New proc. (gcj_special_lazy_illegal_access): Likewise. From-SVN: r113890
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/testsuite/libjava.special/special.exp74
2 files changed, 78 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 1d0492f..f8af155 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-18 Tom Tromey <tromey@redhat.com>
+
+ * testsuite/libjava.special/special.exp (gcj_special_pr21115):
+ Renamed.
+ (gcj_write_and_byte_compile): New proc.
+ (gcj_special_lazy_illegal_access): Likewise.
+
2006-05-18 Mark Wielaard <mark@klomp.org>
Imported GNU Classpath 0.90
diff --git a/libjava/testsuite/libjava.special/special.exp b/libjava/testsuite/libjava.special/special.exp
index 76afd9a..ab18b47 100644
--- a/libjava/testsuite/libjava.special/special.exp
+++ b/libjava/testsuite/libjava.special/special.exp
@@ -1,6 +1,6 @@
# Special test cases. These require tricky build procedures.
-proc gcj_special_run {} {
+proc gcj_special_pr21115 {} {
global srcdir subdir env
# ---- PR 21115 -------------------------------------------------------
@@ -13,7 +13,7 @@ proc gcj_special_run {} {
}
pass "bytecompile pr21115I.java"
- if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
+ if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
fail "compiling/linking pr21115.java"
# FIXME
return 0
@@ -27,4 +27,72 @@ proc gcj_special_run {} {
return 1
}
-gcj_special_run
+# Write a .java file and bytecompile it. Return 0 on failure.
+proc gcj_write_and_byte_compile {name contents} {
+ set fd [open $name w]
+ puts $fd $contents
+ close $fd
+
+ if {! [bytecompile_file $name [pwd]]} {
+ fail "bytecompile $name"
+ # FIXME - should use `untested' on all remaining tests.
+ # But that is hard.
+ return 0
+ }
+ pass "bytecompile $name"
+ return 1
+}
+
+# Check that BC-compiled code lazily throws IllegalAccessError.
+proc gcj_special_lazy_illegal_access {} {
+ global srcdir subdir env
+
+ # Write and compile the initial files.
+ if {! [gcj_write_and_byte_compile LazyA.java {
+ public class LazyA {
+ public static void m() { }
+ }
+ }]} {
+ return 0
+ }
+ if {! [gcj_write_and_byte_compile LazyB.java {
+ public class LazyB {
+ public static void m() { }
+ public static void main(String[] args) { }
+ }
+ }]} {
+ return 0
+ }
+
+ # Create the expected output file.
+ set fd [open Lazy.out w]
+ close $fd
+
+ # Now recompile LazyA with different access for m().
+ if {! [gcj_write_and_byte_compile LazyA.java {
+ public class LazyA {
+ private static void m() { }
+ }
+ }]} {
+ return 0
+ }
+
+ # Link and run... this should still work, since we don't actually
+ # try to call LazyA.m().
+ if {! [gcj_link Lazy LazyB {LazyA.class LazyB.class} \
+ additional_flags=-findirect-dispatch]} {
+ fail "compiling/linking pr21115.java"
+ # FIXME
+ return 0
+ }
+
+ if {! [gcj_invoke Lazy Lazy.out ""]} {
+ # FIXME
+ return 0
+ }
+
+ return 1
+}
+
+gcj_special_pr21115
+gcj_special_lazy_illegal_access