From patchwork Wed Jun 12 01:16:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1946594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=NjcB1Vgz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzSLr1mQGz20Pb for ; Wed, 12 Jun 2024 11:17:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D099385DDC8 for ; Wed, 12 Jun 2024 01:17:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 959313858D39 for ; Wed, 12 Jun 2024 01:16:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 959313858D39 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 959313858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718155004; cv=none; b=CUc/MTryMAdIIXTsBks2ftEDWO7fbJMNCiUAjEe2fafyirfF0eiKKQH6LhVHMSkv7GIgk+Qxvu/0hpdQ44xuhKb1J6SKL+UD/5rds/e6Zd9cFyKciv2ENp2ASNU0WlTpwBaPcTM/m2yijFhXCFdTFneKeR0bMwkLAcTE0GwiLZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718155004; c=relaxed/simple; bh=vz47zP32He0yVecxkIBV2dUhVxOjIecYxLN59sDB8rQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AZ35zGXbXmW13Zm9yoqjIt7JaTQcumTpOYnAf6e6CfYyBSFdt+XY/ylpvV25u+HuSNh6stRIKIqEx0+VLNKSiPRHeailnKupisAgM61RSbbk5kOxKAhDrMhoiFDrGqnsr/UoZ01e/kCmfDnUfsUoeEmxGEPdVdyVvBRtoaGWH9M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1f6f031549bso16045525ad.3 for ; Tue, 11 Jun 2024 18:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718155000; x=1718759800; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:date:organization:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=dnaexosHGf5D9n4kVoRvrs8mNswaLbQo4sA/6TsDHsA=; b=NjcB1VgzQpJP6F+vtJMSbtW5DazOxrSvQ+lOoxr2VtJikcDoccsk8ApQbPu5rVRage SStemnTx+JV3RQ6O0BG72U0N93TEvOIRtR2z7CxJw5l74Du6x9ySG/QtjQuopTRsc01K QTiihkuxigVYayl5SymDwcwr3OJErJC4zeQcP6pfsWPaZ3CqS+bYb6rghSNorO4lXVSq 7f9SXRxYOl3YCLC7k8kDlZ+Z7F38ZulPGSgMqjzA7RdGqcX7om6H2j/NFsQpZG1rWAIn YVT0HhmjFphALMhhljT6Caw1d6sFW73JoIeCb0UJrdnqd0ejFHkQ+6ZBWLlkcK5I2F8l C8aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718155000; x=1718759800; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dnaexosHGf5D9n4kVoRvrs8mNswaLbQo4sA/6TsDHsA=; b=k+W8ojLYAMz2wg6TbcGXFXn1ux7MbMCQZKd/hgDVrLoJFLgIvnzxold/c2SEoOgAjt YkIHMlWR85IvZFq92RBaApyWcgD4pPkQUX8BDvXdw6gmqQBsZSygDN0mup1YG4pSYVz4 kDI2eNTIn2ghEyJ3hvMttT+N5EZxYFjzvUtGi/shuu9R0V5KHrB8WoH7m0+LqerRlXtg eRoOzallN+lj1txLB0v/PTIrs0scAOJEYaq0o02/MYkKdLUbjMOfUp5bM7qkSCiqfcMy wWl4CUkM6Uc3ohztGe5KyHA+KT2wCFNkXIlr3Zv/M8fdzohd20fuAc92eJYdHmiXr4Fx FmQA== X-Gm-Message-State: AOJu0YwfaeFpeW5Sg7UKDtZXq7LN6XDzAmp3Fd75O5bTa2JaIKzhVkRI 7c3rtOv9qLiDCOvz1+wWrE3ZUKCDJf/j/fJKj1XqjUoP3PL7aZb+8qfFUfNgsHckHArvqeEgBWs = X-Google-Smtp-Source: AGHT+IE/mY6h9+gvfOyAwJyRQE4UtlHIN8XR3prrkxk9sqZHK0ich5t7/V5te0TzTmCMbRb2Fg6ZPA== X-Received: by 2002:a17:902:d4d0:b0:1f7:e32f:f057 with SMTP id d9443c01a7336-1f83b5f7b15mr4946405ad.34.1718155000243; Tue, 11 Jun 2024 18:16:40 -0700 (PDT) Received: from free.home ([2804:7f1:218b:1961:ef8:d680:5399:8b1a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f741790ca9sm9745165ad.85.2024.06.11.18.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 18:16:39 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 45C1GTXq1124377 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 22:16:29 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [PATCH] [libstdc++] [testsuite] require cmath for c++23 cmath tests Organization: Free thinker, does not speak for AdaCore Date: Tue, 11 Jun 2024 22:16:29 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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 @@ // . // { dg-do link { target c++23 } } +// { dg-require-cmath "" } #include #include 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 @@ // . // { dg-do link { target c++23 } } +// { dg-require-cmath "" } #include #include 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 @@ // . // { dg-do run { target c++23 } } +// { dg-require-cmath "" } #include #include