2 -- { dg-options "-O3" }
6 type Index_T
is mod 2 ** 32;
7 for Index_T
'Size use 32;
8 for Index_T
'Alignment use 1;
10 type Array_T
is array (Index_T
range <>) of Natural;
11 type Array_Ptr_T
is access all Array_T
;
13 My_Array_1
: aliased Array_T
:= (1, 2);
14 My_Array_2
: aliased Array_T
:= (3, 4);
16 Array_Ptr
: Array_Ptr_T
:= null;
17 Index
: Index_T
:= Index_T
'First;
19 My_Value
: Natural := Natural'First;
21 procedure Proc
(Selection
: Positive) is
24 Array_Ptr
:= My_Array_1
'Access;
25 Index
:= My_Array_1
'First;
27 Array_Ptr
:= My_Array_2
'Access;
28 Index
:= My_Array_2
'First;
31 if My_Value
= Natural'First then
32 My_Value
:= Array_Ptr
.all (Index
);