From patchwork Fri Jan 10 16:13:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 104493 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 9A2313857B84 for ; Fri, 10 Jan 2025 16:14:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A2313857B84 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Jp4UTKnz X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id 09C603858C35 for ; Fri, 10 Jan 2025 16:13:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09C603858C35 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 09C603858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736525637; cv=none; b=ZXi8XiBQAdT7f60AN7gGc/B8pGivBWLqlSvzWyGxNNGkA9JbsdK4F0GrFKc7KqZSng9BAy8T1gJs45+PhcyXL21/POXHemfuJKKdtZcMrTpAwqWz5NZSotloDfFTV9XdTsejDVuv7TdV8lq+ENUxk0UxaG2sMEAkY1ZQHu2UU+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736525637; c=relaxed/simple; bh=UB/T2u0UAAcdVPf9yGDyJBjPt4g+18wYHbwHOeivQpo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jjQ3ThCHUrBU3UIWRri1V1JXYIP5ReKyP0G6yYCkYNcwk5dF2AsnB2cPpBbswqWOGv3Zpf5NNBRKFx1AnT60FA6cdGQDu2tkGOmd468M4TO0UvCNcoBHArkP8Wjt8yTqwLNAAd1ik6gqSLzRpgVtL/R7Vxt4pcrJybocTEECiWQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09C603858C35 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-844e10ef3cfso150222839f.2 for ; Fri, 10 Jan 2025 08:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1736525636; x=1737130436; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aeL/AiyGAI4COZvnLrUtjRXQdWsP+Pm9LuQsX2gbu2A=; b=Jp4UTKnzUQaIOXggsgnwqaYUTtvSprTZLzJy84qtmAG76JdLNuukg8V9VKePLB5Yht EcPJjMiBY/kE0drpib4yo42Dy5d6Or1FDAW3FfD6AU3PFmTzDHU61MmqOzxwZsiR1BDT awifrY86Rjs8O2nMGhZUxeyGMyPW6O1xqOvI8+2qmYLIIlRXWlDWJ9exq78KpNnLXahy RR46TvCXQRESfu3SY6qZU54JfESXjO3bQ/VsgeV/qhIp30K1WBt1MA17U6a0wKNj3Mhz UnLQ1PgG5FQvny1p8KXBSEbfFWMTKd852SBV6m3DUbgpikKgf1U/YROgAvrlOzx+SIbN 1qfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736525636; x=1737130436; 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=aeL/AiyGAI4COZvnLrUtjRXQdWsP+Pm9LuQsX2gbu2A=; b=wNRgzXi5WofvRdZ0O8fA5dfPeN5Cznte+htxNt5dF8M9mKl5osyY9WCQcr6FQmFaSG C7d11rKAJCaf4HHA0fsGAFwV4UxZZpu+WZbcSBl6T1nyqjP2zBPduV5QnsxBMmYXTdZn qBvcry9aUP1OsN6K05VI8wtDcZR4+r8raeDlp3sqNADdoclNc0Mjh8sqQ+0AjlNBQK4q jbpra2ZhT9kT3ME8NXF4rQSvKqX/VCxpW7t2b306gFmyP9adQFsjAkcoEKy5RSE5XhIM IvC7utLKp9/Vp6oYIWu0Lz+9wkGEpTNU20spdi8VG3qE0xDiAuU9C4hF0bjLiIyHAqGx KNhA== X-Gm-Message-State: AOJu0YyP+roc8aRVuXAx003KtSgZtiUWLL4Nf5FlEy6IszRRn3ZuBHwU bQGx4x2YJUHgjIkd/qfRUuCenOR1vzLOa6r0362wxurwlxLMHISmpNFEmJECrkTBFsTB8BvL6YI = X-Gm-Gg: ASbGncu2wxq2ocwFd67GSwO/1ZrU943PkO8sgodmhwXZ79cgb8XBzV8VLp9EMZVID0K FTWVItwTinvixVnI1v/0pfurFSh6VH82Su0VyTN8+8UrOY0lrd8NOg3zrz6wz7y6UmXd+D473FE 68Tj7Eh96UzFMrvYrMNs5gWEbg5jkQtqI57vT+uN84mcnBcbEBfNaCoxtfa0qp7jdZIc6GGdxnM wRPZhw/eFoyd4eYddg6B3GTFfEewcl54KPkCju4XnImnRbHQwWM9dSCrnCFOkwD+Q/7aydokGkf ajsrdfwdrz3Gi3YtAP/i X-Google-Smtp-Source: AGHT+IF96z9KVUGhrBJv53MBLJPMezsh4dPxaLEMzQJfSA7j5y/hFV6ur5W+u8SaQMPHiktJZwVRNA== X-Received: by 2002:a05:6e02:2607:b0:3ab:1b7a:5932 with SMTP id e9e14a558f8ab-3ce3aa72788mr100320935ab.18.1736525636089; Fri, 10 Jan 2025 08:13:56 -0800 (PST) Received: from localhost.localdomain (97-118-36-154.hlrn.qwest.net. [97.118.36.154]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ea1b5f9355sm962911173.9.2025.01.10.08.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 08:13:55 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Minor test case updates for gnat-llvm Date: Fri, 10 Jan 2025 09:13:48 -0700 Message-ID: <20250110161348.70118-1-tromey@adacore.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 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 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: 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~patchwork=sourceware.org@sourceware.org gnat-llvm seems to be a bit more aggressive about eliminating unused variables. This patch improves the test results a tiny bit by arranging for some variables to appear to be used. Note the copyright dates on the new files are done that way because I simply copied existing files. --- gdb/testsuite/gdb.ada/discrete-char/main.adb | 4 +++- gdb/testsuite/gdb.ada/discrete-char/pck.adb | 21 ++++++++++++++++++++ gdb/testsuite/gdb.ada/discrete-char/pck.ads | 19 ++++++++++++++++++ gdb/testsuite/gdb.ada/float-bits/pck.adb | 21 ++++++++++++++++++++ gdb/testsuite/gdb.ada/float-bits/pck.ads | 19 ++++++++++++++++++ gdb/testsuite/gdb.ada/float-bits/prog.adb | 6 +++++- gdb/testsuite/gdb.ada/multiarray/p.adb | 2 ++ gdb/testsuite/gdb.ada/multiarray/pack.adb | 21 ++++++++++++++++++++ gdb/testsuite/gdb.ada/multiarray/pack.ads | 3 +++ gdb/testsuite/gdb.ada/packed_record/pck.adb | 21 ++++++++++++++++++++ gdb/testsuite/gdb.ada/packed_record/pck.ads | 19 ++++++++++++++++++ gdb/testsuite/gdb.ada/packed_record/pr.adb | 3 ++- 12 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 gdb/testsuite/gdb.ada/discrete-char/pck.adb create mode 100644 gdb/testsuite/gdb.ada/discrete-char/pck.ads create mode 100644 gdb/testsuite/gdb.ada/float-bits/pck.adb create mode 100644 gdb/testsuite/gdb.ada/float-bits/pck.ads create mode 100644 gdb/testsuite/gdb.ada/multiarray/pack.adb create mode 100644 gdb/testsuite/gdb.ada/packed_record/pck.adb create mode 100644 gdb/testsuite/gdb.ada/packed_record/pck.ads diff --git a/gdb/testsuite/gdb.ada/discrete-char/main.adb b/gdb/testsuite/gdb.ada/discrete-char/main.adb index 4717387ffbc..4851a58b1ce 100644 --- a/gdb/testsuite/gdb.ada/discrete-char/main.adb +++ b/gdb/testsuite/gdb.ada/discrete-char/main.adb @@ -13,11 +13,13 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +with Pck; use Pck; + procedure Main is type Letters is new Character range 'A' .. 'Z'; type Array_Type is array (Letters) of Boolean; Array_Value : Array_Type := ('A' => true, 'Z' => true, others => false); begin - null; -- STOP + Do_Nothing (Array_Value'Address); -- STOP end Main; diff --git a/gdb/testsuite/gdb.ada/discrete-char/pck.adb b/gdb/testsuite/gdb.ada/discrete-char/pck.adb new file mode 100644 index 00000000000..a175b7bdc5a --- /dev/null +++ b/gdb/testsuite/gdb.ada/discrete-char/pck.adb @@ -0,0 +1,21 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package body Pck is + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/discrete-char/pck.ads b/gdb/testsuite/gdb.ada/discrete-char/pck.ads new file mode 100644 index 00000000000..384bf0832f6 --- /dev/null +++ b/gdb/testsuite/gdb.ada/discrete-char/pck.ads @@ -0,0 +1,19 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with System; +package Pck is + procedure Do_Nothing (A : System.Address); +end Pck; diff --git a/gdb/testsuite/gdb.ada/float-bits/pck.adb b/gdb/testsuite/gdb.ada/float-bits/pck.adb new file mode 100644 index 00000000000..a175b7bdc5a --- /dev/null +++ b/gdb/testsuite/gdb.ada/float-bits/pck.adb @@ -0,0 +1,21 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package body Pck is + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/float-bits/pck.ads b/gdb/testsuite/gdb.ada/float-bits/pck.ads new file mode 100644 index 00000000000..384bf0832f6 --- /dev/null +++ b/gdb/testsuite/gdb.ada/float-bits/pck.ads @@ -0,0 +1,19 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with System; +package Pck is + procedure Do_Nothing (A : System.Address); +end Pck; diff --git a/gdb/testsuite/gdb.ada/float-bits/prog.adb b/gdb/testsuite/gdb.ada/float-bits/prog.adb index 8a91b6e7359..21a2ae4b0b4 100644 --- a/gdb/testsuite/gdb.ada/float-bits/prog.adb +++ b/gdb/testsuite/gdb.ada/float-bits/prog.adb @@ -13,10 +13,14 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +with Pck; use Pck; + procedure Prog is Val_Float : Float := 23.0; Val_Double : Long_Float := -2.0e-19; Val_Long_Double : Long_Long_Float := 5.0e+25; begin - null; -- BREAK + Do_Nothing (Val_Float'Address); -- BREAK + Do_Nothing (Val_Double'Address); + Do_Nothing (Val_Long_Double'Address); end Prog; diff --git a/gdb/testsuite/gdb.ada/multiarray/p.adb b/gdb/testsuite/gdb.ada/multiarray/p.adb index 3880ad63dd4..ca568be5869 100644 --- a/gdb/testsuite/gdb.ada/multiarray/p.adb +++ b/gdb/testsuite/gdb.ada/multiarray/p.adb @@ -42,5 +42,7 @@ begin Nop; -- START Discard (Simple, Nested); + Do_Nothing (Simple'Address); + Do_Nothing (Nested'Address); end P; diff --git a/gdb/testsuite/gdb.ada/multiarray/pack.adb b/gdb/testsuite/gdb.ada/multiarray/pack.adb new file mode 100644 index 00000000000..767221fc2da --- /dev/null +++ b/gdb/testsuite/gdb.ada/multiarray/pack.adb @@ -0,0 +1,21 @@ +-- Copyright 2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package body Pack is + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pack; diff --git a/gdb/testsuite/gdb.ada/multiarray/pack.ads b/gdb/testsuite/gdb.ada/multiarray/pack.ads index 38ceb71d0e3..f6f0ca1880b 100644 --- a/gdb/testsuite/gdb.ada/multiarray/pack.ads +++ b/gdb/testsuite/gdb.ada/multiarray/pack.ads @@ -13,6 +13,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +with System; package Pack is type Index_Type_1 is new Natural; @@ -31,4 +32,6 @@ package Pack is array (Index_Type_1 range <>, Index_Type_2 range <>) of CA_Simple_Type; + procedure Do_Nothing (A : System.Address); + end Pack; diff --git a/gdb/testsuite/gdb.ada/packed_record/pck.adb b/gdb/testsuite/gdb.ada/packed_record/pck.adb new file mode 100644 index 00000000000..a175b7bdc5a --- /dev/null +++ b/gdb/testsuite/gdb.ada/packed_record/pck.adb @@ -0,0 +1,21 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package body Pck is + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/packed_record/pck.ads b/gdb/testsuite/gdb.ada/packed_record/pck.ads new file mode 100644 index 00000000000..384bf0832f6 --- /dev/null +++ b/gdb/testsuite/gdb.ada/packed_record/pck.ads @@ -0,0 +1,19 @@ +-- Copyright 2014-2024 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with System; +package Pck is + procedure Do_Nothing (A : System.Address); +end Pck; diff --git a/gdb/testsuite/gdb.ada/packed_record/pr.adb b/gdb/testsuite/gdb.ada/packed_record/pr.adb index 4dd41fa3fbe..621ee1e66e7 100644 --- a/gdb/testsuite/gdb.ada/packed_record/pr.adb +++ b/gdb/testsuite/gdb.ada/packed_record/pr.adb @@ -13,6 +13,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +with Pck; use Pck; procedure pr is type Report is (Hello, Goodbye); @@ -30,6 +31,6 @@ procedure pr is begin - null; -- STOP + Do_Nothing(Var'Address); -- STOP end pr;