1-- { dg-do compile }
2-- { dg-options "-O" }
3
4with Loop_Optimization13_Pkg; use Loop_Optimization13_Pkg;
5
6package body Loop_Optimization13 is
7
8   function F (A : Rec) return Rec is
9      N : constant Integer := A.V'Length / L;
10      Res : Rec
11        := (True, new Complex_Vector' (0 .. A.V'Length / L - 1 => (0.0, 0.0)));
12   begin
13      for I in 0 .. L - 1 loop
14         for J in 0 .. N - 1 loop
15            Res.V (J) := Res.V (J) + A.V (I * N + J);
16         end loop;
17      end loop;
18      return Res;
19   end;
20
21end Loop_Optimization13;
22