public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [libstdc++] [testsuite] require cmath for c++23 cmath tests
@ 2024-06-12  1:16 Alexandre Oliva
  2024-06-12  7:20 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Oliva @ 2024-06-12  1:16 UTC (permalink / raw)
  To: gcc-patches, libstdc++


Some c++23 tests fail on targets that don't satisfy dg-require-cmath,
because referenced math functions don't get declared in std.  Add the
missing requirement.

Regstrapping on x86_64-linux-gnu.  Already successfully tested with
gcc-13 on aarch64-rtems, where it avoids the errors that come up because
math.h doesn't meet the cmath requirements there.  Ok to install?


for  libstdc++-v3/ChangeLog

	* testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc:
	Require cmath.
	* testsuite/26_numerics/headers/cmath/functions_std_c++23.cc:
	Likewise.
	* testsuite/26_numerics/headers/cmath/nextafter_std_c++23.cc:
	Likewise.
---
 .../headers/cmath/constexpr_std_c++23.cc           |    1 +
 .../headers/cmath/functions_std_c++23.cc           |    1 +
 .../26_numerics/headers/cmath/nextafter_c++23.cc   |    1 +
 3 files changed, 3 insertions(+)

diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc
index 0e3d112fe2e80..3c2377fd6987b 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do link { target c++23 } }
+// { dg-require-cmath "" }
 
 #include <stdfloat>
 #include <cmath>
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc
index 000cebf364aaa..ea68ac5da7551 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do link { target c++23 } }
+// { dg-require-cmath "" }
 
 #include <stdfloat>
 #include <cmath>
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc
index 7d7e10bd8aea3..91767d22cc3f2 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++23 } }
+// { dg-require-cmath "" }
 
 #include <stdfloat>
 #include <cmath>

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-13 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-12  1:16 [PATCH] [libstdc++] [testsuite] require cmath for c++23 cmath tests Alexandre Oliva
2024-06-12  7:20 ` Jonathan Wakely
2024-06-12 22:43   ` Alexandre Oliva
2024-06-13 10:35     ` Jonathan Wakely

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).