From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 733183858418 for ; Tue, 28 Jun 2022 08:31:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 733183858418 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-14-fdJKpZ_sNtiHMP5uBlQFRw-1; Tue, 28 Jun 2022 04:31:10 -0400 X-MC-Unique: fdJKpZ_sNtiHMP5uBlQFRw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9BB273C0F36E; Tue, 28 Jun 2022 08:31:10 +0000 (UTC) Received: from localhost (unknown [10.33.36.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64E3F2026D64; Tue, 28 Jun 2022 08:31:10 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: testsuite: Guard use of C99 std::log2 Date: Tue, 28 Jun 2022 09:31:09 +0100 Message-Id: <20220628083109.144301-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2022 08:31:16 -0000 Tested x86_64-linux, poushed to trunk. -- >8 -- 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. --- 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; -- 2.36.1