From patchwork Thu Jan 14 00:25:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 41716 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 6CA8B3844006; Thu, 14 Jan 2021 00:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CA8B3844006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610583970; bh=rxeJxgSnMOHhzk1BTTjO+y3DPTqzcOkUQafUw528Vbo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=QZH4o8xwuVNi7Z0uRDK8yJhKYyyXY175Je6RXoO9lXvwwc5+/RM1t5ZVZt4GkTR9y 1ko0KF+/98kQpAFJ95ejF2PoS/1/TldkiNUqHZZ3Isp2Iy79gSNfg5emBxX9HSS0Do b4s1iu0S3fpx5FAIfnzdsO+YisgKkRBLxgeaiHnM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id CFFBF384B823 for ; Thu, 14 Jan 2021 00:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CFFBF384B823 Received: by mail-pj1-x1036.google.com with SMTP id p12so2126327pju.5 for ; Wed, 13 Jan 2021 16:26:07 -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=rxeJxgSnMOHhzk1BTTjO+y3DPTqzcOkUQafUw528Vbo=; b=tXG3rUEf5EneSVRJpORRKwvwJfRz+mynFAiqAwkrJ+lj31Q/RBfZJvoB4js7N1xceS 8IpmAattXUpFtBxl7szm2gOKvhvbWZIEl9J81GvXs771y9TnD91ZZMle8QX5n3CLTkVO eDWOmABgyWuHEBPGme/2inV6VpKYIvyq8EgHfdCLEzrK23BIVJB4ysgtCYa0a3YG83gt jhyKe1fr8JCe8WjSjA/+o+AcxILOizO4A7LtaULEig2AIYOfUApJ+4EdiDfMF/ikzvKs sxHHG+zb+0UwRUZ/jof5vlx2GhR0GpF7VKIzVB7wRbTpfc42eG7fFNfjLVuC5XGC9cRf OOmg== X-Gm-Message-State: AOAM532Bu4MgwWOCcMa9w0vVOM4+o6iCmTnaUKyfdEcvPREYP0m5siT8 DsbWrf/aVxE9o/xqf1CU0DrRNz6/eRI= X-Google-Smtp-Source: ABdhPJzVGOiIkmY0eqtAHfXDC42kCJQE8/JdZP4Rtc2nHT4o7P7DI1b9QA2NEubRJ0augmh1cj7/UA== X-Received: by 2002:a17:902:b60e:b029:de:4450:ee0b with SMTP id b14-20020a170902b60eb02900de4450ee0bmr2333060pls.32.1610583966287; Wed, 13 Jan 2021 16:26:06 -0800 (PST) Received: from localhost (g238.115-65-210.ppp.wakwak.ne.jp. [115.65.210.238]) by smtp.gmail.com with ESMTPSA id g75sm3491043pfb.2.2021.01.13.16.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 16:26:05 -0800 (PST) To: GLIBC patches Subject: [PATCH v3] math/test-tgmath2: Fix fabs failure when no long double Date: Thu, 14 Jan 2021 09:25:58 +0900 Message-Id: <20210114002558.2827978-1-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 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 --- Thanks Joseph for reviewing. Shall I commit? I may have access, but I don't think I have been blessed to do so yet. Since v2: - Fixed typo with missing hyphen in subject line Since v1: - Rewrote patch to just change double value 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);