Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / fortran.exp
blob32e4bb2af4e0f1028171d54e661b682979c97848
1 load_lib libgomp-dg.exp
2 load_gcc_lib gcc-dg.exp
3 load_gcc_lib gfortran-dg.exp
5 if { $blddir != "" } {
6 set libgfortran_library_path "../libgfortran/.libs"
7 set shlib_ext [get_shlib_extension]
8 if { ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.a"]
9 && ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.${shlib_ext}"] } {
10 verbose -log "No libgfortran library found, will not execute fortran tests"
11 unset libgfortran_library_path
12 return
14 lappend lang_library_paths $libgfortran_library_path
16 set libquadmath_library_path "../libquadmath/.libs"
17 if { [file exists "${blddir}/${libquadmath_library_path}/libquadmath.a"]
18 || [file exists "${blddir}/${libquadmath_library_path}/libquadmath.${shlib_ext}"] } {
19 lappend lang_library_paths $libquadmath_library_path
20 } else {
21 set libquadmath_library_path ""
23 } elseif { ![info exists GFORTRAN_UNDER_TEST] } {
24 verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
25 return
27 if { $blddir != "" } {
28 set lang_source_re {^.*\.[fF](|90|95|03|08)$}
29 set lang_include_flags "-fintrinsic-modules-path=${blddir}"
31 lappend ALWAYS_CFLAGS "compiler=$GFORTRAN_UNDER_TEST"
33 # Initialize dg.
34 dg-init
36 # Turn on OpenMP.
37 lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
39 # Gather a list of all tests.
40 set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
42 set ld_library_path $always_ld_library_path
43 if { $blddir != "" } {
44 append ld_library_path ":${blddir}/${libgfortran_library_path}"
46 if { $libquadmath_library_path != "" } {
47 append ld_library_path ":${blddir}/${libquadmath_library_path}"
50 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
51 set_ld_library_path_env_vars
53 # For Fortran we're doing torture testing, as Fortran has far more tests
54 # with arrays etc. that testing just -O0 or -O2 is insufficient, that is
55 # typically not the case for C/C++.
56 gfortran-dg-runtest $tests "" ""
58 if { $blddir != "" } {
59 unset lang_source_re
60 unset lang_include_flags
61 unset libgfortran_library_path
62 unset libquadmath_library_path
63 unset lang_library_paths
66 # All done.
67 dg-finish