1-- { dg-do run } 2 3with System; 4 5procedure Addr14 is 6 7 type Arr is array (1 .. 4) of aliased Integer; 8 9 A : Arr := (1, 2, 3, 4); 10 I : Natural := 0; 11 12 function Get_Address return System.Address is 13 begin 14 I := I + 1; 15 return A(I)'Address; 16 end; 17 18 Foo : Integer with Address => Get_Address; 19 20begin 21 if Foo /= 1 then 22 raise Program_Error; 23 end if; 24end; 25