compiler: give error for non-int arguments to make
[official-gcc.git] / gcc / testsuite / gnat.dg / unroll1.adb
blob34d8a8f3f388d966483422751162341d4bedd698
1 -- { dg-do compile }
2 -- { dg-options "-O2 -funroll-all-loops -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
4 package body Unroll1 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 (No_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 (No_Unroll);
20 R(I) := X(I) + Y(I);
21 end loop;
22 end;
24 end Unroll1;
26 -- { dg-final { scan-tree-dump-times "Not unrolling loop .: user didn't want it unrolled completely" 2 "cunrolli" } }
27 -- { dg-final { scan-rtl-dump-times "Not unrolling loop, user didn't want it unrolled" 2 "loop2_unroll" } }