From: Tom Tromey Date: Wed, 10 Sep 2025 15:59:18 +0000 (-0600) Subject: Fix var_arr_typedef.exp to preserve local variable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2fe19b88c905d521b9e9bcd4171817b860a1cc4c;p=thirdparty%2Fbinutils-gdb.git Fix var_arr_typedef.exp to preserve local variable This patch fixes var_arr_typedef.exp to preserve a local variable a bit better, protecting it from a gnat-llvm optimization. --- diff --git a/gdb/testsuite/gdb.ada/var_arr_typedef/pack.adb b/gdb/testsuite/gdb.ada/var_arr_typedef/pack.adb index 2f9114a2e63..80cfac1e847 100644 --- a/gdb/testsuite/gdb.ada/var_arr_typedef/pack.adb +++ b/gdb/testsuite/gdb.ada/var_arr_typedef/pack.adb @@ -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; diff --git a/gdb/testsuite/gdb.ada/var_arr_typedef/pack.ads b/gdb/testsuite/gdb.ada/var_arr_typedef/pack.ads index 2ceb07180ef..353ec485180 100644 --- a/gdb/testsuite/gdb.ada/var_arr_typedef/pack.ads +++ b/gdb/testsuite/gdb.ada/var_arr_typedef/pack.ads @@ -13,6 +13,8 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +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; diff --git a/gdb/testsuite/gdb.ada/var_arr_typedef/var_arr_typedef.adb b/gdb/testsuite/gdb.ada/var_arr_typedef/var_arr_typedef.adb index 4a7f4cbca52..86609a8c9ba 100644 --- a/gdb/testsuite/gdb.ada/var_arr_typedef/var_arr_typedef.adb +++ b/gdb/testsuite/gdb.ada/var_arr_typedef/var_arr_typedef.adb @@ -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;