summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/vect13.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/vect13.adb')
-rw-r--r--gcc/testsuite/gnat.dg/vect13.adb27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/vect13.adb b/gcc/testsuite/gnat.dg/vect13.adb
new file mode 100644
index 00000000000..ca765d3b485
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/vect13.adb
@@ -0,0 +1,27 @@
+-- { dg-do compile { target i?86-*-* x86_64-*-* } }
+-- { dg-options "-O3 -msse2 -fdump-tree-vect-details" }
+
+package body Vect13 is
+
+ function "+" (X, Y : Sarray) return Sarray is
+ R : Sarray;
+ begin
+ for I in Sarray'Range loop
+ pragma Loop_Optimize (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 (Vector);
+ R(I) := X(I) + Y(I);
+ end loop;
+ end;
+
+end Vect13;
+
+-- { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } }
+-- { dg-final { cleanup-tree-dump "vect" } }