OSDN Git Service

2007-12-08 Andreas Tobler <a.tobler@schweiz.org>
[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 { [string match "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             lappend args "additional_flags=-no-install"
427         }
428         if { [istarget "*-*-darwin*"] } {
429             lappend args "additional_flags=-bind_at_load"
430             lappend args "additional_flags=-multiply_defined suppress"
431         }
432         if { [istarget "*-*-darwin9*"] } {
433             lappend args "additional_flags=-Wl,-allow_stack_execute"
434         }
435
436     }
437
438     return $args
439 }
440
441 # Link a bunch of objects into a program.  MAIN is the name of the
442 # class holding `main'.  Return 0 on failure.
443 proc gcj_link {program main files {options {}}} {
444     set arguments [libjava_arguments link]
445     if {[llength $options]} {
446         eval lappend arguments $options
447     }
448     lappend arguments "additional_flags=--main=$main"
449     set x [libjava_prune_warnings \
450              [libjava_tcompile $files $program executable $arguments]]
451     if {$x != ""} {
452         verbose "link failure: $x" 2
453         fail "linking $program"
454         setup_xfail "*-*-*"
455         fail "running $program"
456         return 0
457     }
458
459     pass "linking $program"
460     return 1
461 }
462
463 # Invoke the program and see what happens.  Return 0 on failure.
464 proc gcj_invoke {program expectFile ld_library_additions} {
465   global env
466   global libjava_ld_library_path
467   global ld_library_path
468
469   set ld_library_path "$libjava_ld_library_path"
470   if {[llength $ld_library_additions] > 0} {
471     append ld_library_path :[join $ld_library_additions :]
472   }
473
474   set_ld_library_path_env_vars
475   if [info exists env(LD_LIBRARY_PATH)] {
476     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
477   }
478
479   set result [libjava_load ./$program]
480   set status [lindex $result 0]
481   set output [lindex $result 1]
482
483   # Restore setting
484   restore_ld_library_path_env_vars
485
486   if {$status != "pass"} {
487     verbose "got $output"
488     fail "$program run"
489     untested "$program output"
490     return 0
491   }
492
493   set id [open $expectFile r]
494   set expected [read $id]
495   close $id
496
497   if {! [string compare $output $expected]} {
498     pass "$program output"
499     return 1
500   } else {
501     fail "$program output"
502     return 0
503   }
504 }
505
506 proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
507   global env
508   global libjava_ld_library_path
509   global ld_library_path
510
511   set ld_library_path "$libjava_ld_library_path"
512   if {[llength $ld_library_additions] > 0} {
513   append ld_library_path :[join $ld_library_additions :]
514   }
515         
516   set_ld_library_path_env_vars
517   if [info exists env(LD_LIBRARY_PATH)] {
518     verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
519   }
520   
521   set gij [libjava_find_gij]
522   set classname [file rootname [file tail $jarfile]]
523   
524   puts "LD_LIBRARY_PATH=. $gij -cp $jarfile $addl_flags $classname"
525         
526   set result [libjava_load $gij "-cp $jarfile $addl_flags $classname"]
527   set status [lindex $result 0]
528   set output [lindex $result 1]
529
530   restore_ld_library_path_env_vars
531
532   if {$status != "pass"} {
533     verbose "got $output"
534     fail "$classname run"
535     untested "$classname output"
536     return 0
537   }
538
539   set id [open $expectFile r]
540   set expected [read $id]
541   close $id
542
543   if {! [string compare $output $expected]} {
544     pass "$classname output"
545     return 1
546   } else {
547     fail "$classname output"
548     return 0
549   }
550 }
551
552 # Invoke a program and check its output.  EXECUTABLE is the program;
553 # ARGS are the arguments to the program.  Returns 1 if tests passed
554 # (or things were left untested), 0 otherwise.
555 proc libjava_invoke {errname testName optName executable inpfile resultfile
556                       ld_library_additions args} {
557     global env
558     global libjava_ld_library_path
559     global ld_library_path
560
561     set ld_library_path "$libjava_ld_library_path"
562     if {[llength $ld_library_additions] > 0} {
563         append ld_library_path :[join $ld_library_additions :]
564     }
565
566     set_ld_library_path_env_vars
567     if [info exists env(LD_LIBRARY_PATH)] {
568         verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
569     }
570
571     upvar $optName opts
572
573     if {[info exists opts(no-exec)]} {
574         if {[info exists opts(need-threads)]} {
575             # This means we wanted to try to run it but we couldn't
576             # because threads aren't supported.  So we have to
577             # generate an `untested'.
578             untested "$errname execution - $testName"
579             untested "$errname output - $testName"
580         }
581         return 1
582     }
583
584     send_log "invoke: $executable $args $inpfile\n"
585
586     set result [libjava_load $executable $args "$inpfile"]
587     set status [lindex $result 0]
588     set output [lindex $result 1]
589
590     # Restore LD_LIBRARY_PATH setting.
591     restore_ld_library_path_env_vars
592
593     if {[info exists opts(xfail-exec)]} then {
594         setup_xfail *-*-*
595     }
596     $status "$errname execution - $testName"
597     if { $status != "pass" } {
598         untested "$errname output - $testName"
599         return 0
600     }
601
602     verbose "resultfile is $resultfile"
603     set id [open $resultfile r]
604     set expected ""
605     append expected [read $id]
606     regsub -all "\r" "$output" "" output
607     regsub "\n*$" $expected "" expected
608     regsub "\n*$" $output "" output
609     regsub "^\n*" $expected "" expected
610     regsub "^\n*" $output "" output
611     regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
612     regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
613     regsub -all "\[ \t\]\[ \t\]*" $output " " output
614     regsub -all "\[ \t\]*\n\n*" $output "\n" output
615     verbose "expected is $expected"
616     verbose "actual is $output"
617     set passed 0
618     if {[info exists opts(regexp_match)]} {
619         if [regexp $expected $output] {
620             set passed 1
621         }
622     } else {
623         if { $expected == $output } {
624             set passed 1
625         }
626     }
627     if {[info exists opts(xfail-output)]} {
628         setup_xfail *-*-*
629     }
630     if { $passed == 1 } {
631         pass "$errname output - $testName"
632     } else {
633         fail "$errname output - $testName"
634     }
635     close $id
636
637     return $passed
638 }
639
640 #
641 # Run the test specified by srcfile and resultfile. compile_args and
642 # exec_args are options telling this proc how to work.
643 #
644 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
645     global base_dir
646     global srcdir subdir objdir
647     global TOOL_OPTIONS
648     global GCJ_UNDER_TEST
649     global tmpdir
650     global runtests
651
652     # Make opts into an array.
653     set opts(_) x
654     unset opts(_)
655     foreach item $exec_args {
656         set opts($item) x
657     }
658
659     # If we need threads and we don't have them then set the `no-exec'
660     # flag.  This is case is also handled specially later.
661     if {[info exists opts(need-threads)]} {
662         global libjava_uses_threads
663         if {! $libjava_uses_threads} {
664             set opts(no-exec) x
665         }
666     }
667
668     set errname [file rootname [file tail $srcfile]]
669     if {! [runtest_file_p $runtests $errname]} {
670         return
671     }
672
673     if {[info exists opts(no-link)]} {
674         set mode compile
675     } else {
676         set mode link
677     }
678     set args [libjava_arguments $mode]
679     if {! [info exists opts(no-link)]} {
680         # Add the --main flag
681         lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
682         if { $compile_args != "" } {
683             lappend args "additional_flags=$compile_args"
684         }
685     }
686
687     regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
688     set executable "${objdir}/$out"
689     if {[info exists opts(no-link)]} {
690         append executable ".o"
691         set target object
692     } else {
693         # DOS/win32 targets default to .exe if no suffix is given
694         # We then try to delete a file that doesn't exist.  It is
695         # simpler to add the suffix everywhere.
696         append executable ".exe"
697         set target executable
698     }
699     if { $compile_args != "" } {
700         set errname "$errname $compile_args"
701     }
702
703     set removeList [list $executable]
704
705     set x [libjava_prune_warnings \
706              [libjava_tcompile $srcfile "$executable" $target $args]]
707     if {[info exists opts(xfail-gcj)]} {
708         setup_xfail *-*-*
709     }
710     if { $x != "" } {
711         verbose "target_compile failed: $x" 2
712
713         if {[info exists opts(shouldfail)]} {
714             pass "$errname compilation from source"
715             eval gcj_cleanup $removeList
716             return
717         }
718
719         fail "$errname compilation from source"
720         if {[info exists opts(xfail-gcj)]
721             || ! [info exists opts(no-exec)]
722             || [info exists opts(need-threads)]} {
723             untested "$errname execution from source compiled test"
724             untested "$errname output from source compiled test"
725         }
726         return
727     }
728     if {[info exists opts(shouldfail)]} {
729         fail "$errname compilation from source"
730         return
731     }
732     pass "$errname compilation from source"
733
734     # Set up the options the way they are expected by libjava_invoke.
735     if {[info exists opts(xfail-source-output)]} {
736         set opts(xfail-output) x
737     }
738     if {[libjava_invoke $errname "source compiled test" opts $executable \
739            $inpfile $resultfile ""]} {
740         # Everything ok, so clean up.
741         eval gcj_cleanup $removeList
742     }
743 }
744
745 #
746 # Run the test specified by srcfile and resultfile. compile_args and
747 # exec_args are options telling this proc how to work.
748 #   `no-link'     don't try to link the program
749 #   `no-exec'     don't try to run the test
750 #   `xfail-gcj'   compilation from source will fail
751 #   `xfail-javac' compilation with javac will fail
752 #   `xfail-gcjC'  compilation with gcj -C will fail
753 #   `shouldfail'  compilation from source is supposed to fail
754 #                 This is different from xfail, which marks a known
755 #                 failure that we just haven't fixed.
756 #                 A compilation marked this way should fail with any
757 #                 front end.
758 #   `xfail-byte'  compilation from bytecode will fail
759 #   `xfail-exec'  exec will fail
760 #   `xfail-output'
761 #                 output will be wrong
762 #   `xfail-byte-output'
763 #                 output will be wrong when compiled from bytecode
764 #   `xfail-source-output'
765 #                 output will be wrong when compiled from source code
766 #   `need-threads'
767 #                 test relies on thread support
768 #
769 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
770     test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
771
772     # Test BC-ABI compilation.
773     set compile_args_bcabi $compile_args
774     lappend compile_args_bcabi "-findirect-dispatch"
775     test_libjava_from_source $options $srcfile $compile_args_bcabi $inpfile $resultfile $exec_args
776 }
777
778 #
779 # libjava_version -- extract and print the version number of libjavap
780 #
781 proc default_libjava_version {} {
782 }
783
784 proc default_libjava_start { } {
785 }
786
787 # Local Variables:
788 # tcl-indent-level:4
789 # End: