]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add missing -pthread for new tests [PR122401]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 24 Oct 2025 10:38:22 +0000 (11:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 27 Oct 2025 18:24:20 +0000 (18:24 +0000)
These new multithreaded tests need -pthread for targets that don't
include all pthreads symbols in libc (including older Glibc in
particular).

The 30_threads/shared_timed_mutex/try_lock_until/116586.cc test is not
fixed by this commit, because it needs a different fix for older Glibc.

libstdc++-v3/ChangeLog:

PR libstdc++/122401
* testsuite/20_util/shared_ptr/atomic/pr118757.cc: Add -pthread
for et pthread.
* testsuite/20_util/weak_ptr/pr118757.cc: Likewise.
* testsuite/30_threads/condition_variable/members/116586.cc:
Likewise. Only run for hosted targets with gthreads support.
* testsuite/30_threads/future/members/116586.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/116586.cc:
Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/116586.cc:
Likewise.

libstdc++-v3/testsuite/20_util/shared_ptr/atomic/pr118757.cc
libstdc++-v3/testsuite/20_util/weak_ptr/pr118757.cc
libstdc++-v3/testsuite/30_threads/condition_variable/members/116586.cc
libstdc++-v3/testsuite/30_threads/future/members/116586.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/116586.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/116586.cc

index d54abd8a0392848c3e9d1f2ca1a5fc39b0a88109..f49ae38aa669674aed12314f8f78136df431547b 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do run { target c++20 } }
+// { dg-additional-options "-pthread" { target pthread } }
 // { dg-require-gthreads "" }
 // { dg-require-effective-target hosted }
 
index f048f13aec258bb0539aae198f1facb66025caa0..77757f3c6c2a475f976ffec333b3d9e388706575 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do run { target c++20 } }
+// { dg-additional-options "-pthread" { target pthread } }
 // { dg-require-gthreads "" }
 // { dg-require-effective-target hosted }
 
index 71140078d4183c6f474eaff5a97ddb56b27adeea..e8c3e1634e27270af23ebc953e61e49a3da8854a 100644 (file)
@@ -1,4 +1,7 @@
 // { dg-do run { target c++11 } }
+// { dg-additional-options "-pthread" { target pthread } }
+// { dg-require-gthreads "" }
+// { dg-require-effective-target hosted }
 
 #include <condition_variable>
 #include <chrono>
index b7cd12c6009c213e31157d46cb1231f189aead34..82f1e5c1be24903d3f78ff21d9b1005b086aa9b0 100644 (file)
@@ -1,4 +1,7 @@
 // { dg-do run { target c++11 } }
+// { dg-additional-options "-pthread" { target pthread } }
+// { dg-require-gthreads "" }
+// { dg-require-effective-target hosted }
 
 #include <future>
 #include <chrono>
index 941f3af16b987d6717bc661bc7b4e8156e805a25..25a78e72f4657d774e2ee09376c06e612590f2ab 100644 (file)
@@ -1,4 +1,7 @@
 // { dg-do run { target c++11 } }
+// { dg-additional-options "-pthread" { target pthread } }
+// { dg-require-gthreads "" }
+// { dg-require-effective-target hosted }
 
 #include <mutex>
 #include <chrono>
index dcba7aa2f8ca05f42fde3c159433420d875b3100..156622818912b10254607a359d6422b0595c3fb6 100644 (file)
@@ -1,4 +1,7 @@
 // { dg-do run { target c++11 } }
+// { dg-additional-options "-pthread" { target pthread } }
+// { dg-require-gthreads "" }
+// { dg-require-effective-target hosted }
 
 #include <chrono>
 #include <mutex>