aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2015-01-08 21:57:49 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2015-01-08 21:57:49 +0000
commitb85449adb9120b984916eb9bc0a88a466ec0744e (patch)
tree0e3a51a28ca95cb81adce87c1991ba90f30797c8 /gcc
parent303e1d56c6214940a633c2b8ea7da2d81c15bd4d (diff)
downloadgcc-b85449adb9120b984916eb9bc0a88a466ec0744e.zip
gcc-b85449adb9120b984916eb9bc0a88a466ec0744e.tar.gz
gcc-b85449adb9120b984916eb9bc0a88a466ec0744e.tar.bz2
re PR testsuite/62250 (FAIL: gfortran.dg/coarray/alloc_comp_1.f90 -fcoarray=lib -O2 -lcaf_single)
PR testsuite/62250 * lib/target-supports.exp (check_effective_target_libatomic_available): New. * gfortran.dg/coarray/caf.exp: Only add -latomic for targets that match effective-target libatomic_available. * gfortran.dg/coarray_lib_comm_1.f90: Similar. From-SVN: r219364
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gfortran.dg/coarray/caf.exp10
-rw-r--r--gcc/testsuite/lib/target-supports.exp7
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6e19a07..d7d9ac8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2015-01-08 Hans-Peter Nilsson <hp@axis.com>
+
+ PR testsuite/62250
+ * lib/target-supports.exp (check_effective_target_libatomic_available):
+ New.
+ * gfortran.dg/coarray/caf.exp: Only add -latomic for
+ targets that match effective-target libatomic_available.
+ * gfortran.dg/coarray_lib_comm_1.f90: Similar.
+
2015-01-08 David Malcolm <dmalcolm@redhat.com>
* jit.dg/test-error-block-in-wrong-function.c (verify_code):
diff --git a/gcc/testsuite/gfortran.dg/coarray/caf.exp b/gcc/testsuite/gfortran.dg/coarray/caf.exp
index 1ee2477..47529d3 100644
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp
+++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp
@@ -58,6 +58,12 @@ proc dg-compile-aux-modules { args } {
# cleanup-modules isn't intentionally invoked here.
}
+# Add -latomic only where supported. Assume built-in support elsewhere.
+set maybe_atomic_lib ""
+if [check_effective_target_libatomic_available] {
+ set maybe_atomic_lib "-latomic"
+}
+
# Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
# If we're only testing specific files and this isn't one of them, skip it.
@@ -81,14 +87,14 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]]
foreach flags $option_list {
verbose "Testing $nshort (single), $flags" 1
set gfortran_aux_module_flags "-fcoarray=single $flags"
- dg-test $test "-fcoarray=single $flags -latomic" ""
+ dg-test $test "-fcoarray=single $flags $maybe_atomic_lib" ""
cleanup-modules ""
}
foreach flags $option_list {
verbose "Testing $nshort (libcaf_single), $flags" 1
set gfortran_aux_module_flags "-fcoarray=lib $flags -lcaf_single"
- dg-test $test "-fcoarray=lib $flags -lcaf_single -latomic" ""
+ dg-test $test "-fcoarray=lib $flags -lcaf_single $maybe_atomic_lib" ""
cleanup-modules ""
}
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 119d2c5..f5c6db8 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1128,6 +1128,13 @@ proc check_libcilkrts_available { } {
} "-fcilkplus -lcilkrts" ]
}
+# Return true if the atomic library is supported on the target.
+proc check_effective_target_libatomic_available { } {
+ return [check_no_compiler_messages libatomic_available executable {
+ int main (void) { return 0; }
+ } "-latomic"]
+}
+
# Return 1 if an ASCII locale is supported on this host, 0 otherwise.
proc check_ascii_locale_available { } {