blob: 3bd06e7de762beb7519873fde20a89419a7c9fd5 [file] [log] [blame]
-- { dg-do compile }
-- { dg-options "-O -fdump-tree-cunroll-details" }
package body Unroll3 is
function "+" (X, Y : Sarray) return Sarray is
R : Sarray;
begin
for I in Sarray'Range loop
pragma Loop_Optimize (Unroll);
R(I) := X(I) + Y(I);
end loop;
return R;
end;
procedure Add (X, Y : Sarray; R : out Sarray) is
begin
for I in Sarray'Range loop
pragma Loop_Optimize (Unroll);
R(I) := X(I) + Y(I);
end loop;
end;
end Unroll3;
-- { dg-final { scan-tree-dump-times "loop with 3 iterations completely unrolled" 2 "cunroll" } }