| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O" } |
| 3 |
|
| 4 |
procedure Opt19 is |
| 5 |
|
| 6 |
type Enum is (One, Two); |
| 7 |
|
| 8 |
type Vector_T is array (Enum) of Integer; |
| 9 |
|
| 10 |
Zero_Vector : constant Vector_T := (Enum => 0); |
| 11 |
|
| 12 |
type T is record |
| 13 |
Vector : Vector_T; |
| 14 |
end record; |
| 15 |
|
| 16 |
procedure Nested (Value : in out T; E : Enum; B : out Boolean) is |
| 17 |
I : Integer renames Value.Vector(E); |
| 18 |
begin |
| 19 |
B := I /= 0; |
| 20 |
end; |
| 21 |
|
| 22 |
Obj : T := (Vector => Zero_Vector); |
| 23 |
B : Boolean; |
| 24 |
|
| 25 |
begin |
| 26 |
Nested (Obj, One, B); |
| 27 |
end; |