2011-02-16 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / fortran.exp
blob87db855ba607522fafaac05218d3f6e00ce0d64c
1 load_lib libgomp-dg.exp
3 global shlib_ext
4 global ALWAYS_CFLAGS
6 set shlib_ext [get_shlib_extension]
7 set lang_library_path "../libgfortran/.libs"
8 set lang_link_flags "-lgfortran"
9 set lang_test_file_found 0
10 set quadmath_library_path "../libquadmath/.libs"
13 # Initialize dg.
14 dg-init
16 if { $blddir != "" } {
17 # Look for a static libgfortran first.
18 if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
19 set lang_test_file "${lang_library_path}/libgfortran.a"
20 set lang_test_file_found 1
21 # We may have a shared only build, so look for a shared libgfortran.
22 } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
23 set lang_test_file "${lang_library_path}/libgfortran.${shlib_ext}"
24 set lang_test_file_found 1
25 } else {
26 puts "No libgfortran library found, will not execute fortran tests"
28 } elseif [info exists GFORTRAN_UNDER_TEST] {
29 set lang_test_file_found 1
30 # Needs to exist for libgomp.exp.
31 set lang_test_file ""
32 } else {
33 puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
36 if { $lang_test_file_found } {
37 # Gather a list of all tests.
38 set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
40 if { ($blddir != "") && [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"] } {
41 lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
42 # Allow for spec subsitution.
43 lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
44 set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
45 } else {
46 set ld_library_path "$always_ld_library_path"
48 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
49 set_ld_library_path_env_vars
51 # Main loop.
52 gfortran-dg-runtest $tests ""
55 # All done.
56 dg-finish