summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2022-06-27 10:34:18 -0300
committerAlexandre Oliva <oliva@gnu.org>2022-06-27 10:34:18 -0300
commit3e3744d37e001999fadb90e2d69173ec1b259869 (patch)
treed3ed14020a91d7b7ff3263c0b4687522109b54de /libstdc++-v3
parent0a3bb459e59e61bc52218dc6aa41c746d309f6a2 (diff)
libstdc++: testsuite: complex proj requirements
The template version of complex::proj returns its argument without testing for infinities, and that's all we have when neither C99 complex nor C99 math functions are available, and it seems too hard to do better without isinf and copysign. I suppose just calling them and expecting users will supply specializations as needed has been ruled out, and so has refraining from defining it when it can't be implemented correctly. It's pointless to run the proj.cc test under these circumstances, so arrange for it to be skipped. In an unusual way, after trying to introduce dg-require tests for ccomplex-or-cmath, and found their results to be misleading due to variations across -std=* versions. for libstdc++-v3/ChangeLog * testsuite/26_numerics/complex/proj.cc: Skip test in the circumstances in which the implementation of proj is known to be broken.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/proj.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/proj.cc b/libstdc++-v3/testsuite/26_numerics/complex/proj.cc
index a053119197c..69f8153c06f 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex/proj.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex/proj.cc
@@ -397,6 +397,19 @@ test03()
int
main()
{
+ /* If neither of these macros is nonzero, proj calls a
+ specialization of the __complex_proj template, that just returns
+ its argument, without testing for infinities, rendering the whole
+ test pointless, and failing (as intended/noted in the
+ implementation) the cases that involve infinities. Alas, the
+ normal ways to skip tests may not work: we don't have a test for
+ C99_COMPLEX, and these macros may vary depending on -std=*, but
+ macro tests wouldn't take them into account. */
+#if ! (_GLIBCXX_USE_C99_COMPLEX || _GLIBCXX_USE_C99_MATH_TR1)
+ if (true)
+ return 0;
+#endif
+
test01();
test02();
test03();