From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 3C3B33856DF8; Thu, 23 Jun 2022 12:22:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C3B33856DF8 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: testsuite: complex proj requirements X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 0cf884446a3cbeb41a598c07a46f4bf7dc098870 X-Git-Newrev: 39ccf6e6d6810f104a5a0e708c630be0fb340f81 Message-Id: <20220623122211.3C3B33856DF8@sourceware.org> Date: Thu, 23 Jun 2022 12:22:11 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2022 12:22:11 -0000 https://gcc.gnu.org/g:39ccf6e6d6810f104a5a0e708c630be0fb340f81 commit 39ccf6e6d6810f104a5a0e708c630be0fb340f81 Author: Alexandre Oliva Date: Mon Jun 20 19:43:55 2022 -0300 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. Diff: --- libstdc++-v3/testsuite/26_numerics/complex/proj.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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();