+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):
# 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.
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 ""
}
}
} "-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 { } {