From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C27313857706 for ; Mon, 11 Sep 2023 16:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C27313857706 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694450152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kPXX1KwxjlwSXTSdftMNAECXU8fy9PVTl2rzVeXjXcM=; b=STBxFv5LcUdxGZLbrvf4iAsp0wBqF7TVLNBYymKJZY4VTuxRrt1bPvuo9FLRhcPHmqN0Qq gdakcbOVfnUSaYvXkgCNmoiRvLC5isWJ8J8fTWjykrLSv8z8otyg1QtvOc0IgEI+GuzcYc lvD2M/tfDFrEf7VI0fBr0/fPoS935xs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-320-luio9XvgP_2lKbNMcD5C0Q-1; Mon, 11 Sep 2023 12:35:49 -0400 X-MC-Unique: luio9XvgP_2lKbNMcD5C0Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F03CB3813F2C; Mon, 11 Sep 2023 16:35:48 +0000 (UTC) Received: from localhost (unknown [10.42.28.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9844C2027045; Mon, 11 Sep 2023 16:35:48 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 13/13] libstdc++: Simplify dejagnu directives for some tests using threads Date: Mon, 11 Sep 2023 17:16:44 +0100 Message-ID: <20230911163534.1913512-14-jwakely@redhat.com> In-Reply-To: <20230911163534.1913512-1-jwakely@redhat.com> References: <20230911163534.1913512-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Replace dg-require-effective-target directives with a target selector on the dg-do directive. We can also remove { dg-require-effective-target pthread } and the associated { dg-options "-pthread" } by allowing it to run on non-pthread targets and conditionally adding -pthread only for pthread targets. libstdc++-v3/ChangeLog: * testsuite/20_util/shared_ptr/atomic/3.cc: Simplify dg directives. * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Likewise. * testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/allocate.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/allocate_single.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/cons.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/cons_single.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/is_equal.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/multithreaded.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/options.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/release.cc: Likewise. * testsuite/20_util/synchronized_pool_resource/release_single.cc: Likewise. * testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc: Likewise. * testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc: Likewise. * testsuite/30_threads/stop_token/stop_callback/destroy.cc: Likewise. --- libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc | 3 +-- .../20_util/shared_ptr/thread/default_weaktoshared.cc | 3 +-- .../20_util/shared_ptr/thread/mutex_weaktoshared.cc | 3 +-- .../20_util/synchronized_pool_resource/allocate.cc | 6 ++---- .../20_util/synchronized_pool_resource/allocate_single.cc | 3 +-- .../testsuite/20_util/synchronized_pool_resource/cons.cc | 6 ++---- .../20_util/synchronized_pool_resource/cons_single.cc | 3 +-- .../20_util/synchronized_pool_resource/is_equal.cc | 6 ++---- .../20_util/synchronized_pool_resource/multithreaded.cc | 6 ++---- .../testsuite/20_util/synchronized_pool_resource/options.cc | 6 ++---- .../testsuite/20_util/synchronized_pool_resource/release.cc | 6 ++---- .../20_util/synchronized_pool_resource/release_single.cc | 3 +-- .../30_threads/condition_variable_any/stop_token/wait_on.cc | 6 ++---- .../30_threads/stop_token/stop_callback/deadlock-mt.cc | 5 ++--- .../30_threads/stop_token/stop_callback/destroy.cc | 5 ++--- 15 files changed, 24 insertions(+), 46 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc index 8346191412c..19efcadb7ec 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc @@ -1,6 +1,5 @@ -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // Copyright (C) 2014-2023 Free Software Foundation, Inc. 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 20c910c2fcd..af0e65e9469 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 @@ -17,10 +17,9 @@ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } // { dg-add-options libatomic } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // { 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 d6c8611aa85..07f7c49bf10 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 @@ -17,10 +17,9 @@ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } // { dg-add-options libatomic } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // { dg-require-cstdint "" } diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc index f9a4a2f3694..822a410b6c2 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc index a29575fdd80..4acfde6e9d7 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as allocate.cc but without -pthread diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc index f8b74d9d8cc..a3f98586684 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc index ab215ba3c93..9668a51c346 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as cons.cc but without -pthread diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc index 5be6bd69663..aacf00b079c 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc index a7283bf5405..7992367ffda 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc index a869b993ee3..9d98b5038db 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc index d1c60432dd7..6752d6e270c 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc index f69e96034ad..9645bc64c02 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as release.cc but without -pthread diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc index edebaa6acab..bac1f3509b5 100644 --- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc +++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc @@ -15,11 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-do run } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } #include #include diff --git a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc index f6162879e54..e780955dbec 100644 --- a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc +++ b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc @@ -15,10 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include diff --git a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc index 6bdd4d13f54..f13761ca0fe 100644 --- a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc +++ b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc @@ -15,10 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include -- 2.41.0