]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Update gdb.ada/attr_ref_and_charlit for gnat-llvm
authorTom Tromey <tromey@adacore.com>
Thu, 23 Apr 2026 13:27:15 +0000 (07:27 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 23 Apr 2026 18:36:14 +0000 (12:36 -0600)
This patch changes the gdb.ada/attr_ref_and_charlit test to come
closer to passing with gnat-llvm.  This mostly works around some
existing problems in gnat-llvm, but since the changes are harmless and
help reduce the noise in the test results, I thought it would be
better to land this.

Because this is Ada-specific, I am checking this in.

gdb/testsuite/gdb.ada/attr_ref_and_charlit/foo.adb
gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.ads [new file with mode: 0644]

index fe0cb1b14b2698ee984b15a2b370f11e681371c5..d2754b83747faeaf7fb74a1928f681631c0cc9f1 100644 (file)
 --  You should have received a copy of the GNU General Public License
 --  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+with Pck; use Pck;
+
 procedure Foo is
-   procedure P (S : String) is
+   procedure P (In_Val : String) is
+      S : String := In_Val;
    begin
-      null; -- BREAK
+      Do_Nothing (S); -- BREAK
    end P;
 begin
    P ((2 => 'a', 3 => 'b'));
diff --git a/gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.adb b/gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.adb
new file mode 100644 (file)
index 0000000..82545b7
--- /dev/null
@@ -0,0 +1,21 @@
+--  Copyright 2026 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 <http://www.gnu.org/licenses/>.
+
+package body Pck is
+   procedure Do_Nothing (S : String) is
+   begin
+      null;
+   end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.ads b/gdb/testsuite/gdb.ada/attr_ref_and_charlit/pck.ads
new file mode 100644 (file)
index 0000000..d682068
--- /dev/null
@@ -0,0 +1,18 @@
+--  Copyright 2026 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 <http://www.gnu.org/licenses/>.
+
+package Pck is
+   procedure Do_Nothing (S : String);
+end Pck;