Message ID | 20230404135747.3576298-1-josimmon@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> 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 8FE723853D2D for <patchwork@sourceware.org>; Tue, 4 Apr 2023 13:58:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FE723853D2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680616709; bh=KnmbrQNAO6vogkcavugLBxSWNLzJVGcFrl2ceDOXedw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=TJRhFsz1rIB5/rkID6yXQ0yh0dLAdh6leRL6oEvfsMU1O8BBpKOcs1EDpQm24dbKq dEvMsDRuqOn7gb2lAwIrJEdFbwJ3EVUGofuJi8yk0PRC14Yj5Kd3MhKyitK3QGVkTr qM5dzhJc/tlCbNEoKlUTnrEJr/RsM4zvb5aE2BIA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 62AB53858C54 for <libc-alpha@sourceware.org>; Tue, 4 Apr 2023 13:58:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62AB53858C54 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-331-amsPM0ntMqiEXlK7zHLLTQ-1; Tue, 04 Apr 2023 09:58:03 -0400 X-MC-Unique: amsPM0ntMqiEXlK7zHLLTQ-1 Received: by mail-qt1-f199.google.com with SMTP id v10-20020a05622a130a00b003e4ee70e001so16008863qtk.6 for <libc-alpha@sourceware.org>; Tue, 04 Apr 2023 06:58:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680616683; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KnmbrQNAO6vogkcavugLBxSWNLzJVGcFrl2ceDOXedw=; b=MVY5jbL7qvK7lcgz2oYkSxTfPdspZAWypynFbC9NtJ2EvqOioBN5KElS41by7EnVUE H7lJbSnT5Eb86J3kPcrWU81wz8B/27UrMqTkO9DyChKv5/ovZMmlRXEzP07r5u7gQjpr 4s4J0jfXQshWd8QL9s8NQu61Pvv1LsXWsfXqm+1hss09f7pfOoC/yo/qTsJ78DZSHmIa VboJbZ5PhUP1/mnS2/FAnUs6NZZ/E+jlEVWCA94a/PJcU8i3VZXECO+wLjc9uFoWZy4G AApHmScL9pecXCPGVtGrX3JtTHUDd8Ei0osp2ujukw/cOTpi0lEk+LmbLjkD6OhUKk+t rXWg== X-Gm-Message-State: AAQBX9eQ57QB4zrn1A/72Kf2Ni3/FRGRFw2gxFe3ubypiMfu5ATWomDZ 5X6JEwIoChFJWbxPWyl3n0jniCY9hex49rL/UOP1ME7qT/tlZgstWJ4XDpaYceivu3S5ArBVklV ZoIr547ZxPyE42jyHmB8V X-Received: by 2002:ac8:7c43:0:b0:3e3:89a5:192f with SMTP id o3-20020ac87c43000000b003e389a5192fmr3627777qtv.61.1680616683382; Tue, 04 Apr 2023 06:58:03 -0700 (PDT) X-Google-Smtp-Source: AKy350ZhWNemre0Ke3MopbOYN+HIS6fDVvynz2hIwpoMWwf0AGyHck+Sm/fanjfbBanHR63DwW7egg== X-Received: by 2002:ac8:7c43:0:b0:3e3:89a5:192f with SMTP id o3-20020ac87c43000000b003e389a5192fmr3627750qtv.61.1680616683138; Tue, 04 Apr 2023 06:58:03 -0700 (PDT) Received: from oak.redhat.com (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id i7-20020a37b807000000b0074a5ffbecd3sm167759qkf.49.2023.04.04.06.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 06:58:02 -0700 (PDT) To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>, libc-alpha@sourceware.org Cc: Joe Simmons-Talbott <josimmon@redhat.com> Subject: [PATCH v2 0/3] Add tests for abs(), labs(), llabs() (BZ #30263) Date: Tue, 4 Apr 2023 09:57:44 -0400 Message-Id: <20230404135747.3576298-1-josimmon@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Joe Simmons-Talbott via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Joe Simmons-Talbott <josimmon@redhat.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Add tests for abs(), labs(), llabs() (BZ #30263)
|
|
Message
Joe Simmons-Talbott
April 4, 2023, 1:57 p.m. UTC
Add testcases for abs(), labs(), and llabs(). Test the bounds of the given type, zero, and part of the full range of values for labs() and llabs(). Test the full range for abs(). Changes in V2: Reduce number of iterations by using a prime interval. For llabs() test the 32bit crossover point. Joe Simmons-Talbott (3): stdlib: Add testcases for abs(). (BZ #30263) stdlib: Add testcases for labs(). (BZ #30263) stdlib: Add testcases for llabs(). (BZ #30263) stdlib/Makefile | 7 ++++++ stdlib/tst-abs.c | 45 +++++++++++++++++++++++++++++++++++++ stdlib/tst-labs.c | 51 ++++++++++++++++++++++++++++++++++++++++++ stdlib/tst-llabs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 stdlib/tst-abs.c create mode 100644 stdlib/tst-labs.c create mode 100644 stdlib/tst-llabs.c
Comments
On Tue, Apr 04, 2023 at 09:57:44AM -0400, Joe Simmons-Talbott wrote: Gentle ping. Thanks, Joe > Add testcases for abs(), labs(), and llabs(). Test the bounds of the > given type, zero, and part of the full range of values for labs() and > llabs(). Test the full range for abs(). > > Changes in V2: > Reduce number of iterations by using a prime interval. For llabs() test > the 32bit crossover point. > > Joe Simmons-Talbott (3): > stdlib: Add testcases for abs(). (BZ #30263) > stdlib: Add testcases for labs(). (BZ #30263) > stdlib: Add testcases for llabs(). (BZ #30263) > > stdlib/Makefile | 7 ++++++ > stdlib/tst-abs.c | 45 +++++++++++++++++++++++++++++++++++++ > stdlib/tst-labs.c | 51 ++++++++++++++++++++++++++++++++++++++++++ > stdlib/tst-llabs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 158 insertions(+) > create mode 100644 stdlib/tst-abs.c > create mode 100644 stdlib/tst-labs.c > create mode 100644 stdlib/tst-llabs.c > > -- > 2.39.2 >
On Wed, Apr 19, 2023 at 10:23:28AM -0400, Joe Simmons-Talbott via Libc-alpha wrote: > On Tue, Apr 04, 2023 at 09:57:44AM -0400, Joe Simmons-Talbott wrote: > > Gentle ping. x2 Thanks, Joe
Hi Joe, > Add testcases for abs(), labs(), and llabs(). Test the bounds of the > given type, zero, and part of the full range of values for labs() and > llabs(). Test the full range for abs(). > > Changes in V2: > Reduce number of iterations by using a prime interval. For llabs() test > the 32bit crossover point. v2 looks good to me. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Cheers, Wilco
On 2023-05-04 08:53, Wilco Dijkstra via Libc-alpha wrote: > Hi Joe, > >> Add testcases for abs(), labs(), and llabs(). Test the bounds of the >> given type, zero, and part of the full range of values for labs() and >> llabs(). Test the full range for abs(). >> >> Changes in V2: >> Reduce number of iterations by using a prime interval. For llabs() test >> the 32bit crossover point. > > v2 looks good to me. > > Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> I've pushed these now. Thanks, Sid
* Siddhesh Poyarekar: > On 2023-05-04 08:53, Wilco Dijkstra via Libc-alpha wrote: >> Hi Joe, >> >>> Add testcases for abs(), labs(), and llabs(). Test the bounds of the >>> given type, zero, and part of the full range of values for labs() and >>> llabs(). Test the full range for abs(). >>> >>> Changes in V2: >>> Reduce number of iterations by using a prime interval. For llabs() test >>> the 32bit crossover point. >> v2 looks good to me. >> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> > > I've pushed these now. This breaks on various 32-bit architectures. As seen on microblaze: tst-llabs.c: In function ‘do_test’: tst-llabs.c:40:12: error: overflow in conversion from ‘long long int’ to ‘long int’ changes value from ‘-9223372036854775807’ to ‘1’ [-Werror=overflow] 40 | for (i = LLONG_MIN + 1; i < LLONG_MIN + INT_MAX; i += LARGE_PRIME) | ^~~~~~~~~ tst-llabs.c:43:12: error: overflow in conversion from ‘long long int’ to ‘long int’ changes value from ‘9223372034707292160’ to ‘-2147483648’ [-Werror=overflow] 43 | for (i = LLONG_MAX - INT_MAX; i < LLONG_MAX - LARGE_PRIME; i += LARGE_PRIME) | ^~~~~~~~~ cc1: all warnings being treated as errors Thanks, Florian