From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TOFYLN9JWWpoSw0AWB0awg (envelope-from ) for ; Thu, 16 Jul 2026 17:15:11 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dDk6MPuB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A3BC51E09E; Thu, 16 Jul 2026 17:15:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E289D1E033 for ; Thu, 16 Jul 2026 17:15:09 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E4684BA2E3F for ; Thu, 16 Jul 2026 21:15:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E4684BA2E3F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dDk6MPuB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A8CA84BA2E0D for ; Thu, 16 Jul 2026 21:14:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A8CA84BA2E0D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A8CA84BA2E0D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784236485; cv=none; b=ldUoGTD5t+AEcwa4HXEdcxJlDD+4/NNU9ezJ8lQv8OBiEu4JJIIm/YhXWwOiCTuND/+ETdx4CacCKPf0Zy0jlFxcYwa1yk/vFoZszll1qa64R1zf/Lue1k2/K3Lc1+9ur9OjqyBuuTKekuSxSGOv08VPR7Hw6c5UO+zwAT5hE0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784236485; c=relaxed/simple; bh=luRLFmzFrT1G3DVNGYwTKYiKcqm1XSANti1oCWHKyHU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qR2WgE4SaBb4vy6I4johHXhAopvxsBvH8kLe8S3u0/ZyJjpcbTl9l5D5pMkqwBJE6bb5t8/9fuGK3/Pa27wIOkPSrOP3ET5qZA+zyUYxe1JuVg4bvGaSFHOBmTsOa7WKv7olQo4iUpnR/MOWLMWeaftTw/LbFeU7lExmiMdmyyc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dDk6MPuB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8CA84BA2E0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784236485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7UpOj7IUfoijrV92qGJIhbT4oO/yLrzDOlbHI+8gkLI=; b=dDk6MPuBbb0m6SiVwWCuG9SVPVIXwWvE1FUDNRl1tabaGF5wCbtM//hzhX6+RsKCh3O8Pc o7Mb77bXMJxKoRxdJWOhxJoUv3qmyX121MeEgxQV0wUm9yX1QA7pkOTtx+0FT1qnpakU1h zHpicE1h++opdIISb0d0+nWv4Vqphjc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-SW053wNZP2aKCBU8fSWWwA-1; Thu, 16 Jul 2026 17:14:43 -0400 X-MC-Unique: SW053wNZP2aKCBU8fSWWwA-1 X-Mimecast-MFC-AGG-ID: SW053wNZP2aKCBU8fSWWwA_1784236482 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-493bb6a4336so60561575e9.3 for ; Thu, 16 Jul 2026 14:14:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784236482; x=1784841282; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=7UpOj7IUfoijrV92qGJIhbT4oO/yLrzDOlbHI+8gkLI=; b=mtU9yQMXClDUjvpdwVVBLJghRz4OpKS6HIcmuwlZo5lLyw8Ez82s3rVFDGRw+KHiLC sqyE240zUdFpyFkmuD12NmxAPM1oWA9djxwKL5Yg57y7wSMkoTtgqADn1dA24beow4p7 K+KYOJzOXshdhvyuZjIZkz8OJupovlhwqDUIU+ISVLpFot8ZDsngKew+K+gD7zlX8LJx 1fuZy+3PsVnthQjTT9fsaC8u0KoX4AkXguWhzjDeCGEOtu6WFUettOyegXZuXpPXlaoS Y3Wq/jWAYzLAD/4jYJn3/hZr9bSBwjmH4zyOoxKCpDDyr8zRB1fN4SWW/ZPY8pFB/d08 BRiA== X-Forwarded-Encrypted: i=1; AHgh+RqBwQFolNJsS4OaOU+D7K1w7Qk5Ekx1hbRct0v1eiCoHTeBCAKsts5jfEDeCpnGoruWFAcMBz/kuBwKng==@sourceware.org X-Gm-Message-State: AOJu0YxgVFib8FQcAc0O4Ceou9hUYACJ9t6jEpj29ArQtY0+5E0Kz1h8 3j8zHUSTB9bLi6KVvTy5pgjhmr68OaCw5Ho67D8j9IIYV95TQiC+BEgVwAKKryKildWKWZFTEA5 9n0XdOvQQnhOz4UtXbpLsX5ytSZpG3Ya570WHx7yZPZSMX+e4dDKpzR+FPiznaotP3EvIcWQ= X-Gm-Gg: AfdE7ckWDTPjjYs0wLboQ3T936aEeM4QHibb6AkLECdH0jYBPJRttOuksXa3nIUsrFT 5sdm+H76fvpfUT3BNKs1zzWJq6lEo5DFLg7yF55FAWjWFKxzZgrzVrHk9gM8fdyMMoGr46dhGdA Nb+tBPehdkVjbOHYdeWqcm6v3AKkHfswk3uJb10reDf3CaA66RXptah+KWpHlrBcDi6D6sCDRfF l8EoTTKdh3uB9Gt3eUXgY2GsiLcPG/2AEMDtFz2G+DqzwbWDuzo7HZDtVIMMuMmw75UE2AvdR9n VhpDhp+N1aEpRzEiWI6CkZ+Tq4CW92cKSctM8enhHv8AEk6bYRzX128wqdaL9b7GJbn1+PPL X-Received: by 2002:a05:600c:1394:b0:495:47b9:f46 with SMTP id 5b1f17b1804b1-49547b90f78mr19330945e9.39.1784236482382; Thu, 16 Jul 2026 14:14:42 -0700 (PDT) X-Received: by 2002:a05:600c:1394:b0:495:47b9:f46 with SMTP id 5b1f17b1804b1-49547b90f78mr19330675e9.39.1784236481865; Thu, 16 Jul 2026 14:14:41 -0700 (PDT) Received: from localhost ([31.111.209.233]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49549c97a08sm359855e9.7.2026.07.16.14.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 14:14:41 -0700 (PDT) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 1/4] gdb.base/nodebug.exp: Add long double testing In-Reply-To: <20260714220631.1499846-2-pedro@palves.net> References: <20260714220631.1499846-1-pedro@palves.net> <20260714220631.1499846-2-pedro@palves.net> Date: Thu, 16 Jul 2026 22:14:40 +0100 Message-ID: <87zezqd4cf.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: gKQlmNZ2TbejHtE92uXRX1-Wh9RCwGNoFT75_oBgeZg_1784236482 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Pedro Alves writes: > gdb.base/nodebug.exp is missing testing calling long double functions. > This commit adds such tests. > > With a GDB that doesn't know that "long double" is 64-bit on > x86_64-pc-windows-msvc, we get: > > FAIL: gdb.base/nodebug.exp: p (long double) mult_long_double(2.0L, 3.0L) > FAIL: gdb.base/nodebug.exp: p ((long double (*) (long double, long double)) mult_long_double)(2.0L, 3.0L) > FAIL: gdb.base/nodebug.exp: p ((long double (*) (long double, long double)) mult_long_double)(2, 3) > FAIL: gdb.base/nodebug.exp: p ((long double (*) ()) mult_long_double_noproto)(2.0L, 3.0L) > > Passes cleanly on: > > - x86_64-pc-linux-gnu > - x86_64-w64-mingw32 > - x86_64-pc-windows-msvc, with the "long double" fix > > Change-Id: If9ee749187e1d30fedcba17ae12634f3bd90de2f > --- > gdb/testsuite/gdb.base/nodebug.c | 13 +++++++++++++ > gdb/testsuite/gdb.base/nodebug.exp | 6 ++++++ > 2 files changed, 19 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/nodebug.c b/gdb/testsuite/gdb.base/nodebug.c > index c7bc93991b8..275a9d6ff60 100644 > --- a/gdb/testsuite/gdb.base/nodebug.c > +++ b/gdb/testsuite/gdb.base/nodebug.c > @@ -72,6 +72,12 @@ mult (double v1, double v2) > return v1 * v2; > } > > +long double > +mult_long_double (long double v1, long double v2) > +{ > + return v1 * v2; > +} > + > double > mult_noproto (v1, v2) > double v1, v2; > @@ -79,6 +85,13 @@ mult_noproto (v1, v2) > return v1 * v2; > } > > +long double > +mult_long_double_noproto (v1, v2) > + long double v1, v2; > +{ > + return v1 * v2; > +} Not that it really matters, but the ordering seems a bit weird, the existing functions are all: X X_noproto Y Y_noproto etc... but you broke this pattern. I only mention it because I have some actual worthwhile points to raise below... > + > uint8_t > add8 (uint8_t v1, uint8_t v2) > { > diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp > index e4138a801da..1a16e86ed2c 100644 > --- a/gdb/testsuite/gdb.base/nodebug.exp > +++ b/gdb/testsuite/gdb.base/nodebug.exp > @@ -78,6 +78,12 @@ proc test_call_promotion {} { > gdb_test "p ((double (*) ()) mult_noproto)(2.0f, 3.0f)" " = 6" > gdb_test "p ((double (*) ()) mult_noproto)(2.0, 3.0)" " = 6" > > + # Same, but for long double. > + gdb_test "p (long double) mult_long_double(2.0L, 3.0L)" " = 6" > + gdb_test "p ((long double (*) (long double, long double)) mult_long_double)(2.0L, 3.0L)" " = 6" > + gdb_test "p ((long double (*) (long double, long double)) mult_long_double)(2, 3)" " = 6" > + gdb_test "p ((long double (*) ()) mult_long_double_noproto)(2.0L, 3.0L)" " = 6" I noticed that the double test also includes a case which tests float to double promotion, but that case is skipped here. Wouldn't it be a good idea to include both float to long double and double to long double tests here too? Thanks, Andrew > + > # Check that GDB promotes char->int correctly. > gdb_test "p /d (uint8) add8((uint8) 2, (uint8) 3)" " = 5" > gdb_test "p /d ((uint8 (*) (uint8, uint8)) add8)((uint8) 2, (uint8) 3)" " = 5" > -- > 2.54.0