* config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_COMMON): Use floor_log2.
[official-gcc.git] / libjava / testsuite / libjava.special / special.exp
blob8397f85679203eeb105d2f8dab062c07e6c9464f
1 # Special test cases. These require tricky build procedures.
3 proc gcj_special_try_compiler {} {
4 global srcdir subdir
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.
16 # But that is hard.
17 return 0
19 pass "bytecompile pr21115I.java"
21 if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
22 fail "compiling/linking pr21115.java"
23 # FIXME
24 return 0
27 if {! [gcj_invoke pr21115 ${srcdir}/${subdir}/pr21115.out ""]} {
28 # FIXME
29 return 0
32 return 1
35 # Write a .java file and bytecompile it. Return 0 on failure.
36 proc gcj_write_and_byte_compile {name contents} {
37 set fd [open $name w]
38 puts $fd $contents
39 close $fd
41 if {! [bytecompile_file $name [pwd]]} {
42 fail "bytecompile $name"
43 # FIXME - should use `untested' on all remaining tests.
44 # But that is hard.
45 return 0
47 pass "bytecompile $name"
48 return 1
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 {
57 public class LazyA {
58 public static void m() { }
60 }]} {
61 return 0
63 if {! [gcj_write_and_byte_compile LazyB.java {
64 public class LazyB {
65 public static void m() { }
66 public static void main(String[] args) { }
68 }]} {
69 return 0
72 # Create the expected output file.
73 set fd [open Lazy.out w]
74 close $fd
76 # Now recompile LazyA with different access for m().
77 if {! [gcj_write_and_byte_compile LazyA.java {
78 public class LazyA {
79 private static void m() { }
81 }]} {
82 return 0
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"
90 # FIXME
91 return 0
94 if {! [gcj_invoke Lazy Lazy.out ""]} {
95 # FIXME
96 return 0
99 return 1
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]} {
106 gcj_special_pr21115
107 gcj_special_lazy_illegal_access