summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/vect12.adb
blob: f493c8bbb0f8d0fe1d01a951748c806bae8b610b (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
-- { dg-do compile { target i?86-*-* x86_64-*-* } }
-- { dg-options "-O3 -msse2 -fdump-tree-vect-details" }

package body Vect12 is

   function "+" (X, Y : Sarray) return Sarray is
      R : Sarray;
   begin
      for I in Sarray'Range loop
         pragma Loop_Optimize (No_Vector);
         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 (No_Vector);
         R(I) := X(I) + Y(I);
      end loop;
   end;

end Vect12;

-- { dg-final { scan-tree-dump-not "vectorized 1 loops" "vect"  } }
-- { dg-final { cleanup-tree-dump "vect" } }