PR ipa/83051
[official-gcc.git] / gcc / testsuite / gnat.dg / unroll3.adb
blobba4e122530aa2202b553f4cba438a24e7f0d13a7
1 -- { dg-do compile }
2 -- { dg-options "-O -fdump-tree-cunroll-details" }
4 package body Unroll3 is
6 function "+" (X, Y : Sarray) return Sarray is
7 R : Sarray;
8 begin
9 for I in Sarray'Range loop
10 pragma Loop_Optimize (Unroll);
11 R(I) := X(I) + Y(I);
12 end loop;
13 return R;
14 end;
16 procedure Add (X, Y : Sarray; R : out Sarray) is
17 begin
18 for I in Sarray'Range loop
19 pragma Loop_Optimize (Unroll);
20 R(I) := X(I) + Y(I);
21 end loop;
22 end;
24 end Unroll3;
26 -- { dg-final { scan-tree-dump-times "note: loop with 3 iterations completely unrolled" 2 "cunroll" } }