/cp
[official-gcc.git] / gcc / testsuite / gnat.dg / opt19.adb
blob5619da12215eafb0696912f955fee7cac6942c38
1 -- { dg-do compile }
2 -- { dg-options "-O" }
4 procedure Opt19 is
6 type Enum is (One, Two);
8 type Vector_T is array (Enum) of Integer;
10 Zero_Vector : constant Vector_T := (Enum => 0);
12 type T is record
13 Vector : Vector_T;
14 end record;
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;
22 Obj : T := (Vector => Zero_Vector);
23 B : Boolean;
25 begin
26 Nested (Obj, One, B);
27 end;