From patchwork Sun Jan 10 08:02:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 41689 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F46D3840C16; Sun, 10 Jan 2021 08:03:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F46D3840C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610265782; bh=cUtwGedcMu4REAv1sENYETRJdtYONkKA4Q7k9C5CKcs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=kYyyS+ah0iV452Fzov/GPMsATAZRBA+jDXGxHSj3TNW39sXvVsXLBVR6dTbfvBJju SBS43/TuGpZXLAeByOO2YPm/PTxyLpaZkh1KHQsWwumg1dcfQGOhSS6KPL8zp+Oddu GAmA/V4ToqrNo03MxckIhEv2e/QYLeLMb9K5UyH4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 5FB8A3858026 for ; Sun, 10 Jan 2021 08:02:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5FB8A3858026 Received: by mail-pg1-x530.google.com with SMTP id i7so10549044pgc.8 for ; Sun, 10 Jan 2021 00:02:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cUtwGedcMu4REAv1sENYETRJdtYONkKA4Q7k9C5CKcs=; b=b7wXPv+YUM79Rm49AYuhr7yge3d7oGE8k+a+s0N5eoBGo6R7TF5KQrXxQO6t6q2B4b 433Tzy/VJvpgSSe/sSYH7s13LQr7KAC6Wb2BfhzE0zrzQvugtBEQiRc4jTgf1/jQygUp 0Oma7SYDic+EdPPGDxdyqCNJVdsTXlBDl3a/zNgPhgBFCrHPGbqmPpQN6VH9TogFE+0m RjitVoXqQ357gAV7OExiD9NnSQtaZYjn/emlVW8XDDQEiDpukC8V4qTBcw2No2+clCmB +9yqZ8RgfEFkZLm7tXA+FioSRrX5R3xlgfx7yOxu6PHM1Lt7Pw46Q9/n152FC+HWa1Y4 FUSA== X-Gm-Message-State: AOAM530gp9tsKOHWKbQL07wcai4b3r8A3JcqbhgN3FtvB2OZQgKAdlyb zviMeVcvW/O1rDrxFX4h228tO5tS54M= X-Google-Smtp-Source: ABdhPJzOKg3LZ9jcetL6iNM26p0pSusckPUohRKEiMLhyxJ7X0rPkI7BL07Q9kIIEPLWYxszjyYnbg== X-Received: by 2002:a65:4983:: with SMTP id r3mr15125024pgs.288.1610265778219; Sun, 10 Jan 2021 00:02:58 -0800 (PST) Received: from localhost (g178.219-103-173.ppp.wakwak.ne.jp. [219.103.173.178]) by smtp.gmail.com with ESMTPSA id t8sm8992466pjd.51.2021.01.10.00.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 00:02:57 -0800 (PST) To: GLIBC patches Subject: [PATCH v2] math/testtgmath2: Fix fabs failure when no long double Date: Sun, 10 Jan 2021 17:02:41 +0900 Message-Id: <20210110080241.2003667-1-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stafford Horne via Libc-alpha From: Stafford Horne Reply-To: Stafford Horne Cc: Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" I have been testing with GCC trunk and GLIBC master while working on the OpenRISC port. This test has been failing with fabs not being called, This is caused as my architecture is configure with no long double meaning the two calls are the same: TEST (fabs (Vdouble1), double, fabs); TEST (fabs (Vldouble1), ldouble, fabs); Instead of the tgmath calls resolving to fabs and fabsl both calls are fabs. Next, do to compiler optimiations the second call is eliminated. Fix this by invoking the failing TEST with Vldouble2. Note, I also updated the FAIL message to more clearly show where the failure happened, so I see: FAIL: math/test-tgmath2 original exit status 1 wrong function called, fabs (ldouble) failure on line 174 Cc: Joseph Myers --- math/test-tgmath2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math/test-tgmath2.c b/math/test-tgmath2.c index 14a3453169..b8fb00c566 100644 --- a/math/test-tgmath2.c +++ b/math/test-tgmath2.c @@ -122,7 +122,7 @@ int counts[Tlast][C_last]; __asm __volatile ("" : : "r" (&texpr)); \ if (count != 1 || counts[T##type][C_##fn] != 1) \ { \ - FAIL ("wrong function called"); \ + FAIL ("wrong function called, "#fn" ("#type")"); \ memset (counts, 0, sizeof (counts)); \ } \ count = 0; \ @@ -171,7 +171,7 @@ test_fabs (const int Vint4, const long long int Vllong4) TEST (fabs (vcldouble1), ldouble, cabs); TEST (fabs (Vfloat1), float, fabs); TEST (fabs (Vdouble1), double, fabs); - TEST (fabs (Vldouble1), ldouble, fabs); + TEST (fabs (Vldouble2), ldouble, fabs); #ifndef __OPTIMIZE__ /* GCC is too smart to optimize these out. */ TEST (fabs (Vint1), double, fabs);