1-- { dg-do compile } 2-- { dg-options "-O" } 3 4package body Array29 is 5 6 procedure Copy (Src : in Matrix; Dst : out Matrix) is 7 begin 8 for I in Src'Range (1) loop 9 for J in Src'Range (2) loop 10 Dst (I, J) := Src (I, J); 11 end loop; 12 end loop; 13 end; 14 15 procedure Proc is 16 N : constant := 2; 17 FM1 : constant Matrix (1 .. N, 1 .. N) := ((1.0, 2.0), (3.0, 4.0)); 18 FM2 : constant Matrix (1 .. N, 1 .. N) := ((1.0, 2.0), (3.0, 4.0)); 19 A : constant array (1 .. 2) of Matrix (1 .. N, 1 .. N) 20 := (Matrix (FM1), Matrix (FM2)); 21 Final : Matrix (1 .. N, 1 .. N); 22 begin 23 Copy (Src => A (1), Dst => Final); 24 end; 25 26end Array29; 27