public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Thomas Rodgers <trodgers@redhat.com>
Cc: Christophe Lyon <christophe.lyon@linaro.org>,
	gcc Patches <gcc-patches@gcc.gnu.org>,
	"libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889]
Date: Wed, 9 Jun 2021 16:11:47 +0100	[thread overview]
Message-ID: <CACb0b4k2=H_z_VM_ER+yKEMM=FVi6=6m9=nvArWhVCJBF-js4A@mail.gmail.com> (raw)
In-Reply-To: <CAMmuTO-3EKPZp7BBQCeumWcKrhXGK4aWgH7ywHSF7=ZkfXRTXQ@mail.gmail.com>

For other tests that don't link to libatomic we use if-constexpr to
limit which types we test e.g.

--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc
@@ -33,14 +33,17 @@ template<typename S>
    S aa{ va };
    S bb{ vb };
    std::atomic_ref<S> a{ aa };
-    a.wait(bb);
-    std::thread t([&]
+    if constexpr (std::atomic_ref<S>::is_always_lock_free)
      {
-       a.store(bb);
-       a.notify_one();
-      });
-    a.wait(aa);
-    t.join();
+       a.wait(bb);
+       std::thread t([&]
+         {
+           a.store(bb);
+           a.notify_one();
+         });
+       a.wait(aa);
+       t.join();
+      }
  }

int


Alternatively we could add arm*-*-* to the targets in
add_options_for_libatomic in testsuite/lib/dg-options.exp


      reply	other threads:[~2021-06-09 15:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 23:04 [PATCH] PR libstdc++/100889: Fix wrong param type in atomic_ref<_Tp*>::wait Thomas Rodgers
2021-06-04 23:18 ` Jonathan Wakely
2021-06-05  0:44   ` [PATCH] [libstdc++] Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] Thomas Rodgers
2021-06-07 22:02   ` [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] [PR100889] Thomas Rodgers
2021-06-08  0:28     ` [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] Thomas Rodgers
2021-06-08 15:44       ` Jonathan Wakely
2021-06-08 23:03         ` Thomas Rodgers
2021-06-09 14:30           ` Christophe Lyon
2021-06-09 14:52             ` Thomas Rodgers
2021-06-09 15:11               ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4k2=H_z_VM_ER+yKEMM=FVi6=6m9=nvArWhVCJBF-js4A@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=trodgers@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).