mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user