From 2ff656f4210b6637bdb648b596932036bca6bf4f Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Tue, 12 Mar 2019 23:13:36 +0000 Subject: [PATCH] re PR libstdc++/89461 (FAIL: experimental/net/timer/waitable/cons.cc) 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 | 12 ++++++++++++ .../shared_ptr/thread/default_weaktoshared.cc | 1 + .../20_util/shared_ptr/thread/mutex_weaktoshared.cc | 1 + .../experimental/net/timer/waitable/cons.cc | 1 + .../experimental/net/timer/waitable/dest.cc | 1 + .../testsuite/experimental/net/timer/waitable/ops.cc | 1 + libstdc++-v3/testsuite/lib/dg-options.exp | 9 +++++++++ libstdc++-v3/testsuite/lib/libstdc++.exp | 11 +++++++++++ 8 files changed, 37 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5c0e968d942..59f857db3fe 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2019-03-12 John David Anglin + + 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 PR libstdc++/89460 diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc index 0953416b777..251e9371b58 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc @@ -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 "" } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc index 10bcae358c4..b3485697bfb 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc @@ -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 "" } diff --git a/libstdc++-v3/testsuite/experimental/net/timer/waitable/cons.cc b/libstdc++-v3/testsuite/experimental/net/timer/waitable/cons.cc index cd929b3e49b..d1886e75f06 100644 --- a/libstdc++-v3/testsuite/experimental/net/timer/waitable/cons.cc +++ b/libstdc++-v3/testsuite/experimental/net/timer/waitable/cons.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++14 } } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc b/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc index dfc359028b1..cc3b6ee5658 100644 --- a/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc +++ b/libstdc++-v3/testsuite/experimental/net/timer/waitable/dest.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++14 } } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/experimental/net/timer/waitable/ops.cc b/libstdc++-v3/testsuite/experimental/net/timer/waitable/ops.cc index 23c4e346ce3..0f89bec16cd 100644 --- a/libstdc++-v3/testsuite/experimental/net/timer/waitable/ops.cc +++ b/libstdc++-v3/testsuite/experimental/net/timer/waitable/ops.cc @@ -16,6 +16,7 @@ // . // { dg-do run { target c++14 } } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index 1d21d1c29d8..aa4747ea787 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -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 } { diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index e84cb04b718..02952a4334c 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -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] -- 2.30.2