1 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
3 load_lib "libgloss.exp"
5 # GCJ_UNDER_TEST is the compiler under test.
9 if ![info exists tmpdir] {
13 # This is like `prune_warnings', but it also prunes away a warning
14 # from the bytecode front end that we don't care about.
15 proc libjava_prune_warnings {text} {
16 set text [prune_warnings $text]
17 set tlist [split $text \n]
18 set len [llength $tlist]
19 for {set i [expr {$len - 1}]} {$i >= 2} {incr i -1} {
20 if {[string match "*unreachable bytecode*" [lindex $tlist $i]]} {
21 # Delete this line, all other unreachable warnings and the previous
22 # two lines containing the method and class.
24 while {[string match "*unreachable bytecode*" [lindex $tlist $j]]} {
28 set tlist [lreplace $tlist $j $i]
32 return [join $tlist \n]
35 # This is like `target_compile' but it does some surgery to work
36 # around stupid DejaGNU bugs. In particular DejaGNU has very poor
37 # quoting, so for instance a `$' will be re-evaluated at spawn time.
39 proc libjava_tcompile {source destfile type options} {
40 # This strange-looking expression really does quote the `$'.
41 regsub -all -- {\$} $source {\$} source
42 regsub -all -- {\$} $destfile {\$} destfile
43 return [target_compile $source $destfile $type $options]
46 # Read an `xfail' file if it exists. Returns a list of xfail tokens.
47 proc libjava_read_xfail {file} {
48 if {! [file exists $file]} {
52 set tokens [string trim [read $fd]]
57 # Find a particular executable. FIXME: this relies on DejaGnu
58 # internals. These should probably be exposed in a better way.
59 proc libjava_find_program {prog} {
62 set file [lookfor_file $tool_root_dir $prog]
64 set file [lookfor_file $tool_root_dir gcc/$prog];
74 return [libjava_find_program jv-scan]
79 return [libjava_find_program gcjh]
83 global SUN_JAVAC GCJ_UNDER_TEST env libgcj_jar
84 # If JDK doesn't run on your platform but some other
85 # JDK-compatible javac does, you may set SUN_JAVAC to point to it.
86 # One of the most important properties of a SUN_JAVAC is that it
87 # must create class-files even for classes that have not been
88 # specified in the command line, but that were needed to compile
89 # those that have. For example, Pizza won't do it, but you can
90 # use `kaffe sun.tools.javac.Main', if you have Sun's classes.zip
91 # in the kaffe's default search path.
92 if {![info exists SUN_JAVAC]} {
93 if {[info exists env(SUN_JAVAC)]} {
94 set SUN_JAVAC $env(SUN_JAVAC)
96 set SUN_JAVAC "$GCJ_UNDER_TEST -C -I$libgcj_jar"
102 proc bytecompile_file { file objdir {classpath {}} } {
104 set dirname [file dirname $file]
106 set javac [find_javac]
107 if {$classpath != ""} then {
108 set env(CLASSPATH) $classpath
112 send_log "byte compile: $javac -g [list $file] -d $objdir 2>@ stdout\n"
114 set q [eval exec "$javac -g [list $file] -d $objdir 2>@ stdout"]
116 send_log "couldn't compile $file: $msg\n"
125 set libjava_initialized 0
128 # Build the status wrapper library as needed.
130 proc libjava_init { args } {
132 global wrap_compile_flags;
133 global libjava_initialized libjava_uses_threads
134 global GCJ_UNDER_TEST
135 global TOOL_EXECUTABLE
136 global original_ld_library_path
138 global env libgcj_jar
140 global libjava_libgcc_s_path
141 global target_triplet
143 # We set LC_ALL and LANG to C so that we get the same error messages as expected.
147 if { $libjava_initialized == 1 } { return; }
149 if ![info exists GCJ_UNDER_TEST] {
150 if [info exists TOOL_EXECUTABLE] {
151 set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
153 if [info exists env(GCJ)] {
154 set GCJ_UNDER_TEST $env(GCJ)
156 set GCJ_UNDER_TEST "[find_gcj]"
161 # Find the libgcj jar file.
162 set libgcj_jar [glob $objdir/../libgcj-*.jar]
163 verbose "jar file is $libgcj_jar"
165 # FIXME: This finds libgcj.spec for the default multilib.
166 # If thread models differ between multilibs, this has to be moved
167 # to libjava_arguments
168 set specdir [libjava_find_spec]
170 # The -B is so we find libgcj.spec.
171 set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
172 regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
173 set libjava_uses_threads [expr {! ($model == "no"
175 || $model == "single")}]
177 # Always set encoding used by gcj.
178 append GCJ_UNDER_TEST " --encoding=UTF-8"
180 if [info exists env(LD_LIBRARY_PATH)] {
181 set original_ld_library_path $env(LD_LIBRARY_PATH)
183 } elseif [info exists env(SHLIB_PATH)] {
184 set original_ld_library_path $env(SHLIB_PATH)
186 } elseif [info exists env(DYLD_LIBRARY_PATH)] {
187 set original_ld_library_path $env(DYLD_LIBRARY_PATH)
188 # For Solaris 32 bit.
189 } elseif [info exists env(LD_LIBRARY_PATH_32)] {
190 set original_ld_library_path $env(LD_LIBRARY_PATH_32)
191 # For Solaris 64 bit.
192 } elseif [info exists env(LD_LIBRARY_PATH_64)] {
193 set original_ld_library_path $env(LD_LIBRARY_PATH_64)
195 set original_ld_library_path ""
199 set wrap_compile_flags "";
200 if [target_info exists needs_status_wrapper] {
201 set result [build_wrapper "testglue.o"];
202 if { $result != "" } {
203 set wrapper_file [lindex $result 0];
204 set wrap_compile_flags [lindex $result 1];
206 warning "Status wrapper failed to build."
210 # Finally, add the gcc build directory so that we can find the
211 # shared libgcc. This, like much of dejagnu, is hideous.
212 set libjava_libgcc_s_path {}
214 if { [string match "powerpc-*-darwin*" $target_triplet] } {
215 set so_extension "dylib"
217 set so_extension "so"
219 set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
221 set gccdir [file dirname $gccdir]
222 lappend libjava_libgcc_s_path $gccdir
223 verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
224 set compiler ${gccdir}/xgcc
225 if { [is_remote host] == 0 && [which $compiler] != 0 } {
226 foreach i "[exec $compiler --print-multi-lib]" {
228 regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
229 set mldir [string trimright $mldir "\;@"]
230 if { "$mldir" == "." } {
233 if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] >= 1 } {
234 lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
240 set libjava_initialized 1
243 # Find a library. We know where libtool puts the actual libraries,
244 # and we look there. The implementation is fairly hacky. We can't
245 # compile with -nodefaultlibs, because that will also eliminate the
246 # system libraries we need. In order to have gcj still work, it must
247 # find the appropriate libraries so we must add -L options for their
248 # paths. However we can't simply use those libraries; we still need
249 # libtool for linking.
250 # Don't return the the lib${name}.la files here, since this causes the
251 # libraries to be linked twice: once as lib${name}.so/dylib and another time
252 # via gcj's implicit -l${name}. This is both unnecessary and causes the
253 # Solaris ld to warn: attempted multiple inclusion of file. This warning
254 # is not ignored by the dejagnu framework and cannot be disabled.
255 proc libjava_find_lib {dir name} {
257 set gp [get_multilibs]
258 foreach extension {so dll a} {
259 foreach sub {.libs _libs} {
261 if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
262 # Just return the `-L' option. The library itself
263 # will be picked up via the spec file.
264 return "-L$gp/$dir/$sub"
267 # Just return the `-L' option. The library itself will be
268 # picked up via the spec file.
270 $base_dir/../../$dir/$sub/lib${name}.${extension} \
271 "-L$base_dir/../../$dir/$sub" \
281 # Find libgcj.spec. We need to use the file corresponding to the multilib
282 # under test since they might differ. Append a trailing slash since this
284 proc libjava_find_spec {} {
286 set gp [get_multilibs]
288 if {[file exists $gp/libjava/libgcj.spec]} then {
289 return "$gp/libjava/"
295 proc libjava_find_gij {} {
297 set gp [get_multilibs]
299 set file $gp/libjava/gij
301 set file $base_dir/../gij
304 if {[file exists $file]} {
310 # Remove a bunch of files.
311 proc gcj_cleanup {args} {
313 if {[string match *.o $file]} {
314 verbose "removing [file rootname $file].lo"
315 file delete -force [file rootname $file].lo
317 file delete -force -- $file
318 verbose "removing $file"
320 # It is simplest to do this instead of trying to figure out what
321 # bits in .libs ought to be removed.
322 catch {system "rm -rf .libs"}
325 # Compute arguments needed for compiler. MODE is a libtool mode:
326 # either compile or link.
327 proc libjava_arguments {{mode compile}} {
330 global srcdir subdir objdir
332 global GCJ_UNDER_TEST
338 global libjava_libgcc_s_path
339 global target_triplet
341 if [info exists LIBJAVA] {
342 set libjava $LIBJAVA;
344 set libjava [libjava_find_lib libjava gcj]
347 verbose "using LIBJAVA = $libjava" 2
350 # Basically we want to build up a colon separated path list from
351 # the value of $libjava.
354 foreach dir [list $libjava] {
355 foreach item [split $dir " "] {
356 switch -glob -- $item {
358 lappend lpath [string range $item 2 end]
364 set lpath [concat $lpath $libjava_libgcc_s_path]
365 verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
366 set ld_library_path [join $lpath :]
368 # That's enough to make things work for the normal case.
369 # If we wanted to handle an arbitrary value of libjava,
370 # then we'd have to do a lot more work.
372 # Set variables the dynamic linker looks at.
373 global original_ld_library_path
374 setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
376 verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
378 # Determine CLASSPATH separator
379 if { [string match "i?86-pc-mingw32*" $target_triplet] } {
385 # Set the CLASSPATH environment variable
388 [join [list . $srcdir/$subdir $objdir $libgcj_jar] $sep]
389 verbose "CLASSPATH is $env(CLASSPATH)"
391 if {$mode == "link"} {
392 global wrapper_file wrap_compile_flags
393 lappend args "additional_flags=$wrap_compile_flags"
394 lappend args "libs=$wrapper_file"
395 lappend args "libs=$libjava"
399 if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
400 lappend args "libs=${gluefile}"
401 lappend args "ldflags=$wrap_flags"
404 if [info exists TOOL_OPTIONS] {
405 lappend args "additional_flags=$TOOL_OPTIONS"
408 # Determine libgcj.spec corresponding to multilib under test.
409 set specdir [libjava_find_spec]
411 # Search for libtool. We need it to link.
413 set d [absolute $objdir]
414 foreach x {. .. ../.. ../../..} {
415 if {[file exists $d/$x/libtool]} then {
416 # We have to run silently to avoid DejaGNU lossage.
418 "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
423 if {! $found_compiler} {
424 # Append -B$specdir so that we find libgcj.spec before it
426 lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
429 # Avoid libtool wrapper scripts when possible.
430 # but not if libtool warnings results in FAILs
431 if {$mode == "link"} {
432 if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
433 lappend args "additional_flags=-no-install"
435 if { [istarget "*-*-darwin*"] } {
436 lappend args "additional_flags=-bind_at_load"
437 lappend args "additional_flags=-multiply_defined suppress"
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
451 lappend arguments "additional_flags=--main=$main"
452 set x [libjava_prune_warnings \
453 [libjava_tcompile $files $program executable $arguments]]
455 verbose "link failure: $x" 2
456 fail "linking $program"
458 fail "running $program"
462 pass "linking $program"
466 # Invoke the program and see what happens. Return 0 on failure.
467 proc gcj_invoke {program expectFile ld_library_additions} {
469 set lib_path $env(LD_LIBRARY_PATH)
472 if {[llength $ld_library_additions] > 0} {
473 append newval :[join $ld_library_additions :]
475 append newval :$lib_path
477 setenv LD_LIBRARY_PATH $newval
479 verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
481 set result [libjava_load ./$program]
482 set status [lindex $result 0]
483 set output [lindex $result 1]
486 setenv LD_LIBRARY_PATH $lib_path
488 if {$status != "pass"} {
489 verbose "got $output"
491 untested "$program output"
495 set id [open $expectFile r]
496 set expected [read $id]
499 if {! [string compare $output $expected]} {
500 pass "$program output"
503 fail "$program output"
508 # Invoke a program and check its output. EXECUTABLE is the program;
509 # ARGS are the arguments to the program. Returns 1 if tests passed
510 # (or things were left untested), 0 otherwise.
511 proc libjava_invoke {errname testName optName executable inpfile resultfile
512 ld_library_additions args} {
514 set lib_path $env(LD_LIBRARY_PATH)
517 if {[llength $ld_library_additions] > 0} {
518 append newval :[join $ld_library_additions :]
521 append newval :$lib_path
523 setenv LD_LIBRARY_PATH $newval
525 verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
528 if {[info exists opts(no-exec)]} {
529 if {[info exists opts(need-threads)]} {
530 # This means we wanted to try to run it but we couldn't
531 # because threads aren't supported. So we have to
532 # generate an `untested'.
533 untested "$errname execution - $testName"
534 untested "$errname output - $testName"
539 set result [libjava_load $executable $args "$inpfile"]
540 set status [lindex $result 0]
541 set output [lindex $result 1]
543 # Restore LD_LIBRARY_PATH setting.
544 setenv LD_LIBRARY_PATH $lib_path
546 if {[info exists opts(xfail-exec)]} then {
549 $status "$errname execution - $testName"
550 if { $status != "pass" } {
551 untested "$errname output - $testName"
555 verbose "resultfile is $resultfile"
556 set id [open $resultfile r]
558 append expected [read $id]
559 regsub -all "\r" "$output" "" output
560 regsub "\n*$" $expected "" expected
561 regsub "\n*$" $output "" output
562 regsub "^\n*" $expected "" expected
563 regsub "^\n*" $output "" output
564 regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
565 regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
566 regsub -all "\[ \t\]\[ \t\]*" $output " " output
567 regsub -all "\[ \t\]*\n\n*" $output "\n" output
568 verbose "expected is $expected"
569 verbose "actual is $output"
571 if {[info exists opts(regexp_match)]} {
572 if [regexp $expected $output] {
576 if { $expected == $output } {
580 if {[info exists opts(xfail-output)]} {
583 if { $passed == 1 } {
584 pass "$errname output - $testName"
586 fail "$errname output - $testName"
594 # Run the test specified by srcfile and resultfile. compile_args and
595 # exec_args are options telling this proc how to work.
597 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
599 global srcdir subdir objdir
601 global GCJ_UNDER_TEST
605 # Make opts into an array.
608 foreach item $exec_args {
612 # If we need threads and we don't have them then set the `no-exec'
613 # flag. This is case is also handled specially later.
614 if {[info exists opts(need-threads)]} {
615 global libjava_uses_threads
616 if {! $libjava_uses_threads} {
621 set errname [file rootname [file tail $srcfile]]
622 if {! [runtest_file_p $runtests $errname]} {
626 if {[info exists opts(no-link)]} {
631 set args [libjava_arguments $mode]
632 if {! [info exists opts(no-link)]} {
633 # Add the --main flag
634 lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
635 if { $compile_args != "" } {
636 lappend args "additional_flags=$compile_args"
640 regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
641 set executable "${objdir}/$out"
642 if {[info exists opts(no-link)]} {
643 append executable ".o"
646 # DOS/win32 targets default to .exe if no suffix is given
647 # We then try to delete a file that doesn't exist. It is
648 # simpler to add the suffix everywhere.
649 append executable ".exe"
650 set target executable
652 if { $compile_args != "" } {
653 set errname "$errname $compile_args"
656 set removeList [list $executable]
658 set x [libjava_prune_warnings \
659 [libjava_tcompile $srcfile "$executable" $target $args]]
660 if {[info exists opts(xfail-gcj)]} {
664 verbose "target_compile failed: $x" 2
666 if {[info exists opts(shouldfail)]} {
667 pass "$errname compilation from source"
668 eval gcj_cleanup $removeList
672 fail "$errname compilation from source"
673 if {[info exists opts(xfail-gcj)]
674 || ! [info exists opts(no-exec)]
675 || [info exists opts(need-threads)]} {
676 untested "$errname execution from source compiled test"
677 untested "$errname output from source compiled test"
681 if {[info exists opts(shouldfail)]} {
682 fail "$errname compilation from source"
685 pass "$errname compilation from source"
687 # Set up the options the way they are expected by libjava_invoke.
688 if {[info exists opts(xfail-source-output)]} {
689 set opts(xfail-output) x
691 if {[libjava_invoke $errname "source compiled test" opts $executable \
692 $inpfile $resultfile ""]} {
693 # Everything ok, so clean up.
694 eval gcj_cleanup $removeList
699 # Run the test specified by srcfile and resultfile. compile_args and
700 # exec_args are options telling this proc how to work.
702 proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile exec_args } {
704 global srcdir subdir objdir
706 global GCJ_UNDER_TEST
711 # Make opts into an array.
714 foreach item $exec_args {
718 # If we need threads and we don't have them then set the `no-exec'
719 # flag. This is case is also handled specially later.
720 if {[info exists opts(need-threads)]} {
721 global libjava_uses_threads
722 if {! $libjava_uses_threads} {
726 set errname [file rootname [file tail $srcfile]]
727 if {! [runtest_file_p $runtests $errname]} {
731 # bytecompile files with Sun's compiler for now.
732 set bc_ok [bytecompile_file $srcfile $objdir]
734 set javac [find_javac]
735 # This is an ugly heuristic but it will have to do.
736 if {[string match *gcj* $javac]} {
741 if {[info exists opts(xfail-$tag)]} {
745 if {[info exists opts(shouldfail)]} {
746 pass "$errname byte compilation"
749 fail "$errname byte compilation"
750 untested "$errname compilation from bytecode"
751 if {! [info exists opts(no-exec)]
752 || [info exists opts(need-threads)]} {
753 untested "$errname execution from bytecode->native test"
754 untested "$errname output from bytecode->native test"
758 if {[info exists opts(shouldfail)]} {
759 fail "$errname byte compilation"
762 pass "$errname byte compilation"
766 # Find name to use for --main, and name of all class files.
767 set jvscan [find_jvscan]
768 verbose "jvscan is $jvscan"
769 set main_name [string trim \
770 [libjava_prune_warnings \
771 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]]
772 verbose "main name is $main_name"
773 set class_out [string trim \
774 [libjava_prune_warnings \
775 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]]
776 verbose "class list is $class_out"
778 if {[string match "*parse error*" $main_name]
779 || [string match "*parse error*" $class_out]} {
780 untested "$errname compilation from bytecode"
781 if {! [info exists opts(no-exec)]
782 || [info exists opts(need-threads)]} {
783 untested "$errname execution from bytecode->native test"
784 untested "$errname output from bytecode->native test"
789 # Turn "a b" into "a.class b.class".
790 # Also, turn "foo.bar" into "foo/bar.class".
792 foreach file [split [string trim $class_out]] {
793 set file [join [split $file .] /]
794 lappend class_files $objdir/$file.class
797 eval lappend removeList $class_files
799 # Usually it is an error for a test program not to have a `main'
800 # method. However, for no-exec tests it is ok. Treat no-link
802 if {[info exists opts(no-link)]} {
807 if {[info exists opts(no-exec)]} {
810 } elseif {$main_name == ""} {
811 perror "No `main' given in program $errname"
815 lappend largs "additional_flags=--main=$main_name"
816 # DOS/win32 targets default to .exe if no suffix is given
817 # We then try to delete a file that doesn't exist. It is
818 # simpler to add the suffix everywhere.
819 set executable "${objdir}/${main_name}.exe"
823 # We purposely ignore errors here; we still want to run the other
825 set gij [libjava_find_gij]
826 # libjava_find_gij will return `gij' if it couldn't find the
827 # program; in this case we want to skip the test.
828 if {$INTERPRETER == "yes" && $gij != "gij"} {
829 libjava_invoke $errname "gij test" opts $gij \
830 $inpfile $resultfile "" $main_name
834 set args [libjava_arguments $mode]
835 eval lappend args $largs
837 if { $compile_args != "" } {
838 lappend args "additional_flags=$compile_args"
841 if { $compile_args != "" } {
842 set errname "$errname $compile_args"
845 verbose "compilation command = $args" 2
846 # When compiling and not linking, we have to build each .o
847 # separately. We do this because DejaGNU's target_compile won't
848 # accept an empty "destfile" argument when the mode is "compile".
849 if {$mode == "compile"} {
850 foreach c_file $class_files {
851 set executable [file rootname [file tail $c_file]].o
852 # Don't write files which contain $ chars.
853 regsub -all "\\$" $executable "\^" executable
854 set x [libjava_prune_warnings \
855 [libjava_tcompile '$c_file' "$executable" $type $args]]
856 lappend removeList $executable
862 # This is so evil: we de-listify CLASS_FILES so that we can
863 # turn around and quote the `$' in it for the shell. I really
864 # hate DejaGNU. It is so !@#$!@# unpredictable.
866 foreach stupid $class_files {
867 set hack "$hack $stupid"
869 lappend removeList $executable
870 set x [libjava_prune_warnings \
871 [libjava_tcompile $hack "$executable" $type $args]]
873 if {[info exists opts(xfail-byte)]} {
877 verbose "target_compile failed: $x" 2
878 fail "$errname compilation from bytecode"
879 if {! [info exists opts(no-exec)]
880 || [info exists opts(need-threads)]} {
881 untested "$errname execution from bytecode->native test"
882 untested "$errname output from bytecode->native test"
886 pass "$errname compilation from bytecode"
888 # Set up the options the way they are expected by libjava_invoke.
889 if {[info exists opts(xfail-byte-output)]} {
890 set opts(xfail-output) x
892 if {[libjava_invoke $errname "bytecode->native test" opts $executable \
893 $inpfile $resultfile ""]} {
894 # Everything ok, so clean up.
895 eval gcj_cleanup $removeList
900 # Run the test specified by srcfile and resultfile. compile_args and
901 # exec_args are options telling this proc how to work.
902 # `no-link' don't try to link the program
903 # `no-exec' don't try to run the test
904 # `xfail-gcj' compilation from source will fail
905 # `xfail-javac' compilation with javac will fail
906 # `xfail-gcjC' compilation with gcj -C will fail
907 # `shouldfail' compilation from source is supposed to fail
908 # This is different from xfail, which marks a known
909 # failure that we just haven't fixed.
910 # A compilation marked this way should fail with any
912 # `xfail-byte' compilation from bytecode will fail
913 # `xfail-exec' exec will fail
915 # output will be wrong
916 # `xfail-byte-output'
917 # output will be wrong when compiled from bytecode
918 # `xfail-source-output'
919 # output will be wrong when compiled from source code
921 # test relies on thread support
923 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
924 test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
925 test_libjava_from_javac $options $srcfile $compile_args $inpfile $resultfile $exec_args
929 # libjava_version -- extract and print the version number of libjavap
931 proc default_libjava_version {} {
934 proc default_libjava_start { } {
937 # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
938 # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
939 # (for the 64-bit ABI). The right way to do this would be to modify
940 # unix.exp -- but that's not an option since it's part of DejaGNU
941 # proper, so we do it here, by trickery.
942 # The same applies to darwin (DYLD_LIBRARY_PATH), solaris 32 bit
943 # (LD_LIBRARY_PATH_32), solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
945 proc ${tool}_set_ld_library_path { name element op } {
946 setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
947 setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
948 setenv SHLIB_PATH [getenv LD_LIBRARY_PATH]
949 setenv DYLD_LIBRARY_PATH [getenv LD_LIBRARY_PATH]
950 setenv LD_LIBRARY_PATH_32 [getenv LD_LIBRARY_PATH]
951 setenv LD_LIBRARY_PATH_64 [getenv LD_LIBRARY_PATH]
954 trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path