1-- { dg-do run } 2-- { dg-options "-O2" } 3 4procedure Opt4 is 5 6 type Rec (D : Natural) is record 7 S : String (1..D); 8 end record; 9 10 procedure Test (R : Rec) is 11 begin 12 if R.D /= 9 then 13 raise Program_Error; 14 end if; 15 end; 16 17 R : Rec(9); 18 19begin 20 R := (9, "123456789"); 21 Test (R); 22end; 23