]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix var_arr_typedef.exp to preserve local variable
authorTom Tromey <tromey@adacore.com>
Wed, 10 Sep 2025 15:59:18 +0000 (09:59 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 10 Sep 2025 16:15:41 +0000 (10:15 -0600)
This patch fixes var_arr_typedef.exp to preserve a local variable a
bit better, protecting it from a gnat-llvm optimization.

gdb/testsuite/gdb.ada/var_arr_typedef/pack.adb
gdb/testsuite/gdb.ada/var_arr_typedef/pack.ads
gdb/testsuite/gdb.ada/var_arr_typedef/var_arr_typedef.adb

index 2f9114a2e63223a59c30330255345bc8bd606df7..80cfac1e84767e10925a8752a306094586fd682a 100644 (file)
@@ -20,6 +20,6 @@ package body Pack is
       return I;
    end Identity;
 
-   procedure Do_Nothing (A : Array_Type) is null;
+   procedure Do_Nothing (A : System.Address) is null;
 
 end Pack;
index 2ceb07180ef54c43c7f3c567e5cbad3af3a3a3f7..353ec4851802c25a9ab46575e75133984635ac2e 100644 (file)
@@ -13,6 +13,8 @@
 --  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 System; use System;
+
 package Pack is
    type Rec_Type is record
       I : Integer;
@@ -23,7 +25,7 @@ package Pack is
 
    type Array_Type is array (Positive range <>) of Vec_Type;
 
-   procedure Do_Nothing (A : Array_Type);
+   procedure Do_Nothing (A : System.Address);
    function Identity (I : Integer) return Integer;
 
 end Pack;
index 4a7f4cbca522efc63eb08ee5ddabf05305f6a36d..86609a8c9ba3dbb17433d133ba667009979a8a5e 100644 (file)
@@ -24,5 +24,5 @@ procedure Var_Arr_Typedef is
 
    A : constant Array_Type (1 .. Identity (4)) := (VA, VA, VB, VB);
 begin
-   Do_Nothing (A); --  BREAK
+   Do_Nothing (A'Address); --  BREAK
 end Var_Arr_Typedef;