From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2C7763858418; Tue, 28 Jun 2022 08:30:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C7763858418 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-1315] libstdc++: testsuite: Guard use of C99 std::log2 X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 10caa98a3792caae367844f08946f849210c1753 X-Git-Newrev: 30aea28bd30027e0a6be8e3077828256779954b3 Message-Id: <20220628083041.2C7763858418@sourceware.org> Date: Tue, 28 Jun 2022 08:30:41 +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: Tue, 28 Jun 2022 08:30:41 -0000 https://gcc.gnu.org/g:30aea28bd30027e0a6be8e3077828256779954b3 commit r13-1315-g30aea28bd30027e0a6be8e3077828256779954b3 Author: Jonathan Wakely Date: Tue Jun 28 09:17:06 2022 +0100 libstdc++: testsuite: Guard use of C99 std::log2 This prevents the test from failing if the only thing not supported is the text printed to the log about the size of the floating-point type. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/4.cc: Only use log2 if C99 math functions are available. Diff: --- libstdc++-v3/testsuite/20_util/from_chars/4.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/testsuite/20_util/from_chars/4.cc b/libstdc++-v3/testsuite/20_util/from_chars/4.cc index dcd9f97c946..c27df4ffa5e 100644 --- a/libstdc++-v3/testsuite/20_util/from_chars/4.cc +++ b/libstdc++-v3/testsuite/20_util/from_chars/4.cc @@ -300,9 +300,11 @@ test_max_mantissa() if (Float_limits::is_iec559 && Float_limits::digits < UInt_limits::digits) { +#ifdef _GLIBCXX_USE_C99_MATH_TR1 std::printf("Testing %d-bit float, using %zu-bit integer\n", Float_limits::digits + (int)std::log2(Float_limits::max_exponent) + 1, sizeof(UIntT) * __CHAR_BIT__); +#endif std::from_chars_result res; FloatT flt;