OSDN Git Service

2011-02-16 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / libgomp / testsuite / libgomp.fortran / fortran.exp
1 load_lib libgomp-dg.exp
2
3 global shlib_ext
4 global ALWAYS_CFLAGS
5
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"
11
12
13 # Initialize dg.
14 dg-init
15
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"
27     }
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"
34 }
35
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}]]
39
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"
47     }
48     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
49     set_ld_library_path_env_vars
50
51     # Main loop.
52     gfortran-dg-runtest $tests ""
53 }
54
55 # All done.
56 dg-finish