OSDN Git Service

* testsuite/libjava.jvmti/jvmti-interp.exp
[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     } elseif { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } {
206         set so_extension "dll"
207     } else {
208         set so_extension "so"
209     }
210     set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
211     if {$gccdir != ""} {
212         set gccdir [file dirname $gccdir]
213         lappend libjava_libgcc_s_path $gccdir
214         verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
215         set compiler ${gccdir}/xgcc
216         if { [is_remote host] == 0 && [which $compiler] != 0 } {
217             foreach i "[exec $compiler --print-multi-lib]" {
218                 set mldir ""
219                 regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
220                 set mldir [string trimright $mldir "\;@"]
221                 if { "$mldir" == "." } {
222                     continue
223                 }
224                 if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] >= 1 } {
225                     lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
226                 }
227             }
228         }
229     }
230
231     set libjava_initialized 1
232 }
233
234 # Find a library.  We know where libtool puts the actual libraries,
235 # and we look there.  The implementation is fairly hacky.  We can't
236 # compile with -nodefaultlibs, because that will also eliminate the
237 # system libraries we need.  In order to have gcj still work, it must
238 # find the appropriate libraries so we must add -L options for their
239 # paths.  However we can't simply use those libraries; we still need
240 # libtool for linking.
241 # Don't return the the lib${name}.la files here, since this causes the
242 # libraries to be linked twice: once as lib${name}.so/dylib and another time
243 # via gcj's implicit -l${name}.  This is both unnecessary and causes the
244 # Solaris ld to warn: attempted multiple inclusion of file.  This warning
245 # is not ignored by the dejagnu framework and cannot be disabled.
246 proc libjava_find_lib {dir name} {
247     global base_dir
248     set gp [get_multilibs]
249     foreach extension {so dll dylib sl a} {
250         foreach sub {.libs _libs} {
251             if {$gp != ""} {
252                 if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
253                     # Just return the `-L' option.  The library itself
254                     # will be picked up via the spec file.
255                     return "-L$gp/$dir/$sub"
256                 }
257             }
258             # Just return the `-L' option.  The library itself will be
259             # picked up via the spec file.
260             set lib [findfile \
261                        $base_dir/../../$dir/$sub/lib${name}.${extension} \
262                        "-L$base_dir/../../$dir/$sub" \
263                        ""]
264             if {$lib != ""} {
265                 return $lib
266             }
267         }
268     }
269     return ""
270 }
271
272 # Find libgcj.spec.  We need to use the file corresponding to the multilib
273 # under test since they might differ.  Append a trailing slash since this
274 # is used with -B.
275 proc libjava_find_spec {} {
276     global objdir
277     return "$objdir/../"
278 }
279
280 # Find `gij'.  Return empty string if not found.
281 proc libjava_find_gij {} {
282     global base_dir objdir
283
284     set gijdir [lookfor_file [get_multilibs] libjava];
285     # Fall back if get_multilibs fails.
286     if {$gijdir == ""} {
287       set gijdir "$objdir/.."
288     }
289     if {! [file exists $gijdir/gij]} {
290         return ""
291     }
292     return $gijdir/gij
293 }
294
295 # Remove a bunch of files.
296 proc gcj_cleanup {args} {
297     foreach file $args {
298         if {[string match *.o $file]} {
299             verbose "removing [file rootname $file].lo"
300             file delete -force [file rootname $file].lo
301         }
302         file delete -force -- $file
303         verbose "removing $file"
304     }
305     # It is simplest to do this instead of trying to figure out what
306     # bits in .libs ought to be removed.
307     catch {system "rm -rf .libs"}
308 }
309
310 # Compute arguments needed for compiler.  MODE is a libtool mode:
311 # either compile or link.
312 proc libjava_arguments {{mode compile}} {
313     global base_dir
314     global LIBJAVA
315     global srcdir subdir objdir
316     global TOOL_OPTIONS
317     global GCJ_UNDER_TEST
318     global tmpdir
319     global runtests
320     global env
321     global tool_root_dir
322     global libgcj_jar
323     global libjava_libgcc_s_path
324     global libjava_ld_library_path
325     global ld_library_path
326     global target_triplet
327
328     if [info exists LIBJAVA] {
329         set libjava $LIBJAVA;
330     } else {
331         set libjava [libjava_find_lib libjava gcj]
332     }
333
334     verbose "using LIBJAVA = $libjava" 2
335     set args ""
336
337     # Basically we want to build up a colon separated path list from
338     # the value of $libjava.
339
340     set lpath "."
341     foreach dir [list $libjava] {
342         foreach item [split $dir " "] {
343             switch -glob -- $item {
344                 "-L*" {
345                     lappend lpath [string range $item 2 end]
346                 }
347             }
348         }
349     }
350
351     set lpath [concat $lpath $libjava_libgcc_s_path]
352     verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
353     set ld_library_path [join $lpath :]
354     set libjava_ld_library_path "$ld_library_path"
355
356     # That's enough to make things work for the normal case.
357     # If we wanted to handle an arbitrary value of libjava,
358     # then we'd have to do a lot more work.
359
360     set_ld_library_path_env_vars
361     if [info exists env(LD_LIBRARY_PATH)] {
362         verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
363     }
364
365     # Determine CLASSPATH separator
366     if { [string match "i?86-pc-mingw32*" $target_triplet] } {
367         set sep ";"
368     } else {
369         set sep ":"
370     }
371
372     # Set the CLASSPATH environment variable
373     global env
374     set env(CLASSPATH) \
375         [join [list . $srcdir/$subdir $objdir $libgcj_jar] $sep]
376     verbose "CLASSPATH is $env(CLASSPATH)"
377
378     # Disable all warnings, as ecj is rather chatty.
379     lappend args "additional_flags=-w"
380
381     if {$mode == "link"} {
382         global wrapper_file wrap_compile_flags
383         lappend args "additional_flags=$wrap_compile_flags"
384
385         if { [regexp "linux" $target_triplet] } {
386             lappend args "additional_flags=-specs=libgcj-test.spec"
387         }
388
389         lappend args "libs=$wrapper_file"
390         lappend args "libs=$libjava"
391         lappend args debug
392     }
393
394     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
395         lappend args "libs=${gluefile}"
396         lappend args "ldflags=$wrap_flags"
397     }
398
399     if [info exists TOOL_OPTIONS] {
400         lappend args "additional_flags=$TOOL_OPTIONS"
401     }
402
403     # Determine libgcj.spec corresponding to multilib under test.
404     set specdir [libjava_find_spec]
405
406     # Search for libtool.  We need it to link.
407     set found_compiler 0
408     set d [absolute $objdir]
409     foreach x {. .. ../.. ../../..} {
410         if {[file exists $d/$x/libtool]} then {
411             # We have to run silently to avoid DejaGNU lossage.
412             lappend args \
413               "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
414             set found_compiler 1
415             break
416         }
417     }
418     if {! $found_compiler} {
419         # Append -B$specdir so that we find libgcj.spec before it
420         # is installed.
421         lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
422     }
423
424     # Avoid libtool wrapper scripts when possible.
425     # but not if libtool warnings results in FAILs
426     if {$mode == "link"} {
427         if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"]
428             && ! [istarget "*-*-darwin*"] } { 
429             lappend args "additional_flags=-no-install"
430         }
431         if { [istarget "*-*-darwin*"] } {
432             lappend args "additional_flags=-bind_at_load"
433             lappend args "additional_flags=-multiply_defined suppress"
434         }
435         if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"] || [istarget "*-*-darwin2*"] } {
436             lappend args "additional_flags=-Wl,-allow_stack_execute"
437         }
438
439     }
440
441     return $args
442 }
443
444 # Link a bunch of objects into a program.  MAIN is the name of the
445 # class holding `main'.  Return 0 on failure.
446 proc gcj_link {program main files {options {}}} {
447     set arguments [libjava_arguments link]
448     if {[llength $options]} {
449         eval lappend arguments $options
450     }
451     lappend arguments "additional_flags=--main=$main"
452     set x [libjava_prune_warnings \
453              [libjava_tcompile $files $program executable $arguments]]
454     if {$x != ""} {
455         verbose "link failure: $x" 2
456         fail "linking $program"
457         setup_xfail "*-*-*"
458         fail "running $program"
459         return 0
460     }
461
462     pass "linking $program"
463     return 1
464 }
465
466 # Invoke the program and see what happens.  Return 0 on failure.
467 proc gcj_invoke {program expectFile ld_library_additions} {
468   global env
469   global libjava_ld_library_path
470   global ld_library_path
471
472   set ld_library_path "$libjava_ld_library_path"
473   if {[llength $ld_library_additions] > 0} {
474     append ld_library_path :[join $ld_library_additions :]
475   }
476
477   set_ld_library_path_env_vars
478   if [info exists env(LD_LIBRARY_PATH)] {
479     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
480   }
481
482   set result [libjava_load ./$program]
483   set status [lindex $result 0]
484   set output [lindex $result 1]
485
486   # Restore setting
487   restore_ld_library_path_env_vars
488
489   if {$status != "pass"} {
490     verbose "got $output"
491     fail "$program run"
492     untested "$program output"
493     return 0
494   }
495
496   set id [open $expectFile r]
497   set expected [read $id]
498   close $id
499
500   if {! [string compare $output $expected]} {
501     pass "$program output"
502     return 1
503   } else {
504     fail "$program output"
505     return 0
506   }
507 }
508
509 proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
510   global env
511   global libjava_ld_library_path
512   global ld_library_path
513
514   set ld_library_path "$libjava_ld_library_path"
515   if {[llength $ld_library_additions] > 0} {
516   append ld_library_path :[join $ld_library_additions :]
517   }
518         
519   set_ld_library_path_env_vars
520   if [info exists env(LD_LIBRARY_PATH)] {
521     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
522   }
523   
524   set gij [libjava_find_gij]
525   set classname [file rootname [file tail $jarfile]]
526   
527   puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $addl_flags $classname"
528         
529   set result [libjava_load $gij "-cp $jarfile $addl_flags $classname"]
530   set status [lindex $result 0]
531   set output [lindex $result 1]
532
533   restore_ld_library_path_env_vars
534
535   if {$status != "pass"} {
536     verbose "got $output"
537     fail "$classname run"
538     untested "$classname output"
539     return 0
540   }
541
542   set id [open $expectFile r]
543   set expected [read $id]
544   close $id
545
546   if {! [string compare $output $expected]} {
547     pass "$classname output"
548     return 1
549   } else {
550     fail "$classname output"
551     return 0
552   }
553 }
554
555 # Invoke a program and check its output.  EXECUTABLE is the program;
556 # ARGS are the arguments to the program.  Returns 1 if tests passed
557 # (or things were left untested), 0 otherwise.
558 proc libjava_invoke {errname testName optName executable inpfile resultfile
559                       ld_library_additions args} {
560     global env
561     global libjava_ld_library_path
562     global ld_library_path
563
564     set ld_library_path "$libjava_ld_library_path"
565     if {[llength $ld_library_additions] > 0} {
566         append ld_library_path :[join $ld_library_additions :]
567     }
568
569     set_ld_library_path_env_vars
570     if [info exists env(LD_LIBRARY_PATH)] {
571         verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
572     }
573
574     upvar $optName opts
575
576     if {[info exists opts(no-exec)]} {
577         if {[info exists opts(need-threads)]} {
578             # This means we wanted to try to run it but we couldn't
579             # because threads aren't supported.  So we have to
580             # generate an `untested'.
581             untested "$errname execution - $testName"
582             untested "$errname output - $testName"
583         }
584         return 1
585     }
586
587     send_log "invoke: $executable $args $inpfile\n"
588
589     set result [libjava_load $executable $args "$inpfile"]
590     set status [lindex $result 0]
591     set output [lindex $result 1]
592
593     # Restore LD_LIBRARY_PATH setting.
594     restore_ld_library_path_env_vars
595
596     if {[info exists opts(xfail-exec)]} then {
597         setup_xfail *-*-*
598     }
599     $status "$errname execution - $testName"
600     if { $status != "pass" } {
601         untested "$errname output - $testName"
602         return 0
603     }
604
605     verbose "resultfile is $resultfile"
606     set id [open $resultfile r]
607     set expected ""
608     append expected [read $id]
609     regsub -all "\r" "$output" "" output
610     regsub "\n*$" $expected "" expected
611     regsub "\n*$" $output "" output
612     regsub "^\n*" $expected "" expected
613     regsub "^\n*" $output "" output
614     regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
615     regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
616     regsub -all "\[ \t\]\[ \t\]*" $output " " output
617     regsub -all "\[ \t\]*\n\n*" $output "\n" output
618     verbose "expected is $expected"
619     verbose "actual is $output"
620     set passed 0
621     if {[info exists opts(regexp_match)]} {
622         if [regexp $expected $output] {
623             set passed 1
624         }
625     } else {
626         if { $expected == $output } {
627             set passed 1
628         }
629     }
630     if {[info exists opts(xfail-output)]} {
631         setup_xfail *-*-*
632     }
633     if { $passed == 1 } {
634         pass "$errname output - $testName"
635     } else {
636         fail "$errname output - $testName"
637     }
638     close $id
639
640     return $passed
641 }
642
643 #
644 # Run the test specified by srcfile and resultfile. compile_args and
645 # exec_args are options telling this proc how to work.
646 #
647 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
648     global base_dir
649     global srcdir subdir objdir
650     global TOOL_OPTIONS
651     global GCJ_UNDER_TEST
652     global tmpdir
653     global runtests
654
655     # Make opts into an array.
656     set opts(_) x
657     unset opts(_)
658     foreach item $exec_args {
659         set opts($item) x
660     }
661
662     # If we need threads and we don't have them then set the `no-exec'
663     # flag.  This is case is also handled specially later.
664     if {[info exists opts(need-threads)]} {
665         global libjava_uses_threads
666         if {! $libjava_uses_threads} {
667             set opts(no-exec) x
668         }
669     }
670
671     set errname [file rootname [file tail $srcfile]]
672     if {! [runtest_file_p $runtests $errname]} {
673         return
674     }
675
676     if {[info exists opts(no-link)]} {
677         set mode compile
678     } else {
679         set mode link
680     }
681     set args [libjava_arguments $mode]
682     if {! [info exists opts(no-link)]} {
683         # Add the --main flag
684         lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
685         if { $compile_args != "" } {
686             lappend args "additional_flags=$compile_args"
687         }
688     }
689
690     regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
691     set executable "${objdir}/$out"
692     if {[info exists opts(no-link)]} {
693         append executable ".o"
694         set target object
695     } else {
696         # DOS/win32 targets default to .exe if no suffix is given
697         # We then try to delete a file that doesn't exist.  It is
698         # simpler to add the suffix everywhere.
699         append executable ".exe"
700         set target executable
701     }
702     if { $compile_args != "" } {
703         set errname "$errname $compile_args"
704     }
705
706     set removeList [list $executable]
707
708     set x [libjava_prune_warnings \
709              [libjava_tcompile $srcfile "$executable" $target $args]]
710     if {[info exists opts(xfail-gcj)]} {
711         setup_xfail *-*-*
712     }
713     if { $x != "" } {
714         verbose "target_compile failed: $x" 2
715
716         if {[info exists opts(shouldfail)]} {
717             pass "$errname compilation from source"
718             eval gcj_cleanup $removeList
719             return
720         }
721
722         fail "$errname compilation from source"
723         if {[info exists opts(xfail-gcj)]
724             || ! [info exists opts(no-exec)]
725             || [info exists opts(need-threads)]} {
726             untested "$errname execution from source compiled test"
727             untested "$errname output from source compiled test"
728         }
729         return
730     }
731     if {[info exists opts(shouldfail)]} {
732         fail "$errname compilation from source"
733         return
734     }
735     pass "$errname compilation from source"
736
737     # Set up the options the way they are expected by libjava_invoke.
738     if {[info exists opts(xfail-source-output)]} {
739         set opts(xfail-output) x
740     }
741     if {[libjava_invoke $errname "source compiled test" opts $executable \
742            $inpfile $resultfile ""]} {
743         # Everything ok, so clean up.
744         eval gcj_cleanup $removeList
745     }
746 }
747
748 #
749 # Run the test specified by srcfile and resultfile. compile_args and
750 # exec_args are options telling this proc how to work.
751 #   `no-link'     don't try to link the program
752 #   `no-exec'     don't try to run the test
753 #   `xfail-gcj'   compilation from source will fail
754 #   `xfail-javac' compilation with javac will fail
755 #   `xfail-gcjC'  compilation with gcj -C will fail
756 #   `shouldfail'  compilation from source is supposed to fail
757 #                 This is different from xfail, which marks a known
758 #                 failure that we just haven't fixed.
759 #                 A compilation marked this way should fail with any
760 #                 front end.
761 #   `xfail-byte'  compilation from bytecode will fail
762 #   `xfail-exec'  exec will fail
763 #   `xfail-output'
764 #                 output will be wrong
765 #   `xfail-byte-output'
766 #                 output will be wrong when compiled from bytecode
767 #   `xfail-source-output'
768 #                 output will be wrong when compiled from source code
769 #   `need-threads'
770 #                 test relies on thread support
771 #
772 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
773     test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
774
775     # Test BC-ABI compilation.
776     set compile_args_bcabi $compile_args
777     lappend compile_args_bcabi "-findirect-dispatch"
778     test_libjava_from_source $options $srcfile $compile_args_bcabi $inpfile $resultfile $exec_args
779 }
780
781 #
782 # libjava_version -- extract and print the version number of libjavap
783 #
784 proc default_libjava_version {} {
785 }
786
787 proc default_libjava_start { } {
788 }
789
790 # Local Variables:
791 # tcl-indent-level:4
792 # End: