OSDN Git Service

a31c2bc63d3d176ede46d023fd60ffd431ed34d1
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / lib / libjava.exp
1 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation
2
3 proc load_gcc_lib { filename } {
4     global srcdir
5     load_file $srcdir/../../gcc/testsuite/lib/$filename
6 }
7
8 load_lib libgloss.exp
9 load_gcc_lib target-libpath.exp
10
11 # GCJ_UNDER_TEST is the compiler under test.
12
13 global tmpdir
14
15 if ![info exists tmpdir] {
16     set tmpdir "/tmp"
17 }
18
19 # This is like `prune_warnings', but it also prunes away a warning
20 # from the bytecode front end that we don't care about.
21 proc libjava_prune_warnings {text} {
22     set text [prune_warnings $text]
23     set tlist [split $text \n]
24     set len [llength $tlist]
25     for {set i [expr {$len - 1}]} {$i >= 2} {incr i -1} {
26         if {[string match "*unreachable bytecode*" [lindex $tlist $i]]} {
27             # Delete this line, all other unreachable warnings and the previous
28             # two lines containing the method and class.
29             set j [expr {$i - 1}]
30             while {[string match "*unreachable bytecode*" [lindex $tlist $j]]} {
31                 incr j -1
32             }
33             incr j -1
34             set tlist [lreplace $tlist $j $i]
35             set i $j
36         }
37     }
38     return [join $tlist \n]
39 }
40
41 # This is like `target_compile' but it does some surgery to work
42 # around stupid DejaGNU bugs.  In particular DejaGNU has very poor
43 # quoting, so for instance a `$' will be re-evaluated at spawn time.
44 # We don't want that.
45 proc libjava_tcompile {source destfile type options} {
46     # This strange-looking expression really does quote the `$'.
47     regsub -all -- {\$} $source {\$} source
48     regsub -all -- {\$} $destfile {\$} destfile
49     return [target_compile $source $destfile $type $options]
50 }
51
52 # Read an `xfail' file if it exists.  Returns a list of xfail tokens.
53 proc libjava_read_xfail {file} {
54     if {! [file exists $file]} {
55         return ""
56     }
57     set fd [open $file r]
58     set tokens [string trim [read $fd]]
59     close $fd
60     return $tokens
61 }
62
63 # Find a particular executable.  FIXME: this relies on DejaGnu
64 # internals.  These should probably be exposed in a better way.
65 proc libjava_find_program {prog} {
66     global tool_root_dir
67
68     set file [lookfor_file $tool_root_dir $prog]
69     if { $file == "" } {
70         set file [lookfor_file $tool_root_dir gcc/$prog];
71     }
72     if {$file == ""} {
73         set file $prog
74     }
75     return $file
76 }
77
78 # Find `gcjh'.
79 proc find_gcjh {} {
80     return [libjava_find_program gjavah]
81 }
82
83 proc find_javac {} {
84     global SUN_JAVAC GCJ_UNDER_TEST env libgcj_jar
85     # If JDK doesn't run on your platform but some other
86     # JDK-compatible javac does, you may set SUN_JAVAC to point to it.
87     # One of the most important properties of a SUN_JAVAC is that it
88     # must create class-files even for classes that have not been
89     # specified in the command line, but that were needed to compile
90     # those that have.  For example, Pizza won't do it, but you can
91     # use `kaffe sun.tools.javac.Main', if you have Sun's classes.zip
92     # in the kaffe's default search path.
93     if {![info exists SUN_JAVAC]} {
94         if {[info exists env(SUN_JAVAC)]} {
95             set SUN_JAVAC $env(SUN_JAVAC)
96         } else {
97             set SUN_JAVAC "$GCJ_UNDER_TEST -C -I$libgcj_jar"
98         }
99     }
100     return $SUN_JAVAC
101 }
102
103 proc bytecompile_file { file objdir {classpath {}} } {
104     global env
105     set dirname [file dirname $file]
106
107     set javac [find_javac]
108     if {$classpath != ""} then {
109         set env(CLASSPATH) $classpath
110     }
111     set here [pwd]
112     cd $dirname
113     send_log "byte compile: $javac -g [list $file] -d $objdir 2>@ stdout\n"
114     if {[catch {
115         set q [eval exec "$javac -g [list $file] -d $objdir 2>@ stdout"]
116     } msg]} then {
117         send_log "couldn't compile $file: $msg\n"
118         set r 0
119     } else {
120         set r 1
121     }
122     cd $here
123     return $r
124 }
125
126 set libjava_initialized 0
127
128 #
129 # Build the status wrapper library as needed.
130 #
131 proc libjava_init { args } {
132     global wrapper_file;
133     global wrap_compile_flags;
134     global libjava_initialized libjava_uses_threads
135     global GCJ_UNDER_TEST
136     global TOOL_EXECUTABLE
137     global env objdir
138     global env libgcj_jar
139     global tool_root_dir
140     global libjava_libgcc_s_path
141     global target_triplet
142     global libjava_version
143
144     # We set LC_ALL and LANG to C so that we get the same error messages as expected.
145     setenv LC_ALL C
146     setenv LANG C
147
148     if { $libjava_initialized == 1 } { return; }
149
150     if ![info exists GCJ_UNDER_TEST] {
151         if [info exists TOOL_EXECUTABLE] {
152             set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
153         } else {
154             if [info exists env(GCJ)] {
155                 set GCJ_UNDER_TEST $env(GCJ)
156             } else {
157                 set GCJ_UNDER_TEST "[find_gcj]"
158             }
159         }
160     }
161
162     # Find the libgcj jar file.
163
164     # FIXME: This finds libgcj.spec for the default multilib.
165     # If thread models differ between multilibs, this has to be moved
166     # to libjava_arguments
167     set specdir [libjava_find_spec]
168
169     set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
170     regexp " version \[^\n\r\]*" $text version
171     set libjava_version [lindex $version 1]
172
173     verbose "version: $libjava_version"
174
175     set libgcj_jar [glob $objdir/../libgcj-$libjava_version.jar]
176     verbose "jar file is $libgcj_jar"
177
178     # The -B is so we find libgcj.spec.
179     regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
180     set libjava_uses_threads [expr {! ($model == "no"
181                                        || $model == "none"
182                                        || $model == "single")}]
183
184     # Always set encoding used by gcj.
185     append GCJ_UNDER_TEST " --encoding=UTF-8"
186
187     set wrapper_file "";
188     set wrap_compile_flags "";
189     if [target_info exists needs_status_wrapper] {
190         set result [build_wrapper "testglue.o"];
191         if { $result != "" } {
192             set wrapper_file [lindex $result 0];
193             set wrap_compile_flags [lindex $result 1];
194         } else {
195             warning "Status wrapper failed to build."
196         }
197     }
198
199     # Finally, add the gcc build directory so that we can find the
200     # shared libgcc.  This, like much of dejagnu, is hideous.
201     set libjava_libgcc_s_path {}
202
203     if { [istarget "*-*-darwin*"] } {
204         set so_extension "dylib"
205     } else {
206         set so_extension "so"
207     }
208     set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
209     if {$gccdir != ""} {
210         set gccdir [file dirname $gccdir]
211         lappend libjava_libgcc_s_path $gccdir
212         verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
213         set compiler ${gccdir}/xgcc
214         if { [is_remote host] == 0 && [which $compiler] != 0 } {
215             foreach i "[exec $compiler --print-multi-lib]" {
216                 set mldir ""
217                 regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
218                 set mldir [string trimright $mldir "\;@"]
219                 if { "$mldir" == "." } {
220                     continue
221                 }
222                 if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] >= 1 } {
223                     lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
224                 }
225             }
226         }
227     }
228
229     set libjava_initialized 1
230 }
231
232 # Find a library.  We know where libtool puts the actual libraries,
233 # and we look there.  The implementation is fairly hacky.  We can't
234 # compile with -nodefaultlibs, because that will also eliminate the
235 # system libraries we need.  In order to have gcj still work, it must
236 # find the appropriate libraries so we must add -L options for their
237 # paths.  However we can't simply use those libraries; we still need
238 # libtool for linking.
239 # Don't return the the lib${name}.la files here, since this causes the
240 # libraries to be linked twice: once as lib${name}.so/dylib and another time
241 # via gcj's implicit -l${name}.  This is both unnecessary and causes the
242 # Solaris ld to warn: attempted multiple inclusion of file.  This warning
243 # is not ignored by the dejagnu framework and cannot be disabled.
244 proc libjava_find_lib {dir name} {
245     global base_dir
246     set gp [get_multilibs]
247     foreach extension {so dll dylib sl a} {
248         foreach sub {.libs _libs} {
249             if {$gp != ""} {
250                 if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
251                     # Just return the `-L' option.  The library itself
252                     # will be picked up via the spec file.
253                     return "-L$gp/$dir/$sub"
254                 }
255             }
256             # Just return the `-L' option.  The library itself will be
257             # picked up via the spec file.
258             set lib [findfile \
259                        $base_dir/../../$dir/$sub/lib${name}.${extension} \
260                        "-L$base_dir/../../$dir/$sub" \
261                        ""]
262             if {$lib != ""} {
263                 return $lib
264             }
265         }
266     }
267     return ""
268 }
269
270 # Find libgcj.spec.  We need to use the file corresponding to the multilib
271 # under test since they might differ.  Append a trailing slash since this
272 # is used with -B.
273 proc libjava_find_spec {} {
274     global objdir
275     return "$objdir/../"
276 }
277
278 # Find `gij'.  Return empty string if not found.
279 proc libjava_find_gij {} {
280     global base_dir objdir
281
282     set gijdir [lookfor_file [get_multilibs] libjava];
283     # Fall back if get_multilibs fails.
284     if {$gijdir == ""} {
285       set gijdir "$objdir/.."
286     }
287     if {! [file exists $gijdir/gij]} {
288         return ""
289     }
290     return $gijdir/gij
291 }
292
293 # Remove a bunch of files.
294 proc gcj_cleanup {args} {
295     foreach file $args {
296         if {[string match *.o $file]} {
297             verbose "removing [file rootname $file].lo"
298             file delete -force [file rootname $file].lo
299         }
300         file delete -force -- $file
301         verbose "removing $file"
302     }
303     # It is simplest to do this instead of trying to figure out what
304     # bits in .libs ought to be removed.
305     catch {system "rm -rf .libs"}
306 }
307
308 # Compute arguments needed for compiler.  MODE is a libtool mode:
309 # either compile or link.
310 proc libjava_arguments {{mode compile}} {
311     global base_dir
312     global LIBJAVA
313     global srcdir subdir objdir
314     global TOOL_OPTIONS
315     global GCJ_UNDER_TEST
316     global tmpdir
317     global runtests
318     global env
319     global tool_root_dir
320     global libgcj_jar
321     global libjava_libgcc_s_path
322     global libjava_ld_library_path
323     global ld_library_path
324     global target_triplet
325
326     if [info exists LIBJAVA] {
327         set libjava $LIBJAVA;
328     } else {
329         set libjava [libjava_find_lib libjava gcj]
330     }
331
332     verbose "using LIBJAVA = $libjava" 2
333     set args ""
334
335     # Basically we want to build up a colon separated path list from
336     # the value of $libjava.
337
338     set lpath "."
339     foreach dir [list $libjava] {
340         foreach item [split $dir " "] {
341             switch -glob -- $item {
342                 "-L*" {
343                     lappend lpath [string range $item 2 end]
344                 }
345             }
346         }
347     }
348
349     set lpath [concat $lpath $libjava_libgcc_s_path]
350     verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
351     set ld_library_path [join $lpath :]
352     set libjava_ld_library_path "$ld_library_path"
353
354     # That's enough to make things work for the normal case.
355     # If we wanted to handle an arbitrary value of libjava,
356     # then we'd have to do a lot more work.
357
358     set_ld_library_path_env_vars
359     if [info exists env(LD_LIBRARY_PATH)] {
360         verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
361     }
362
363     # Determine CLASSPATH separator
364     if { [string match "i?86-pc-mingw32*" $target_triplet] } {
365         set sep ";"
366     } else {
367         set sep ":"
368     }
369
370     # Set the CLASSPATH environment variable
371     global env
372     set env(CLASSPATH) \
373         [join [list . $srcdir/$subdir $objdir $libgcj_jar] $sep]
374     verbose "CLASSPATH is $env(CLASSPATH)"
375
376     # Disable all warnings, as ecj is rather chatty.
377     lappend args "additional_flags=-w"
378
379     if {$mode == "link"} {
380         global wrapper_file wrap_compile_flags
381         lappend args "additional_flags=$wrap_compile_flags"
382
383         if { [regexp "linux" $target_triplet] } {
384             lappend args "additional_flags=-specs=libgcj-test.spec"
385         }
386
387         lappend args "libs=$wrapper_file"
388         lappend args "libs=$libjava"
389         lappend args debug
390     }
391
392     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
393         lappend args "libs=${gluefile}"
394         lappend args "ldflags=$wrap_flags"
395     }
396
397     if [info exists TOOL_OPTIONS] {
398         lappend args "additional_flags=$TOOL_OPTIONS"
399     }
400
401     # Determine libgcj.spec corresponding to multilib under test.
402     set specdir [libjava_find_spec]
403
404     # Search for libtool.  We need it to link.
405     set found_compiler 0
406     set d [absolute $objdir]
407     foreach x {. .. ../.. ../../..} {
408         if {[file exists $d/$x/libtool]} then {
409             # We have to run silently to avoid DejaGNU lossage.
410             lappend args \
411               "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
412             set found_compiler 1
413             break
414         }
415     }
416     if {! $found_compiler} {
417         # Append -B$specdir so that we find libgcj.spec before it
418         # is installed.
419         lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
420     }
421
422     # Avoid libtool wrapper scripts when possible.
423     # but not if libtool warnings results in FAILs
424     if {$mode == "link"} {
425         if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"]
426             && ! [istarget "*-*-darwin*"] } { 
427             lappend args "additional_flags=-no-install"
428         }
429         if { [istarget "*-*-darwin*"] } {
430             lappend args "additional_flags=-bind_at_load"
431             lappend args "additional_flags=-multiply_defined suppress"
432         }
433         if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"] || [istarget "*-*-darwin2*"] } {
434             lappend args "additional_flags=-Wl,-allow_stack_execute"
435         }
436
437     }
438
439     return $args
440 }
441
442 # Link a bunch of objects into a program.  MAIN is the name of the
443 # class holding `main'.  Return 0 on failure.
444 proc gcj_link {program main files {options {}}} {
445     set arguments [libjava_arguments link]
446     if {[llength $options]} {
447         eval lappend arguments $options
448     }
449     lappend arguments "additional_flags=--main=$main"
450     set x [libjava_prune_warnings \
451              [libjava_tcompile $files $program executable $arguments]]
452     if {$x != ""} {
453         verbose "link failure: $x" 2
454         fail "linking $program"
455         setup_xfail "*-*-*"
456         fail "running $program"
457         return 0
458     }
459
460     pass "linking $program"
461     return 1
462 }
463
464 # Invoke the program and see what happens.  Return 0 on failure.
465 proc gcj_invoke {program expectFile ld_library_additions} {
466   global env
467   global libjava_ld_library_path
468   global ld_library_path
469
470   set ld_library_path "$libjava_ld_library_path"
471   if {[llength $ld_library_additions] > 0} {
472     append ld_library_path :[join $ld_library_additions :]
473   }
474
475   set_ld_library_path_env_vars
476   if [info exists env(LD_LIBRARY_PATH)] {
477     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
478   }
479
480   set result [libjava_load ./$program]
481   set status [lindex $result 0]
482   set output [lindex $result 1]
483
484   # Restore setting
485   restore_ld_library_path_env_vars
486
487   if {$status != "pass"} {
488     verbose "got $output"
489     fail "$program run"
490     untested "$program output"
491     return 0
492   }
493
494   set id [open $expectFile r]
495   set expected [read $id]
496   close $id
497
498   if {! [string compare $output $expected]} {
499     pass "$program output"
500     return 1
501   } else {
502     fail "$program output"
503     return 0
504   }
505 }
506
507 proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
508   global env
509   global libjava_ld_library_path
510   global ld_library_path
511
512   set ld_library_path "$libjava_ld_library_path"
513   if {[llength $ld_library_additions] > 0} {
514   append ld_library_path :[join $ld_library_additions :]
515   }
516         
517   set_ld_library_path_env_vars
518   if [info exists env(LD_LIBRARY_PATH)] {
519     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
520   }
521   
522   set gij [libjava_find_gij]
523   set classname [file rootname [file tail $jarfile]]
524   
525   puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $addl_flags $classname"
526         
527   set result [libjava_load $gij "-cp $jarfile $addl_flags $classname"]
528   set status [lindex $result 0]
529   set output [lindex $result 1]
530
531   restore_ld_library_path_env_vars
532
533   if {$status != "pass"} {
534     verbose "got $output"
535     fail "$classname run"
536     untested "$classname output"
537     return 0
538   }
539
540   set id [open $expectFile r]
541   set expected [read $id]
542   close $id
543
544   if {! [string compare $output $expected]} {
545     pass "$classname output"
546     return 1
547   } else {
548     fail "$classname output"
549     return 0
550   }
551 }
552
553 # Invoke a program and check its output.  EXECUTABLE is the program;
554 # ARGS are the arguments to the program.  Returns 1 if tests passed
555 # (or things were left untested), 0 otherwise.
556 proc libjava_invoke {errname testName optName executable inpfile resultfile
557                       ld_library_additions args} {
558     global env
559     global libjava_ld_library_path
560     global ld_library_path
561
562     set ld_library_path "$libjava_ld_library_path"
563     if {[llength $ld_library_additions] > 0} {
564         append ld_library_path :[join $ld_library_additions :]
565     }
566
567     set_ld_library_path_env_vars
568     if [info exists env(LD_LIBRARY_PATH)] {
569         verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
570     }
571
572     upvar $optName opts
573
574     if {[info exists opts(no-exec)]} {
575         if {[info exists opts(need-threads)]} {
576             # This means we wanted to try to run it but we couldn't
577             # because threads aren't supported.  So we have to
578             # generate an `untested'.
579             untested "$errname execution - $testName"
580             untested "$errname output - $testName"
581         }
582         return 1
583     }
584
585     send_log "invoke: $executable $args $inpfile\n"
586
587     set result [libjava_load $executable $args "$inpfile"]
588     set status [lindex $result 0]
589     set output [lindex $result 1]
590
591     # Restore LD_LIBRARY_PATH setting.
592     restore_ld_library_path_env_vars
593
594     if {[info exists opts(xfail-exec)]} then {
595         setup_xfail *-*-*
596     }
597     $status "$errname execution - $testName"
598     if { $status != "pass" } {
599         untested "$errname output - $testName"
600         return 0
601     }
602
603     verbose "resultfile is $resultfile"
604     set id [open $resultfile r]
605     set expected ""
606     append expected [read $id]
607     regsub -all "\r" "$output" "" output
608     regsub "\n*$" $expected "" expected
609     regsub "\n*$" $output "" output
610     regsub "^\n*" $expected "" expected
611     regsub "^\n*" $output "" output
612     regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
613     regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
614     regsub -all "\[ \t\]\[ \t\]*" $output " " output
615     regsub -all "\[ \t\]*\n\n*" $output "\n" output
616     verbose "expected is $expected"
617     verbose "actual is $output"
618     set passed 0
619     if {[info exists opts(regexp_match)]} {
620         if [regexp $expected $output] {
621             set passed 1
622         }
623     } else {
624         if { $expected == $output } {
625             set passed 1
626         }
627     }
628     if {[info exists opts(xfail-output)]} {
629         setup_xfail *-*-*
630     }
631     if { $passed == 1 } {
632         pass "$errname output - $testName"
633     } else {
634         fail "$errname output - $testName"
635     }
636     close $id
637
638     return $passed
639 }
640
641 #
642 # Run the test specified by srcfile and resultfile. compile_args and
643 # exec_args are options telling this proc how to work.
644 #
645 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
646     global base_dir
647     global srcdir subdir objdir
648     global TOOL_OPTIONS
649     global GCJ_UNDER_TEST
650     global tmpdir
651     global runtests
652
653     # Make opts into an array.
654     set opts(_) x
655     unset opts(_)
656     foreach item $exec_args {
657         set opts($item) x
658     }
659
660     # If we need threads and we don't have them then set the `no-exec'
661     # flag.  This is case is also handled specially later.
662     if {[info exists opts(need-threads)]} {
663         global libjava_uses_threads
664         if {! $libjava_uses_threads} {
665             set opts(no-exec) x
666         }
667     }
668
669     set errname [file rootname [file tail $srcfile]]
670     if {! [runtest_file_p $runtests $errname]} {
671         return
672     }
673
674     if {[info exists opts(no-link)]} {
675         set mode compile
676     } else {
677         set mode link
678     }
679     set args [libjava_arguments $mode]
680     if {! [info exists opts(no-link)]} {
681         # Add the --main flag
682         lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
683         if { $compile_args != "" } {
684             lappend args "additional_flags=$compile_args"
685         }
686     }
687
688     regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
689     set executable "${objdir}/$out"
690     if {[info exists opts(no-link)]} {
691         append executable ".o"
692         set target object
693     } else {
694         # DOS/win32 targets default to .exe if no suffix is given
695         # We then try to delete a file that doesn't exist.  It is
696         # simpler to add the suffix everywhere.
697         append executable ".exe"
698         set target executable
699     }
700     if { $compile_args != "" } {
701         set errname "$errname $compile_args"
702     }
703
704     set removeList [list $executable]
705
706     set x [libjava_prune_warnings \
707              [libjava_tcompile $srcfile "$executable" $target $args]]
708     if {[info exists opts(xfail-gcj)]} {
709         setup_xfail *-*-*
710     }
711     if { $x != "" } {
712         verbose "target_compile failed: $x" 2
713
714         if {[info exists opts(shouldfail)]} {
715             pass "$errname compilation from source"
716             eval gcj_cleanup $removeList
717             return
718         }
719
720         fail "$errname compilation from source"
721         if {[info exists opts(xfail-gcj)]
722             || ! [info exists opts(no-exec)]
723             || [info exists opts(need-threads)]} {
724             untested "$errname execution from source compiled test"
725             untested "$errname output from source compiled test"
726         }
727         return
728     }
729     if {[info exists opts(shouldfail)]} {
730         fail "$errname compilation from source"
731         return
732     }
733     pass "$errname compilation from source"
734
735     # Set up the options the way they are expected by libjava_invoke.
736     if {[info exists opts(xfail-source-output)]} {
737         set opts(xfail-output) x
738     }
739     if {[libjava_invoke $errname "source compiled test" opts $executable \
740            $inpfile $resultfile ""]} {
741         # Everything ok, so clean up.
742         eval gcj_cleanup $removeList
743     }
744 }
745
746 #
747 # Run the test specified by srcfile and resultfile. compile_args and
748 # exec_args are options telling this proc how to work.
749 #   `no-link'     don't try to link the program
750 #   `no-exec'     don't try to run the test
751 #   `xfail-gcj'   compilation from source will fail
752 #   `xfail-javac' compilation with javac will fail
753 #   `xfail-gcjC'  compilation with gcj -C will fail
754 #   `shouldfail'  compilation from source is supposed to fail
755 #                 This is different from xfail, which marks a known
756 #                 failure that we just haven't fixed.
757 #                 A compilation marked this way should fail with any
758 #                 front end.
759 #   `xfail-byte'  compilation from bytecode will fail
760 #   `xfail-exec'  exec will fail
761 #   `xfail-output'
762 #                 output will be wrong
763 #   `xfail-byte-output'
764 #                 output will be wrong when compiled from bytecode
765 #   `xfail-source-output'
766 #                 output will be wrong when compiled from source code
767 #   `need-threads'
768 #                 test relies on thread support
769 #
770 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
771     test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
772
773     # Test BC-ABI compilation.
774     set compile_args_bcabi $compile_args
775     lappend compile_args_bcabi "-findirect-dispatch"
776     test_libjava_from_source $options $srcfile $compile_args_bcabi $inpfile $resultfile $exec_args
777 }
778
779 #
780 # libjava_version -- extract and print the version number of libjavap
781 #
782 proc default_libjava_version {} {
783 }
784
785 proc default_libjava_start { } {
786 }
787
788 # Local Variables:
789 # tcl-indent-level:4
790 # End: