]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp testsuite: Generalize 'lang_library_path' into a list of 'lang_library_paths'
authorThomas Schwinge <thomas@codesourcery.com>
Sun, 2 Nov 2014 16:49:31 +0000 (17:49 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 12 May 2023 07:16:22 +0000 (09:16 +0200)
..., and use that for libquadmath, too.

libgomp/
* testsuite/lib/libgomp.exp (libgomp_target_compile): Generalize
'lang_library_path' into a list of 'lang_library_paths'.
* testsuite/libgomp.c++/c++.exp: Adjust.
* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
* testsuite/libgomp.fortran/fortran.exp: Adjust.  Use that for
libquadmath, too.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.

libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.c++/c++.exp
libgomp/testsuite/libgomp.fortran/fortran.exp
libgomp/testsuite/libgomp.oacc-c++/c++.exp
libgomp/testsuite/libgomp.oacc-fortran/fortran.exp

index 2295fbbbd417da4cf11014bc9e35e49f919d03bb..9fea31d8067263cb4b5e8e96f3190fbd8f20dbc9 100644 (file)
@@ -241,12 +241,14 @@ proc libgomp_target_compile { source dest type options } {
        lappend options "additional_flags=${lang_include_flags}"
     }
 
-    global lang_library_path
-    if { [info exists lang_library_path] } {
-       # Some targets use libgfortran.a%s in their specs, so they need
-       # a -B option for uninstalled testing.
-       lappend options "additional_flags=-B${blddir}/${lang_library_path}"
-       lappend options "ldflags=-L${blddir}/${lang_library_path}"
+    global lang_library_paths
+    if { [info exists lang_library_paths] } {
+       foreach lang_library_path $lang_library_paths {
+           # targets that use lib[...].a%s in their specs need a -B option
+           # for uninstalled testing.
+           lappend options "additional_flags=-B${blddir}/${lang_library_path}"
+           lappend options "ldflags=-L${blddir}/${lang_library_path}"
+       }
     }
     global lang_link_flags
     if { [info exists lang_link_flags] } {
index 8307baf32fcf588c4085fbd3741ad349f5fe2f17..1a1c3ee2225298d8901ca4fafd34451af8498bcb 100644 (file)
@@ -2,14 +2,15 @@ load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 
 if { $blddir != "" } {
-    set lang_library_path "../libstdc++-v3/src/.libs"
+    set libstdc++_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
-        && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+    if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"]
+        && ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } {
        verbose -log "No libstdc++ library found, will not execute c++ tests"
-       unset lang_library_path
+       unset libstdc++_library_path
        return
     }
+    lappend lang_library_paths ${libstdc++_library_path}
 } elseif { ![info exists GXX_UNDER_TEST] } {
     verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
     return
@@ -39,7 +40,7 @@ set tests [lsort [concat \
 
 set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-    append ld_library_path ":${blddir}/${lang_library_path}"
+    append ld_library_path ":${blddir}/${libstdc++_library_path}"
 }
 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
 set_ld_library_path_env_vars
@@ -62,7 +63,8 @@ if [info exists lang_include_flags] then {
     unset lang_include_flags
 }
 if { $blddir != "" } {
-    unset lang_library_path
+    unset libstdc++_library_path
+    unset lang_library_paths
 }
 unset lang_link_flags
 
index d98739c8c99d512859822dfc5971c5258686f6ac..9295bbae65dd80850db55e4a4b530570dcce5fa3 100644 (file)
@@ -3,14 +3,23 @@ load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
 if { $blddir != "" } {
-    set lang_library_path "../libgfortran/.libs"
+    set libgfortran_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
-        && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+    if { ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.a"]
+        && ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.${shlib_ext}"] } {
         verbose -log "No libgfortran library found, will not execute fortran tests"
-       unset lang_library_path
+       unset libgfortran_library_path
        return
     }
+    lappend lang_library_paths $libgfortran_library_path
+
+    set libquadmath_library_path "../libquadmath/.libs"
+    if { [file exists "${blddir}/${libquadmath_library_path}/libquadmath.a"]
+        || [file exists "${blddir}/${libquadmath_library_path}/libquadmath.${shlib_ext}"] } {
+       lappend lang_library_paths $libquadmath_library_path
+    } else {
+       set libquadmath_library_path ""
+    }
 } elseif { ![info exists GFORTRAN_UNDER_TEST] } {
     verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
     return
@@ -32,18 +41,12 @@ set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
 
 set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-    append ld_library_path ":${blddir}/${lang_library_path}"
+    append ld_library_path ":${blddir}/${libgfortran_library_path}"
 
-    set quadmath_library_path "../libquadmath/.libs"
-    if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"]
-        || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } {
-       lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
-       # Allow for spec subsitution.
-       lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
-       append ld_library_path ":${blddir}/${quadmath_library_path}"
+    if { $libquadmath_library_path != "" } {
+       append ld_library_path ":${blddir}/${libquadmath_library_path}"
        append lang_link_flags " -lquadmath"
     }
-    unset quadmath_library_path
 } else {
     if { [check_no_compiler_messages has_libquadmath executable {
              int main() {return 0;}
@@ -62,7 +65,9 @@ gfortran-dg-runtest $tests "" ""
 if { $blddir != "" } {
     unset lang_source_re
     unset lang_include_flags
-    unset lang_library_path
+    unset libgfortran_library_path
+    unset libquadmath_library_path
+    unset lang_library_paths
 }
 unset lang_link_flags
 
index 5e4f704934904058766dab7c35029bdae95e48e8..63d1d7650a20da0f46087b56f4d0dcaa6e971749 100644 (file)
@@ -12,14 +12,15 @@ proc check_effective_target_c++ { } {
 }
 
 if { $blddir != "" } {
-    set lang_library_path "../libstdc++-v3/src/.libs"
+    set libstdc++_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
-        && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+    if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"]
+        && ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } {
         verbose -log "No libstdc++ library found, will not execute c++ tests"
-       unset lang_library_path
+       unset libstdc++_library_path
        return
     }
+    lappend lang_library_paths ${libstdc++_library_path}
 } elseif { ![info exists GXX_UNDER_TEST] } {
     verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
     return
@@ -45,7 +46,7 @@ set tests [lsort [concat \
 
 set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-    append ld_library_path ":${blddir}/${lang_library_path}"
+    append ld_library_path ":${blddir}/${libstdc++_library_path}"
 }
 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
 set_ld_library_path_env_vars
@@ -139,7 +140,8 @@ if [info exists lang_include_flags] then {
     unset lang_include_flags
 }
 if { $blddir != "" } {
-    unset lang_library_path
+    unset libstdc++_library_path
+    unset lang_library_paths
 }
 unset lang_link_flags
 
index a590558a1950fb5fcd0c86902ef2bc9608c89ee9..af0a4f7ff3111556ffc1fe5441c423a83a1861b0 100644 (file)
@@ -5,14 +5,23 @@ load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
 if { $blddir != "" } {
-    set lang_library_path "../libgfortran/.libs"
+    set libgfortran_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
-        && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+    if { ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.a"]
+        && ![file exists "${blddir}/${libgfortran_library_path}/libgfortran.${shlib_ext}"] } {
         verbose -log "No libgfortran library found, will not execute fortran tests"
-       unset lang_library_path
+       unset libgfortran_library_path
        return
     }
+    lappend lang_library_paths $libgfortran_library_path
+
+    set libquadmath_library_path "../libquadmath/.libs"
+    if { [file exists "${blddir}/${libquadmath_library_path}/libquadmath.a"]
+        || [file exists "${blddir}/${libquadmath_library_path}/libquadmath.${shlib_ext}"] } {
+       lappend lang_library_paths $libquadmath_library_path
+    } else {
+       set libquadmath_library_path ""
+    }
 } elseif { ![info exists GFORTRAN_UNDER_TEST] } {
     verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
     return
@@ -35,18 +44,12 @@ set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
 
 set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-    append ld_library_path ":${blddir}/${lang_library_path}"
-
-    set quadmath_library_path "../libquadmath/.libs"
-    if { [file exists "${blddir}/${quadmath_library_path}/libquadmath.a"]
-        || [file exists "${blddir}/${quadmath_library_path}/libquadmath.${shlib_ext}"] } {
-       lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${quadmath_library_path}/"
-       # Allow for spec subsitution.
-       lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/${quadmath_library_path}/"
-       append ld_library_path ":${blddir}/${quadmath_library_path}"
+    append ld_library_path ":${blddir}/${libgfortran_library_path}"
+
+    if { $libquadmath_library_path != "" } {
+       append ld_library_path ":${blddir}/${libquadmath_library_path}"
        append lang_link_flags " -lquadmath"
     }
-    unset quadmath_library_path
 } else {
     if { [check_no_compiler_messages has_libquadmath executable {
              int main() {return 0;}
@@ -112,7 +115,9 @@ unset offload_target
 if { $blddir != "" } {
     unset lang_source_re
     unset lang_include_flags
-    unset lang_library_path
+    unset libgfortran_library_path
+    unset libquadmath_library_path
+    unset lang_library_paths
 }
 unset lang_link_flags