summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/vect10.adb
blob: 62b9424eec1bd7d2cac0854e174f9129e8bdf10f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- { dg-do compile }
-- { dg-options "-w" }

package body Vect10 is

   procedure Add_Mul (X : in out Unit; Y, Z : in Unit) is
   begin
       X := X + Y * Z;
   end;
   pragma Inline_Always (Add_Mul);

   procedure Proc
     (F           : in Rec_Vector;
      First_Index : in Natural;
      Last_Index  : in Natural;
      Result      : out Unit)
   is
   begin
      Result := (others => 0.0);

      for I in First_Index + 1 .. Last_Index loop
         declare
            Local : Rec renames F (I);
         begin
            Add_Mul (Result, Local.Val, Local.Val);
         end;
      end loop;
   end;

end Vect10;