libgomp: Prepare for testcases without -fopenmp.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / fortran.exp
blobe0bffe390b7a6e7ea78c8ff6bdb24a2d5689335d
1 load_lib libgomp-dg.exp
2 load_gcc_lib gcc-dg.exp
3 load_gcc_lib gfortran-dg.exp
5 global shlib_ext
6 global ALWAYS_CFLAGS
8 set shlib_ext [get_shlib_extension]
9 set lang_library_path "../libgfortran/.libs"
10 set lang_link_flags "-lgfortran"
11 set lang_test_file_found 0
12 set quadmath_library_path "../libquadmath/.libs"
15 # Initialize dg.
16 dg-init
18 # Turn on OpenMP.
19 lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
21 if { $blddir != "" } {
22 lappend ALWAYS_CFLAGS "additional_flags=-fintrinsic-modules-path=${blddir}"
23 # Look for a static libgfortran first.
24 if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
25 set lang_test_file "${lang_library_path}/libgfortran.a"
26 set lang_test_file_found 1
27 # We may have a shared only build, so look for a shared libgfortran.
28 } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
29 set lang_test_file "${lang_library_path}/libgfortran.${shlib_ext}"
30 set lang_test_file_found 1
31 } else {
32 puts "No libgfortran library found, will not execute fortran tests"
34 } elseif [info exists GFORTRAN_UNDER_TEST] {
35 set lang_test_file_found 1
36 # Needs to exist for libgomp.exp.
37 set lang_test_file ""
38 } else {
39 puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
42 if { $lang_test_file_found } {
43 # Gather a list of all tests.
44 set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
46 if { $blddir != "" } {
47 if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"]
48 || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } {
49 lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
50 # Allow for spec subsitution.
51 lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
52 set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
53 } else {
54 set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
56 } else {
57 set ld_library_path "$always_ld_library_path"
59 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
60 set_ld_library_path_env_vars
62 # Main loop.
63 gfortran-dg-runtest $tests ""
66 # All done.
67 dg-finish