1 # Special test cases. These require tricky build procedures.
3 proc gcj_special_try_compiler {} {
5 return [bytecompile_file ${srcdir}/${subdir}/pr21115I.java [pwd]]
8 proc gcj_special_pr21115 {} {
9 global srcdir subdir env
11 # ---- PR 21115 -------------------------------------------------------
13 if {! [bytecompile_file ${srcdir}/${subdir}/pr21115I.java [pwd]]} {
14 fail "bytecompile ${srcdir}/${subdir}/libjava.special/pr21115I.java"
15 # FIXME - should use `untested' on all remaining tests.
19 pass "bytecompile pr21115I.java"
21 if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
22 fail "compiling/linking pr21115.java"
27 if {! [gcj_invoke pr21115 ${srcdir}/${subdir}/pr21115.out ""]} {
35 # Write a .java file and bytecompile it. Return 0 on failure.
36 proc gcj_write_and_byte_compile {name contents} {
41 if {! [bytecompile_file $name [pwd]]} {
42 fail "bytecompile $name"
43 # FIXME - should use `untested' on all remaining tests.
47 pass "bytecompile $name"
51 # Check that BC-compiled code lazily throws IllegalAccessError.
52 proc gcj_special_lazy_illegal_access {} {
53 global srcdir subdir env
55 # Write and compile the initial files.
56 if {! [gcj_write_and_byte_compile LazyA.java {
58 public static void m() { }
63 if {! [gcj_write_and_byte_compile LazyB.java {
65 public static void m() { }
66 public static void main(String[] args) { }
72 # Create the expected output file.
73 set fd [open Lazy.out w]
76 # Now recompile LazyA with different access for m().
77 if {! [gcj_write_and_byte_compile LazyA.java {
79 private static void m() { }
85 # Link and run... this should still work, since we don't actually
86 # try to call LazyA.m().
87 if {! [gcj_link Lazy LazyB {LazyA.class LazyB.class} \
88 additional_flags=-findirect-dispatch]} {
89 fail "compiling/linking pr21115.java"
94 if {! [gcj_invoke Lazy Lazy.out ""]} {
102 # For these tests it is simpler to require that gcj work. So we try
103 # the compiler and if it fails, we simply skip the tests.
105 if {[gcj_special_try_compiler]} {
107 gcj_special_lazy_illegal_access