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 if { $libjava_initialized == 1 } { return; }
145 if ![info exists GCJ_UNDER_TEST] {
146 if [info exists TOOL_EXECUTABLE] {
147 set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
149 if [info exists env(GCJ)] {
150 set GCJ_UNDER_TEST $env(GCJ)
152 set GCJ_UNDER_TEST "[find_gcj]"
157 # Find the libgcj jar file.
158 set libgcj_jar [glob $objdir/../libgcj-*.jar]
159 verbose "jar file is $libgcj_jar"
161 # FIXME: This finds libgcj.spec for the default multilib.
162 # If thread models differ between multilibs, this has to be moved
163 # to libjava_arguments
164 set specdir [libjava_find_spec]
166 # The -B is so we find libgcj.spec.
167 set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
168 regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
169 set libjava_uses_threads [expr {! ($model == "no"
171 || $model == "single")}]
173 # Always set encoding used by gcj.
174 append GCJ_UNDER_TEST " --encoding=UTF-8"
176 if [info exists env(LD_LIBRARY_PATH)] {
177 set original_ld_library_path $env(LD_LIBRARY_PATH)
179 } elseif [info exists env(SHLIB_PATH)] {
180 set original_ld_library_path $env(SHLIB_PATH)
182 } elseif [info exists env(DYLD_LIBRARY_PATH)] {
183 set original_ld_library_path $env(DYLD_LIBRARY_PATH)
184 # For Solaris 32 bit.
185 } elseif [info exists env(LD_LIBRARY_PATH_32)] {
186 set original_ld_library_path $env(LD_LIBRARY_PATH_32)
187 # For Solaris 64 bit.
188 } elseif [info exists env(LD_LIBRARY_PATH_64)] {
189 set original_ld_library_path $env(LD_LIBRARY_PATH_64)
191 set original_ld_library_path ""
195 set wrap_compile_flags "";
196 if [target_info exists needs_status_wrapper] {
197 set result [build_wrapper "testglue.o"];
198 if { $result != "" } {
199 set wrapper_file [lindex $result 0];
200 set wrap_compile_flags [lindex $result 1];
202 warning "Status wrapper failed to build."
206 # Finally, add the gcc build directory so that we can find the
207 # shared libgcc. This, like much of dejagnu, is hideous.
208 set libjava_libgcc_s_path {}
210 if { [string match "powerpc-*-darwin*" $target_triplet] } {
211 set so_extension "dylib"
213 set so_extension "so"
215 set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
217 set gccdir [file dirname $gccdir]
218 lappend libjava_libgcc_s_path $gccdir
219 verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
220 set compiler ${gccdir}/xgcc
221 if { [is_remote host] == 0 && [which $compiler] != 0 } {
222 foreach i "[exec $compiler --print-multi-lib]" {
224 regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
225 set mldir [string trimright $mldir "\;@"]
226 if { "$mldir" == "." } {
229 if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] >= 1 } {
230 lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
236 set libjava_initialized 1
239 # Find a library. We know where libtool puts the actual libraries,
240 # and we look there. The implementation is fairly hacky. We can't
241 # compile with -nodefaultlibs, because that will also eliminate the
242 # system libraries we need. In order to have gcj still work, it must
243 # find the appropriate libraries so we must add -L options for their
244 # paths. However we can't simply use those libraries; we still need
245 # libtool for linking.
246 # Don't return the the lib${name}.la files here, since this causes the
247 # libraries to be linked twice: once as lib${name}.so/dylib and another time
248 # via gcj's implicit -l${name}. This is both unnecessary and causes the
249 # Solaris ld to warn: attempted multiple inclusion of file. This warning
250 # is not ignored by the dejagnu framework and cannot be disabled.
251 proc libjava_find_lib {dir name} {
253 set gp [get_multilibs]
254 foreach extension {so dll a} {
255 foreach sub {.libs _libs} {
257 if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
258 # Just return the `-L' option. The library itself
259 # will be picked up via the spec file.
260 return "-L$gp/$dir/$sub"
263 # Just return the `-L' option. The library itself will be
264 # picked up via the spec file.
266 $base_dir/../../$dir/$sub/lib${name}.${extension} \
267 "-L$base_dir/../../$dir/$sub" \
277 # Find libgcj.spec. We need to use the file corresponding to the multilib
278 # under test since they might differ. Append a trailing slash since this
280 proc libjava_find_spec {} {
282 set gp [get_multilibs]
284 if {[file exists $gp/libjava/libgcj.spec]} then {
285 return "$gp/libjava/"
291 proc libjava_find_gij {} {
293 set gp [get_multilibs]
295 set file $gp/libjava/gij
297 set file $base_dir/../gij
300 if {[file exists $file]} {
306 # Remove a bunch of files.
307 proc gcj_cleanup {args} {
309 if {[string match *.o $file]} {
310 verbose "removing [file rootname $file].lo"
311 file delete -force [file rootname $file].lo
313 file delete -force -- $file
314 verbose "removing $file"
316 # It is simplest to do this instead of trying to figure out what
317 # bits in .libs ought to be removed.
318 catch {system "rm -rf .libs"}
321 # Compute arguments needed for compiler. MODE is a libtool mode:
322 # either compile or link.
323 proc libjava_arguments {{mode compile}} {
326 global srcdir subdir objdir
328 global GCJ_UNDER_TEST
334 global libjava_libgcc_s_path
336 if [info exists LIBJAVA] {
337 set libjava $LIBJAVA;
339 set libjava [libjava_find_lib libjava gcj]
342 verbose "using LIBJAVA = $libjava" 2
345 # Basically we want to build up a colon separated path list from
346 # the value of $libjava.
349 foreach dir [list $libjava] {
350 foreach item [split $dir " "] {
351 switch -glob -- $item {
353 lappend lpath [string range $item 2 end]
359 set lpath [concat $lpath $libjava_libgcc_s_path]
360 verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
361 set ld_library_path [join $lpath :]
363 # That's enough to make things work for the normal case.
364 # If we wanted to handle an arbitrary value of libjava,
365 # then we'd have to do a lot more work.
367 # Set variables the dynamic linker looks at.
368 global original_ld_library_path
369 setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
371 verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
373 # Set the CLASSPATH environment variable
374 verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$libgcj_jar"
376 set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$libgcj_jar"
378 if {$mode == "link"} {
379 global wrapper_file wrap_compile_flags
380 lappend args "additional_flags=$wrap_compile_flags"
381 lappend args "libs=$wrapper_file"
382 lappend args "libs=$libjava"
386 if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
387 lappend args "libs=${gluefile}"
388 lappend args "ldflags=$wrap_flags"
391 if [info exists TOOL_OPTIONS] {
392 lappend args "additional_flags=$TOOL_OPTIONS"
395 # Determine libgcj.spec corresponding to multilib under test.
396 set specdir [libjava_find_spec]
398 # Search for libtool. We need it to link.
400 set d [absolute $objdir]
401 foreach x {. .. ../.. ../../..} {
402 if {[file exists $d/$x/libtool]} then {
403 # We have to run silently to avoid DejaGNU lossage.
405 "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
410 if {! $found_compiler} {
411 # Append -B$specdir so that we find libgcj.spec before it
413 lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
416 # Avoid libtool wrapper scripts when possible.
417 # but not if libtool warnings results in FAILs
418 if {$mode == "link"} {
419 if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
420 lappend args "additional_flags=-no-install"
422 if { [istarget "*-*-darwin*"] } {
423 lappend args "additional_flags=-bind_at_load"
424 lappend args "additional_flags=-multiply_defined suppress"
431 # Link a bunch of objects into a program. MAIN is the name of the
432 # class holding `main'. Return 0 on failure.
433 proc gcj_link {program main files {options {}}} {
434 set arguments [libjava_arguments link]
435 if {[llength $options]} {
436 eval lappend arguments $options
438 lappend arguments "additional_flags=--main=$main"
439 set x [libjava_prune_warnings \
440 [libjava_tcompile $files $program executable $arguments]]
442 verbose "link failure: $x" 2
443 fail "linking $program"
445 fail "running $program"
449 pass "linking $program"
453 # Invoke the program and see what happens. Return 0 on failure.
454 proc gcj_invoke {program expectFile ld_library_additions} {
456 set lib_path $env(LD_LIBRARY_PATH)
459 if {[llength $ld_library_additions] > 0} {
460 append newval :[join $ld_library_additions :]
462 append newval :$lib_path
464 setenv LD_LIBRARY_PATH $newval
466 verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
468 set result [libjava_load ./$program]
469 set status [lindex $result 0]
470 set output [lindex $result 1]
473 setenv LD_LIBRARY_PATH $lib_path
475 if {$status != "pass"} {
476 verbose "got $output"
478 untested "$program output"
482 set id [open $expectFile r]
483 set expected [read $id]
486 if {! [string compare $output $expected]} {
487 pass "$program output"
490 fail "$program output"
495 # Invoke a program and check its output. EXECUTABLE is the program;
496 # ARGS are the arguments to the program. Returns 1 if tests passed
497 # (or things were left untested), 0 otherwise.
498 proc libjava_invoke {errname testName optName executable inpfile resultfile
499 ld_library_additions args} {
501 set lib_path $env(LD_LIBRARY_PATH)
504 if {[llength $ld_library_additions] > 0} {
505 append newval :[join $ld_library_additions :]
508 append newval :$lib_path
510 setenv LD_LIBRARY_PATH $newval
512 verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
515 if {[info exists opts(no-exec)]} {
516 if {[info exists opts(need-threads)]} {
517 # This means we wanted to try to run it but we couldn't
518 # because threads aren't supported. So we have to
519 # generate an `untested'.
520 untested "$errname execution - $testName"
521 untested "$errname output - $testName"
526 set result [libjava_load $executable $args "$inpfile"]
527 set status [lindex $result 0]
528 set output [lindex $result 1]
530 # Restore LD_LIBRARY_PATH setting.
531 setenv LD_LIBRARY_PATH $lib_path
533 if {[info exists opts(xfail-exec)]} then {
536 $status "$errname execution - $testName"
537 if { $status != "pass" } {
538 untested "$errname output - $testName"
542 verbose "resultfile is $resultfile"
543 set id [open $resultfile r]
545 append expected [read $id]
546 regsub -all "\r" "$output" "" output
547 regsub "\n*$" $expected "" expected
548 regsub "\n*$" $output "" output
549 regsub "^\n*" $expected "" expected
550 regsub "^\n*" $output "" output
551 regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
552 regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
553 regsub -all "\[ \t\]\[ \t\]*" $output " " output
554 regsub -all "\[ \t\]*\n\n*" $output "\n" output
555 verbose "expected is $expected"
556 verbose "actual is $output"
558 if {[info exists opts(regexp_match)]} {
559 if [regexp $expected $output] {
563 if { $expected == $output } {
567 if {[info exists opts(xfail-output)]} {
570 if { $passed == 1 } {
571 pass "$errname output - $testName"
573 fail "$errname output - $testName"
581 # Run the test specified by srcfile and resultfile. compile_args and
582 # exec_args are options telling this proc how to work.
584 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
586 global srcdir subdir objdir
588 global GCJ_UNDER_TEST
592 # Make opts into an array.
595 foreach item $exec_args {
599 # If we need threads and we don't have them then set the `no-exec'
600 # flag. This is case is also handled specially later.
601 if {[info exists opts(need-threads)]} {
602 global libjava_uses_threads
603 if {! $libjava_uses_threads} {
608 set errname [file rootname [file tail $srcfile]]
609 if {! [runtest_file_p $runtests $errname]} {
613 if {[info exists opts(no-link)]} {
618 set args [libjava_arguments $mode]
619 if {! [info exists opts(no-link)]} {
620 # Add the --main flag
621 lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
622 if { $compile_args != "" } {
623 lappend args "additional_flags=$compile_args"
627 regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
628 set executable "${objdir}/$out"
629 if {[info exists opts(no-link)]} {
630 append executable ".o"
633 # DOS/win32 targets default to .exe if no suffix is given
634 # We then try to delete a file that doesn't exist. It is
635 # simpler to add the suffix everywhere.
636 append executable ".exe"
637 set target executable
639 if { $compile_args != "" } {
640 set errname "$errname $compile_args"
643 set removeList [list $executable]
645 set x [libjava_prune_warnings \
646 [libjava_tcompile $srcfile "$executable" $target $args]]
647 if {[info exists opts(xfail-gcj)]} {
651 verbose "target_compile failed: $x" 2
653 if {[info exists opts(shouldfail)]} {
654 pass "$errname compilation from source"
655 eval gcj_cleanup $removeList
659 fail "$errname compilation from source"
660 if {[info exists opts(xfail-gcj)]
661 || ! [info exists opts(no-exec)]
662 || [info exists opts(need-threads)]} {
663 untested "$errname execution from source compiled test"
664 untested "$errname output from source compiled test"
668 if {[info exists opts(shouldfail)]} {
669 fail "$errname compilation from source"
672 pass "$errname compilation from source"
674 # Set up the options the way they are expected by libjava_invoke.
675 if {[info exists opts(xfail-source-output)]} {
676 set opts(xfail-output) x
678 if {[libjava_invoke $errname "source compiled test" opts $executable \
679 $inpfile $resultfile ""]} {
680 # Everything ok, so clean up.
681 eval gcj_cleanup $removeList
686 # Run the test specified by srcfile and resultfile. compile_args and
687 # exec_args are options telling this proc how to work.
689 proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile exec_args } {
691 global srcdir subdir objdir
693 global GCJ_UNDER_TEST
698 # Make opts into an array.
701 foreach item $exec_args {
705 # If we need threads and we don't have them then set the `no-exec'
706 # flag. This is case is also handled specially later.
707 if {[info exists opts(need-threads)]} {
708 global libjava_uses_threads
709 if {! $libjava_uses_threads} {
713 set errname [file rootname [file tail $srcfile]]
714 if {! [runtest_file_p $runtests $errname]} {
718 # bytecompile files with Sun's compiler for now.
719 set bc_ok [bytecompile_file $srcfile $objdir]
721 set javac [find_javac]
722 # This is an ugly heuristic but it will have to do.
723 if {[string match *gcj* $javac]} {
728 if {[info exists opts(xfail-$tag)]} {
732 if {[info exists opts(shouldfail)]} {
733 pass "$errname byte compilation"
736 fail "$errname byte compilation"
737 untested "$errname compilation from bytecode"
738 if {! [info exists opts(no-exec)]
739 || [info exists opts(need-threads)]} {
740 untested "$errname execution from bytecode->native test"
741 untested "$errname output from bytecode->native test"
745 if {[info exists opts(shouldfail)]} {
746 fail "$errname byte compilation"
749 pass "$errname byte compilation"
753 # Find name to use for --main, and name of all class files.
754 set jvscan [find_jvscan]
755 verbose "jvscan is $jvscan"
756 set main_name [string trim \
757 [libjava_prune_warnings \
758 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]]
759 verbose "main name is $main_name"
760 set class_out [string trim \
761 [libjava_prune_warnings \
762 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]]
763 verbose "class list is $class_out"
765 if {[string match "*parse error*" $main_name]
766 || [string match "*parse error*" $class_out]} {
767 untested "$errname compilation from bytecode"
768 if {! [info exists opts(no-exec)]
769 || [info exists opts(need-threads)]} {
770 untested "$errname execution from bytecode->native test"
771 untested "$errname output from bytecode->native test"
776 # Turn "a b" into "a.class b.class".
777 # Also, turn "foo.bar" into "foo/bar.class".
779 foreach file [split [string trim $class_out]] {
780 set file [join [split $file .] /]
781 lappend class_files $objdir/$file.class
784 eval lappend removeList $class_files
786 # Usually it is an error for a test program not to have a `main'
787 # method. However, for no-exec tests it is ok. Treat no-link
789 if {[info exists opts(no-link)]} {
794 if {[info exists opts(no-exec)]} {
797 } elseif {$main_name == ""} {
798 perror "No `main' given in program $errname"
802 lappend largs "additional_flags=--main=$main_name"
803 # DOS/win32 targets default to .exe if no suffix is given
804 # We then try to delete a file that doesn't exist. It is
805 # simpler to add the suffix everywhere.
806 set executable "${objdir}/${main_name}.exe"
810 # We purposely ignore errors here; we still want to run the other
812 set gij [libjava_find_gij]
813 # libjava_find_gij will return `gij' if it couldn't find the
814 # program; in this case we want to skip the test.
815 if {$INTERPRETER == "yes" && $gij != "gij"} {
816 libjava_invoke $errname "gij test" opts $gij \
817 $inpfile $resultfile "" $main_name
821 set args [libjava_arguments $mode]
822 eval lappend args $largs
824 if { $compile_args != "" } {
825 lappend args "additional_flags=$compile_args"
828 if { $compile_args != "" } {
829 set errname "$errname $compile_args"
832 verbose "compilation command = $args" 2
833 # When compiling and not linking, we have to build each .o
834 # separately. We do this because DejaGNU's target_compile won't
835 # accept an empty "destfile" argument when the mode is "compile".
836 if {$mode == "compile"} {
837 foreach c_file $class_files {
838 set executable [file rootname [file tail $c_file]].o
839 # Don't write files which contain $ chars.
840 regsub -all "\\$" $executable "\^" executable
841 set x [libjava_prune_warnings \
842 [libjava_tcompile '$c_file' "$executable" $type $args]]
843 lappend removeList $executable
849 # This is so evil: we de-listify CLASS_FILES so that we can
850 # turn around and quote the `$' in it for the shell. I really
851 # hate DejaGNU. It is so !@#$!@# unpredictable.
853 foreach stupid $class_files {
854 set hack "$hack $stupid"
856 lappend removeList $executable
857 set x [libjava_prune_warnings \
858 [libjava_tcompile $hack "$executable" $type $args]]
860 if {[info exists opts(xfail-byte)]} {
864 verbose "target_compile failed: $x" 2
865 fail "$errname compilation from bytecode"
866 if {! [info exists opts(no-exec)]
867 || [info exists opts(need-threads)]} {
868 untested "$errname execution from bytecode->native test"
869 untested "$errname output from bytecode->native test"
873 pass "$errname compilation from bytecode"
875 # Set up the options the way they are expected by libjava_invoke.
876 if {[info exists opts(xfail-byte-output)]} {
877 set opts(xfail-output) x
879 if {[libjava_invoke $errname "bytecode->native test" opts $executable \
880 $inpfile $resultfile ""]} {
881 # Everything ok, so clean up.
882 eval gcj_cleanup $removeList
887 # Run the test specified by srcfile and resultfile. compile_args and
888 # exec_args are options telling this proc how to work.
889 # `no-link' don't try to link the program
890 # `no-exec' don't try to run the test
891 # `xfail-gcj' compilation from source will fail
892 # `xfail-javac' compilation with javac will fail
893 # `xfail-gcjC' compilation with gcj -C will fail
894 # `shouldfail' compilation from source is supposed to fail
895 # This is different from xfail, which marks a known
896 # failure that we just haven't fixed.
897 # A compilation marked this way should fail with any
899 # `xfail-byte' compilation from bytecode will fail
900 # `xfail-exec' exec will fail
902 # output will be wrong
903 # `xfail-byte-output'
904 # output will be wrong when compiled from bytecode
905 # `xfail-source-output'
906 # output will be wrong when compiled from source code
908 # test relies on thread support
910 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
911 test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
912 test_libjava_from_javac $options $srcfile $compile_args $inpfile $resultfile $exec_args
916 # libjava_version -- extract and print the version number of libjavap
918 proc default_libjava_version {} {
921 proc default_libjava_start { } {
924 # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
925 # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
926 # (for the 64-bit ABI). The right way to do this would be to modify
927 # unix.exp -- but that's not an option since it's part of DejaGNU
928 # proper, so we do it here, by trickery.
929 # The same applies to darwin (DYLD_LIBRARY_PATH), solaris 32 bit
930 # (LD_LIBRARY_PATH_32), solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
932 proc ${tool}_set_ld_library_path { name element op } {
933 setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
934 setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
935 setenv SHLIB_PATH [getenv LD_LIBRARY_PATH]
936 setenv DYLD_LIBRARY_PATH [getenv LD_LIBRARY_PATH]
937 setenv LD_LIBRARY_PATH_32 [getenv LD_LIBRARY_PATH]
938 setenv LD_LIBRARY_PATH_64 [getenv LD_LIBRARY_PATH]
941 trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path