2 -- { dg-options "-gnatws -O" }
4 with Unchecked_Conversion
;
6 package body loop_unchecked_conversion
is
10 type List
is array (Natural range <>) of Byte
;
12 subtype Integer_List
is List
(1 .. 4);
14 function Integer_Down
is new
15 Unchecked_Conversion
(Source
=> Integer, Target
=> Integer_List
);
17 type Storage
(Size
: Integer) is
19 Data
: List
(1 .. Size
);
22 type Storage_Pointer
is access Storage
;
24 The_Data_Storage
: Storage_Pointer
;
29 The_Data_Storage
.Data
(I
+1 .. I
+4) := Integer_Down
(I
);
33 end loop_unchecked_conversion
;