Hi!

On 2023-05-09T14:59:53+0200, I wrote:
> On 2023-05-09T14:54:21+0200, I wrote:
>> [...] libgomp testsuite is a bit weird [...]: that every '*.exp' file
>> begins with a bunch of conditional 'unset lang_[...]' to clean up what
>> the previous '*.exp' file left behind.  I propose to simplify this as per
>> the attached "libgomp testsuite: Localize 'lang_[...]' etc." -- OK to
>> push?
>
> On top of this I'd then push the attached
> "libgomp C++, Fortran testsuites: Resolve 'lang_test_file_found' first",
> see attached, which again is extracted out of my earlier work.  This is
> to enable follow-on clean-up.

... which is "libgomp testsuite: Get rid of 'lang_test_file_found'", see
attached.  I'm also attaching a 'git format-patch --ignore-all-space'
variant, for easier review.

>> given that it's in line with my
>> earlier work (just a separate step), I intend to push it soon, unless
>> there are any objections, of course.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955
>From 38528210d3eb3da198be6900378f9e9d1ff10b53 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Sat, 1 Nov 2014 16:25:26 +0100
Subject: [PATCH] libgomp testsuite: Get rid of 'lang_test_file_found'

Instead, 'return' early from the '*.exp' files that we're not able to test.
Also, change 'puts' into 'verbose -log'.  While re-indenting the previous
'if { $lang_test_file_found } { [...] }' code, also simplify 'ld_library_path'
setup.

	libgomp/
	* testsuite/lib/libgomp.exp (libgomp_target_compile): Don't look
	at 'lang_test_file_found'.
	* testsuite/libgomp.c++/c++.exp: Don't set and use it, and instead
	'return' early if not able to test.  Simplify 'ld_library_path' setup.
	* testsuite/libgomp.fortran/fortran.exp: Likewise.
	* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
---
 libgomp/testsuite/lib/libgomp.exp             |  31 ++-
 libgomp/testsuite/libgomp.c++/c++.exp         |  61 +++---
 libgomp/testsuite/libgomp.fortran/fortran.exp |  80 ++++----
 libgomp/testsuite/libgomp.oacc-c++/c++.exp    | 187 ++++++++----------
 .../libgomp.oacc-fortran/fortran.exp          | 166 ++++++++--------
 5 files changed, 243 insertions(+), 282 deletions(-)

diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index dce33d788cc..c30fa4ed24b 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -240,24 +240,23 @@ proc libgomp_target_compile { source dest type options } {
     global gluefile wrap_flags
     global ALWAYS_CFLAGS
     global GCC_UNDER_TEST
-    global lang_test_file_found
+
+    global lang_source_re lang_include_flags
+    if { [info exists lang_include_flags] \
+	 && [regexp ${lang_source_re} ${source}] } {
+	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_link_flags
-    global lang_include_flags
-    global lang_source_re
-
-    if { [info exists lang_test_file_found] } {
-        if { $blddir != "" } {
-            # 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}"
-        }
-        lappend options "ldflags=${lang_link_flags}"
-	if { [info exists lang_include_flags] \
-	     && [regexp ${lang_source_re} ${source}] } {
-	    lappend options "additional_flags=${lang_include_flags}"
-	}
+    if { [info exists lang_link_flags] } {
+	lappend options "ldflags=${lang_link_flags}"
     }
 
     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp
index 797a05ca870..8307baf32fc 100644
--- a/libgomp/testsuite/libgomp.c++/c++.exp
+++ b/libgomp/testsuite/libgomp.c++/c++.exp
@@ -1,23 +1,18 @@
 load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libstdc++ first.
-    if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
-        set lang_test_file_found 1
-        # We may have a shared only build, so look for a shared libstdc++.
-    } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libstdc++ library found, will not execute c++ tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+	verbose -log "No libstdc++ library found, will not execute c++ tests"
+	unset lang_library_path
+	return
     }
-} elseif { [info exists GXX_UNDER_TEST] } {
-    set lang_test_file_found 1
-} else {
-    puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+} elseif { ![info exists GXX_UNDER_TEST] } {
+    verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
+    return
 }
 set lang_link_flags "-lstdc++"
 
@@ -37,31 +32,28 @@ lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
 set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
 set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
 
-if { $lang_test_file_found } {
-    # Gather a list of all tests.
-    set tests [lsort [concat \
-			  [find $srcdir/$subdir *.C] \
-			  [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]]
+# Gather a list of all tests.
+set tests [lsort [concat \
+		      [find $srcdir/$subdir *.C] \
+		      [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]]
 
-    if { $blddir != "" } {
-        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-    } else {
-        set ld_library_path "$always_ld_library_path"
-    }
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
-
-    set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
-    if { $blddir != ""
-	 && [file exists $flags_file] } {
-	set lang_source_re {^.*\.[cC]$}
-	set lang_include_flags [exec sh $flags_file --build-includes]
-    }
+set ld_library_path $always_ld_library_path
+if { $blddir != "" } {
+    append ld_library_path ":${blddir}/${lang_library_path}"
+}
+append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+set_ld_library_path_env_vars
 
-    # Main loop.
-    dg-runtest $tests "" $DEFAULT_CFLAGS
+set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
+if { $blddir != ""
+     && [file exists $flags_file] } {
+    set lang_source_re {^.*\.[cC]$}
+    set lang_include_flags [exec sh $flags_file --build-includes]
 }
 
+# Main loop.
+dg-runtest $tests "" $DEFAULT_CFLAGS
+
 # See above.
 set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
 
@@ -73,7 +65,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
index 16ce9d3e023..d98739c8c99 100644
--- a/libgomp/testsuite/libgomp.fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -2,23 +2,18 @@ load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libgfortran first.
-    if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
-        set lang_test_file_found 1
-	# We may have a shared only build, so look for a shared libgfortran.
-    } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libgfortran library found, will not execute fortran tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+        verbose -log "No libgfortran library found, will not execute fortran tests"
+	unset lang_library_path
+	return
     }
-} elseif [info exists GFORTRAN_UNDER_TEST] {
-    set lang_test_file_found 1
-} else {
-    puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+} elseif { ![info exists GFORTRAN_UNDER_TEST] } {
+    verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+    return
 }
 if { $blddir != "" } {
     set lang_source_re {^.*\.[fF](|90|95|03|08)$}
@@ -32,39 +27,37 @@ dg-init
 # Turn on OpenMP.
 lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
 
-if { $lang_test_file_found } {
-    # Gather a list of all tests.
-    set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
+# Gather a list of all tests.
+set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
 
-    if { $blddir != "" } {
-	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}/"
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
-	    append lang_link_flags " -lquadmath"
-	} else {
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-	}
-	unset quadmath_library_path
-    } else {
-        set ld_library_path "$always_ld_library_path"
-        if { [check_no_compiler_messages has_libquadmath executable {
-                 int main() {return 0;}
-              } "-lgfortran -lquadmath"] } then {
-            append lang_link_flags " -lquadmath"
-        }
-    }
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
+set ld_library_path $always_ld_library_path
+if { $blddir != "" } {
+    append ld_library_path ":${blddir}/${lang_library_path}"
 
-    # For Fortran we're doing torture testing, as Fortran has far more tests
-    # with arrays etc. that testing just -O0 or -O2 is insufficient, that is
-    # typically not the case for C/C++.
-    gfortran-dg-runtest $tests "" ""
+    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 lang_link_flags " -lquadmath"
+    }
+    unset quadmath_library_path
+} else {
+    if { [check_no_compiler_messages has_libquadmath executable {
+             int main() {return 0;}
+          } "-lgfortran -lquadmath"] } then {
+	append lang_link_flags " -lquadmath"
+    }
 }
+append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+set_ld_library_path_env_vars
+
+# For Fortran we're doing torture testing, as Fortran has far more tests
+# with arrays etc. that testing just -O0 or -O2 is insufficient, that is
+# typically not the case for C/C++.
+gfortran-dg-runtest $tests "" ""
 
 if { $blddir != "" } {
     unset lang_source_re
@@ -72,7 +65,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index 060aaa27419..5e4f7049349 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -11,23 +11,18 @@ proc check_effective_target_c++ { } {
     return 1
 }
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libstdc++ first.
-    if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
-        set lang_test_file_found 1
-        # We may have a shared only build, so look for a shared libstdc++.
-    } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libstdc++ library found, will not execute c++ tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+        verbose -log "No libstdc++ library found, will not execute c++ tests"
+	unset lang_library_path
+	return
     }
-} elseif { [info exists GXX_UNDER_TEST] } {
-    set lang_test_file_found 1
-} else {
-    puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+} elseif { ![info exists GXX_UNDER_TEST] } {
+    verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
+    return
 }
 set lang_link_flags "-lstdc++"
 
@@ -43,105 +38,98 @@ lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
 set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
 set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
 
-if { $lang_test_file_found } {
-    # Gather a list of all tests.
-    set tests [lsort [concat \
-			  [find $srcdir/$subdir *.C] \
-			  [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]]
+# Gather a list of all tests.
+set tests [lsort [concat \
+		      [find $srcdir/$subdir *.C] \
+		      [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]]
 
-    if { $blddir != "" } {
-        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-    } else {
-        set ld_library_path "$always_ld_library_path"
-    }
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
-
-    set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
-    if { $blddir != ""
-	 && [file exists $flags_file] } {
-	set lang_source_re {^.*\.[cC]$}
-	set lang_include_flags [exec sh $flags_file --build-includes]
-    }
+set ld_library_path $always_ld_library_path
+if { $blddir != "" } {
+    append ld_library_path ":${blddir}/${lang_library_path}"
+}
+append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+set_ld_library_path_env_vars
+
+set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
+if { $blddir != ""
+     && [file exists $flags_file] } {
+    set lang_source_re {^.*\.[cC]$}
+    set lang_include_flags [exec sh $flags_file --build-includes]
+}
 
-    # Test with all available offload targets, and with offloading disabled.
-    foreach offload_target [concat [split $offload_targets ","] "disable"] {
-	global openacc_device_type
-	set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
-	set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
+# Test with all available offload targets, and with offloading disabled.
+foreach offload_target [concat [split $offload_targets ","] "disable"] {
+    global openacc_device_type
+    set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
+    set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
 
-	switch $openacc_device_type {
-	    "" {
-		unsupported "$subdir $offload_target offloading"
+    switch $openacc_device_type {
+	"" {
+	    unsupported "$subdir $offload_target offloading"
+	    continue
+	}
+	host {
+	    set acc_mem_shared 1
+	}
+	nvidia {
+	    if { ![check_effective_target_openacc_nvidia_accel_present] } {
+		# Don't bother; execution testing is going to FAIL.
+		untested "$subdir $offload_target offloading: supported, but hardware not accessible"
 		continue
 	    }
-	    host {
-		set acc_mem_shared 1
-	    }
-	    nvidia {
-		if { ![check_effective_target_openacc_nvidia_accel_present] } {
-		    # Don't bother; execution testing is going to FAIL.
-		    untested "$subdir $offload_target offloading: supported, but hardware not accessible"
-		    continue
-		}
 
-		# Copy ptx file (TEMPORARY)
-		remote_download host $srcdir/libgomp.oacc-c-c++-common/subr.ptx
+	    # Copy ptx file (TEMPORARY)
+	    remote_download host $srcdir/libgomp.oacc-c-c++-common/subr.ptx
 
-		# Where timer.h lives
-		lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/libgomp.oacc-c-c++-common"
+	    # Where timer.h lives
+	    lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/libgomp.oacc-c-c++-common"
 
-		set acc_mem_shared 0
-	    }
-	    radeon {
-		if { ![check_effective_target_openacc_radeon_accel_present] } {
-		    # Don't bother; execution testing is going to FAIL.
-		    untested "$subdir $offload_target offloading: supported, but hardware not accessible"
-		    continue
-		}
-
-		set acc_mem_shared 0
-	    }
-	    default {
-		error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
-	    }
+	    set acc_mem_shared 0
 	}
-	set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
-
-	# To avoid compilation overhead, and to keep simple '-foffload=[...]'
-	# handling in test cases, by default only build for the offload target
-	# that we're actually going to test.
-	set tagopt "$tagopt -foffload=$offload_target"
-	# Force usage of the corresponding OpenACC device type.
-	setenv ACC_DEVICE_TYPE $openacc_device_type
-
-	# To get better test coverage for device-specific code that is only
-	# ever used in offloading configurations, we'd like more thorough
-	# testing for test cases that deal with offloading, which most of all
-	# OpenACC test cases are.  We enable torture testing, but limit it to
-	# -O0 and -O2 only, to avoid testing times exploding too much, under
-	# the assumption that between -O0 and -O[something] there is the
-	# biggest difference in the overall structure of the generated code.
-	switch -glob $offload_target {
-	    disable {
-		set-torture-options [list \
-					 { -O2 } ]
-	    }
-	    default {
-		set-torture-options [list \
-					 { -O0 } \
-					 { -O2 } ]
+	radeon {
+	    if { ![check_effective_target_openacc_radeon_accel_present] } {
+		# Don't bother; execution testing is going to FAIL.
+		untested "$subdir $offload_target offloading: supported, but hardware not accessible"
+		continue
 	    }
-	}
 
-	gcc-dg-runtest $tests "$tagopt" ""
+	    set acc_mem_shared 0
+	}
+	default {
+	    error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
+	}
     }
-    unset offload_target
-} else {
-    # Call this once, which placates the subsequent torture-finish.
-    set-torture-options [list \
-			     { INVALID } ]
+    set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
+
+    # To avoid compilation overhead, and to keep simple '-foffload=[...]'
+    # handling in test cases, by default only build for the offload target
+    # that we're actually going to test.
+    set tagopt "$tagopt -foffload=$offload_target"
+    # Force usage of the corresponding OpenACC device type.
+    setenv ACC_DEVICE_TYPE $openacc_device_type
+
+    # To get better test coverage for device-specific code that is only
+    # ever used in offloading configurations, we'd like more thorough
+    # testing for test cases that deal with offloading, which most of all
+    # OpenACC test cases are.  We enable torture testing, but limit it to
+    # -O0 and -O2 only, to avoid testing times exploding too much, under
+    # the assumption that between -O0 and -O[something] there is the
+    # biggest difference in the overall structure of the generated code.
+    switch -glob $offload_target {
+	disable {
+	    set-torture-options [list \
+				     { -O2 } ]
+	}
+	default {
+	    set-torture-options [list \
+				     { -O0 } \
+				     { -O2 } ]
+	}
+    }
+
+    gcc-dg-runtest $tests "$tagopt" ""
 }
+unset offload_target
 
 # See above.
 set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
@@ -154,7 +142,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 torture-finish
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 9af526007cf..a590558a195 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -4,23 +4,18 @@ load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libgfortran first.
-    if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
-        set lang_test_file_found 1
-	# We may have a shared only build, so look for a shared libgfortran.
-    } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libgfortran library found, will not execute fortran tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+        verbose -log "No libgfortran library found, will not execute fortran tests"
+	unset lang_library_path
+	return
     }
-} elseif [info exists GFORTRAN_UNDER_TEST] {
-    set lang_test_file_found 1
-} else {
-    puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+} elseif { ![info exists GFORTRAN_UNDER_TEST] } {
+    verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+    return
 }
 if { $blddir != "" } {
     set lang_source_re {^.*\.[fF](|90|95|03|08)$}
@@ -35,86 +30,84 @@ dg-init
 lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
 
 
-if { $lang_test_file_found } {
-    # Gather a list of all tests.
-    set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
-
-    if { $blddir != "" } {
-	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}/"
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
-	    append lang_link_flags " -lquadmath"
-	} else {
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-	}
-	unset quadmath_library_path
-    } else {
-        set ld_library_path "$always_ld_library_path"
-        if { [check_no_compiler_messages has_libquadmath executable {
-                 int main() {return 0;}
-              } "-lgfortran -lquadmath"] } then {
-            append lang_link_flags " -lquadmath"
-        }
+# Gather a list of all tests.
+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 lang_link_flags " -lquadmath"
     }
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
-
-    # Test with all available offload targets, and with offloading disabled.
-    foreach offload_target [concat [split $offload_targets ","] "disable"] {
-	global openacc_device_type
-	set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
-	set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
-
-	switch $openacc_device_type {
-	    "" {
-		unsupported "$subdir $offload_target offloading"
+    unset quadmath_library_path
+} else {
+    if { [check_no_compiler_messages has_libquadmath executable {
+             int main() {return 0;}
+          } "-lgfortran -lquadmath"] } then {
+	append lang_link_flags " -lquadmath"
+    }
+}
+append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+set_ld_library_path_env_vars
+
+# Test with all available offload targets, and with offloading disabled.
+foreach offload_target [concat [split $offload_targets ","] "disable"] {
+    global openacc_device_type
+    set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
+    set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
+
+    switch $openacc_device_type {
+	"" {
+	    unsupported "$subdir $offload_target offloading"
+	    continue
+	}
+	host {
+	    set acc_mem_shared 1
+	}
+	nvidia {
+	    if { ![check_effective_target_openacc_nvidia_accel_present] } {
+		# Don't bother; execution testing is going to FAIL.
+		untested "$subdir $offload_target offloading: supported, but hardware not accessible"
 		continue
 	    }
-	    host {
-		set acc_mem_shared 1
-	    }
-	    nvidia {
-		if { ![check_effective_target_openacc_nvidia_accel_present] } {
-		    # Don't bother; execution testing is going to FAIL.
-		    untested "$subdir $offload_target offloading: supported, but hardware not accessible"
-		    continue
-		}
-
-		set acc_mem_shared 0
-	    }
-	    radeon {
-		if { ![check_effective_target_openacc_radeon_accel_present] } {
-		    # Don't bother; execution testing is going to FAIL.
-		    untested "$subdir $offload_target offloading: supported, but hardware not accessible"
-		    continue
-		}
-
-		set acc_mem_shared 0
-	    }
-	    default {
-		error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
+
+	    set acc_mem_shared 0
+	}
+	radeon {
+	    if { ![check_effective_target_openacc_radeon_accel_present] } {
+		# Don't bother; execution testing is going to FAIL.
+		untested "$subdir $offload_target offloading: supported, but hardware not accessible"
+		continue
 	    }
+
+	    set acc_mem_shared 0
+	}
+	default {
+	    error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
 	}
-	set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
-
-	# To avoid compilation overhead, and to keep simple '-foffload=[...]'
-	# handling in test cases, by default only build for the offload target
-	# that we're actually going to test.
-	set tagopt "$tagopt -foffload=$offload_target"
-	# Force usage of the corresponding OpenACC device type.
-	setenv ACC_DEVICE_TYPE $openacc_device_type
-
-	# For Fortran we're doing torture testing, as Fortran has far more tests
-	# with arrays etc. that testing just -O0 or -O2 is insufficient, that is
-	# typically not the case for C/C++.
-	gfortran-dg-runtest $tests "$tagopt" ""
     }
-    unset offload_target
+    set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
+
+    # To avoid compilation overhead, and to keep simple '-foffload=[...]'
+    # handling in test cases, by default only build for the offload target
+    # that we're actually going to test.
+    set tagopt "$tagopt -foffload=$offload_target"
+    # Force usage of the corresponding OpenACC device type.
+    setenv ACC_DEVICE_TYPE $openacc_device_type
+
+    # For Fortran we're doing torture testing, as Fortran has far more tests
+    # with arrays etc. that testing just -O0 or -O2 is insufficient, that is
+    # typically not the case for C/C++.
+    gfortran-dg-runtest $tests "$tagopt" ""
 }
+unset offload_target
 
 if { $blddir != "" } {
     unset lang_source_re
@@ -122,7 +115,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
-- 
2.34.1

>From 38528210d3eb3da198be6900378f9e9d1ff10b53 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Sat, 1 Nov 2014 16:25:26 +0100
Subject: [PATCH] libgomp testsuite: Get rid of 'lang_test_file_found'

Instead, 'return' early from the '*.exp' files that we're not able to test.
Also, change 'puts' into 'verbose -log'.  While re-indenting the previous
'if { $lang_test_file_found } { [...] }' code, also simplify 'ld_library_path'
setup.

	libgomp/
	* testsuite/lib/libgomp.exp (libgomp_target_compile): Don't look
	at 'lang_test_file_found'.
	* testsuite/libgomp.c++/c++.exp: Don't set and use it, and instead
	'return' early if not able to test.  Simplify 'ld_library_path' setup.
	* testsuite/libgomp.fortran/fortran.exp: Likewise.
	* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
---
 libgomp/testsuite/lib/libgomp.exp             | 21 ++++++-----
 libgomp/testsuite/libgomp.c++/c++.exp         | 29 ++++++---------
 libgomp/testsuite/libgomp.fortran/fortran.exp | 32 +++++++----------
 libgomp/testsuite/libgomp.oacc-c++/c++.exp    | 35 ++++++-------------
 .../libgomp.oacc-fortran/fortran.exp          | 32 +++++++----------
 5 files changed, 55 insertions(+), 94 deletions(-)

diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index dce33d788cc..c30fa4ed24b 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -240,24 +240,23 @@ proc libgomp_target_compile { source dest type options } {
     global gluefile wrap_flags
     global ALWAYS_CFLAGS
     global GCC_UNDER_TEST
-    global lang_test_file_found
-    global lang_library_path
-    global lang_link_flags
-    global lang_include_flags
-    global lang_source_re
 
-    if { [info exists lang_test_file_found] } {
-        if { $blddir != "" } {
+    global lang_source_re lang_include_flags
+    if { [info exists lang_include_flags] \
+	 && [regexp ${lang_source_re} ${source}] } {
+	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_link_flags
+    if { [info exists lang_link_flags] } {
 	lappend options "ldflags=${lang_link_flags}"
-	if { [info exists lang_include_flags] \
-	     && [regexp ${lang_source_re} ${source}] } {
-	    lappend options "additional_flags=${lang_include_flags}"
-	}
     }
 
     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp
index 797a05ca870..8307baf32fc 100644
--- a/libgomp/testsuite/libgomp.c++/c++.exp
+++ b/libgomp/testsuite/libgomp.c++/c++.exp
@@ -1,23 +1,18 @@
 load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libstdc++ first.
-    if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
-        set lang_test_file_found 1
-        # We may have a shared only build, so look for a shared libstdc++.
-    } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libstdc++ library found, will not execute c++ tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+	verbose -log "No libstdc++ library found, will not execute c++ tests"
+	unset lang_library_path
+	return
     }
-} elseif { [info exists GXX_UNDER_TEST] } {
-    set lang_test_file_found 1
-} else {
-    puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+} elseif { ![info exists GXX_UNDER_TEST] } {
+    verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
+    return
 }
 set lang_link_flags "-lstdc++"
 
@@ -37,16 +32,14 @@ lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
 set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
 set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
 
-if { $lang_test_file_found } {
 # Gather a list of all tests.
 set tests [lsort [concat \
 		      [find $srcdir/$subdir *.C] \
 		      [find $srcdir/$subdir/../libgomp.c-c++-common *.c]]]
 
+set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-    } else {
-        set ld_library_path "$always_ld_library_path"
+    append ld_library_path ":${blddir}/${lang_library_path}"
 }
 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
 set_ld_library_path_env_vars
@@ -60,7 +53,6 @@ if { $lang_test_file_found } {
 
 # Main loop.
 dg-runtest $tests "" $DEFAULT_CFLAGS
-}
 
 # See above.
 set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
@@ -73,7 +65,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
index 16ce9d3e023..d98739c8c99 100644
--- a/libgomp/testsuite/libgomp.fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -2,23 +2,18 @@ load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libgfortran first.
-    if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
-        set lang_test_file_found 1
-	# We may have a shared only build, so look for a shared libgfortran.
-    } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libgfortran library found, will not execute fortran tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+        verbose -log "No libgfortran library found, will not execute fortran tests"
+	unset lang_library_path
+	return
     }
-} elseif [info exists GFORTRAN_UNDER_TEST] {
-    set lang_test_file_found 1
-} else {
-    puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+} elseif { ![info exists GFORTRAN_UNDER_TEST] } {
+    verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+    return
 }
 if { $blddir != "" } {
     set lang_source_re {^.*\.[fF](|90|95|03|08)$}
@@ -32,25 +27,24 @@ dg-init
 # Turn on OpenMP.
 lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
 
-if { $lang_test_file_found } {
 # Gather a list of all tests.
 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}/"
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
+	append ld_library_path ":${blddir}/${quadmath_library_path}"
 	append lang_link_flags " -lquadmath"
-	} else {
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
     }
     unset quadmath_library_path
 } else {
-        set ld_library_path "$always_ld_library_path"
     if { [check_no_compiler_messages has_libquadmath executable {
              int main() {return 0;}
           } "-lgfortran -lquadmath"] } then {
@@ -64,7 +58,6 @@ if { $lang_test_file_found } {
 # with arrays etc. that testing just -O0 or -O2 is insufficient, that is
 # typically not the case for C/C++.
 gfortran-dg-runtest $tests "" ""
-}
 
 if { $blddir != "" } {
     unset lang_source_re
@@ -72,7 +65,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index 060aaa27419..5e4f7049349 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -11,23 +11,18 @@ proc check_effective_target_c++ { } {
     return 1
 }
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libstdc++-v3/src/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libstdc++ first.
-    if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
-        set lang_test_file_found 1
-        # We may have a shared only build, so look for a shared libstdc++.
-    } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libstdc++ library found, will not execute c++ tests"
-    }
-} elseif { [info exists GXX_UNDER_TEST] } {
-    set lang_test_file_found 1
-} else {
-    puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+        verbose -log "No libstdc++ library found, will not execute c++ tests"
+	unset lang_library_path
+	return
+    }
+} elseif { ![info exists GXX_UNDER_TEST] } {
+    verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
+    return
 }
 set lang_link_flags "-lstdc++"
 
@@ -43,16 +38,14 @@ lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
 set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
 set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
 
-if { $lang_test_file_found } {
 # Gather a list of all tests.
 set tests [lsort [concat \
 		      [find $srcdir/$subdir *.C] \
 		      [find $srcdir/$subdir/../libgomp.oacc-c-c++-common *.c]]]
 
+set ld_library_path $always_ld_library_path
 if { $blddir != "" } {
-        set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
-    } else {
-        set ld_library_path "$always_ld_library_path"
+    append ld_library_path ":${blddir}/${lang_library_path}"
 }
 append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
 set_ld_library_path_env_vars
@@ -137,11 +130,6 @@ if { $lang_test_file_found } {
     gcc-dg-runtest $tests "$tagopt" ""
 }
 unset offload_target
-} else {
-    # Call this once, which placates the subsequent torture-finish.
-    set-torture-options [list \
-			     { INVALID } ]
-}
 
 # See above.
 set GCC_UNDER_TEST "$SAVE_GCC_UNDER_TEST"
@@ -154,7 +142,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 torture-finish
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 9af526007cf..a590558a195 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -4,23 +4,18 @@ load_lib libgomp-dg.exp
 load_gcc_lib gcc-dg.exp
 load_gcc_lib gfortran-dg.exp
 
-set lang_test_file_found 0
 if { $blddir != "" } {
     set lang_library_path "../libgfortran/.libs"
     set shlib_ext [get_shlib_extension]
-    # Look for a static libgfortran first.
-    if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
-        set lang_test_file_found 1
-	# We may have a shared only build, so look for a shared libgfortran.
-    } elseif [file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] {
-        set lang_test_file_found 1
-    } else {
-        puts "No libgfortran library found, will not execute fortran tests"
+    if { ![file exists "${blddir}/${lang_library_path}/libgfortran.a"]
+	 && ![file exists "${blddir}/${lang_library_path}/libgfortran.${shlib_ext}"] } {
+        verbose -log "No libgfortran library found, will not execute fortran tests"
+	unset lang_library_path
+	return
     }
-} elseif [info exists GFORTRAN_UNDER_TEST] {
-    set lang_test_file_found 1
-} else {
-    puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+} elseif { ![info exists GFORTRAN_UNDER_TEST] } {
+    verbose -log "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+    return
 }
 if { $blddir != "" } {
     set lang_source_re {^.*\.[fF](|90|95|03|08)$}
@@ -35,25 +30,24 @@ dg-init
 lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
 
 
-if { $lang_test_file_found } {
 # Gather a list of all tests.
 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}/"
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}:${blddir}/${quadmath_library_path}"
+	append ld_library_path ":${blddir}/${quadmath_library_path}"
 	append lang_link_flags " -lquadmath"
-	} else {
-	    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
     }
     unset quadmath_library_path
 } else {
-        set ld_library_path "$always_ld_library_path"
     if { [check_no_compiler_messages has_libquadmath executable {
              int main() {return 0;}
           } "-lgfortran -lquadmath"] } then {
@@ -114,7 +108,6 @@ if { $lang_test_file_found } {
     gfortran-dg-runtest $tests "$tagopt" ""
 }
 unset offload_target
-}
 
 if { $blddir != "" } {
     unset lang_source_re
@@ -122,7 +115,6 @@ if { $blddir != "" } {
     unset lang_library_path
 }
 unset lang_link_flags
-unset lang_test_file_found
 
 # All done.
 dg-finish
-- 
2.34.1

Reply via email to