1 # Special test cases. These require tricky build procedures.
3 proc gcj_special_pr21115 {} {
4 global srcdir subdir env
6 # ---- PR 21115 -------------------------------------------------------
8 if {! [bytecompile_file ${srcdir}/${subdir}/pr21115I.java [pwd]]} {
9 fail "bytecompile ${srcdir}/${subdir}/libjava.special/pr21115I.java"
10 # FIXME - should use `untested' on all remaining tests.
14 pass "bytecompile pr21115I.java"
16 if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
17 fail "compiling/linking pr21115.java"
22 if {! [gcj_invoke pr21115 ${srcdir}/${subdir}/pr21115.out ""]} {
30 # Write a .java file and bytecompile it. Return 0 on failure.
31 proc gcj_write_and_byte_compile {name contents} {
36 if {! [bytecompile_file $name [pwd]]} {
37 fail "bytecompile $name"
38 # FIXME - should use `untested' on all remaining tests.
42 pass "bytecompile $name"
46 # Check that BC-compiled code lazily throws IllegalAccessError.
47 proc gcj_special_lazy_illegal_access {} {
48 global srcdir subdir env
50 # Write and compile the initial files.
51 if {! [gcj_write_and_byte_compile LazyA.java {
53 public static void m() { }
58 if {! [gcj_write_and_byte_compile LazyB.java {
60 public static void m() { }
61 public static void main(String[] args) { }
67 # Create the expected output file.
68 set fd [open Lazy.out w]
71 # Now recompile LazyA with different access for m().
72 if {! [gcj_write_and_byte_compile LazyA.java {
74 private static void m() { }
80 # Link and run... this should still work, since we don't actually
81 # try to call LazyA.m().
82 if {! [gcj_link Lazy LazyB {LazyA.class LazyB.class} \
83 additional_flags=-findirect-dispatch]} {
84 fail "compiling/linking pr21115.java"
89 if {! [gcj_invoke Lazy Lazy.out ""]} {
98 gcj_special_lazy_illegal_access