re PR libstdc++/89461 (FAIL: experimental/net/timer/waitable/cons.cc)
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 12 Mar 2019 23:13:36 +0000 (23:13 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 12 Mar 2019 23:13:36 +0000 (23:13 +0000)
PR libstdc++/89461
* testsuite/lib/libstdc++.exp: Locate libatomic.
* testsuite/lib/dg-options.exp (add_options_for_libatomic): New.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Add
libatomic options.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
* testsuite/experimental/net/timer/waitable/cons.cc: Likewise.
* testsuite/experimental/net/timer/waitable/dest.cc: Likewise.
* testsuite/experimental/net/timer/waitable/ops.cc: Likewise.

From-SVN: r269628

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc
libstdc++-v3/testsuite/experimental/net/timer/waitable/cons.cc
libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc
libstdc++-v3/testsuite/experimental/net/timer/waitable/ops.cc
libstdc++-v3/testsuite/lib/dg-options.exp
libstdc++-v3/testsuite/lib/libstdc++.exp

index 5c0e968d94224b9412110735a99b73f57d6fce91..59f857db3fe8416fb5e108f4badd36cba31f2204 100644 (file)
@@ -1,3 +1,15 @@
+2019-03-12  John David Anglin  <dave.anglin@bell.net>
+
+       PR libstdc++/89461
+       * testsuite/lib/libstdc++.exp: Locate libatomic.
+       * testsuite/lib/dg-options.exp (add_options_for_libatomic): New.
+       * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Add
+       libatomic options.
+       * testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
+       * testsuite/experimental/net/timer/waitable/cons.cc: Likewise.
+       * testsuite/experimental/net/timer/waitable/dest.cc: Likewise.
+       * testsuite/experimental/net/timer/waitable/ops.cc: Likewise.
+
 2019-03-11  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/89460
index 0953416b777e91ca543e93de7cc5ebadd435aab3..251e9371b5876467acd1813c93b67a443bebe12f 100644 (file)
@@ -19,6 +19,7 @@
 
 // { dg-do run }
 // { dg-options "-pthread"  }
+// { dg-add-options libatomic }
 // { dg-require-effective-target c++11 }
 // { dg-require-effective-target pthread }
 // { dg-require-cstdint "" }
index 10bcae358c4519f6d4c2b2907c4e2ff5617127ec..b3485697bfb7165b47f8e5daa6309ed0b4bb83dc 100644 (file)
@@ -19,6 +19,7 @@
 
 // { dg-do run }
 // { dg-options "-pthread"  }
+// { dg-add-options libatomic }
 // { dg-require-effective-target c++11 }
 // { dg-require-effective-target pthread }
 // { dg-require-cstdint "" }
index cd929b3e49b0fed7723fdb46326bbcf37c02c0e5..d1886e75f06364f5c3d439e51195897ee50966d4 100644 (file)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++14 } }
+// { dg-add-options libatomic }
 
 #include <experimental/timer>
 #include <testsuite_hooks.h>
index dfc359028b1dac5ade1a416249fc67cd8a7e93f6..cc3b6ee5658dc57bc501ec70f7c46401b423a2c5 100644 (file)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++14 } }
+// { dg-add-options libatomic }
 
 #include <experimental/timer>
 #include <testsuite_hooks.h>
index 23c4e346ce3f71a695cb275881a9bf714ae7966f..0f89bec16cda2d5f7ac02b86bdd81c6055a570b5 100644 (file)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++14 } }
+// { dg-add-options libatomic }
 
 #include <experimental/timer>
 #include <testsuite_hooks.h>
index 1d21d1c29d89419bcf6e7c70c07bf2e6a9355248..aa4747ea787af23be2ed871e9ca660caf4fb58c3 100644 (file)
@@ -257,6 +257,15 @@ proc add_options_for_net_ts { flags } {
     return $flags
 }
 
+# Add to FLAGS all the target-specific flags to link to libatomic, if required.
+
+proc add_options_for_libatomic { flags } {
+    if { [istarget hppa*-*-hpux*] || [istarget riscv*-*-*] } {
+       return "$flags -L../../libatomic/.libs -latomic"
+    }
+    return $flags
+}
+
 # Like dg-options, but adds to the default options rather than replacing them.
 
 proc dg-additional-options { args } {
index e84cb04b718d93bba031ee8b0ce5325326883fd5..02952a4334c249c00748da4d20321e1e11d94b51 100644 (file)
@@ -161,6 +161,17 @@ proc libstdc++_init { testfile } {
     }
     v3track gccdir 3
 
+    # Locate libatomic.
+    set v3-libatomic 0
+    set libatomicdir [lookfor_file $blddir/../libatomic .libs/libatomic.$shlib_ext]
+    if {$libatomicdir != ""} {
+       set v3-libatomic 1
+       set libatomicdir [file dirname $libatomicdir]
+       append ld_library_path_tmp ":${libatomicdir}"
+       verbose -log "libatomic support detected"
+    }
+    v3track libatomicdir 3
+
     # Locate libgomp. This is only required for parallel mode.
     set v3-libgomp 0
     set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]