summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect')
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c (renamed from gcc/testsuite/gcc.dg/vect/pr29145.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c (renamed from gcc/testsuite/gcc.dg/vect/vect-101.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c (renamed from gcc/testsuite/gcc.dg/vect/vect-102.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c (renamed from gcc/testsuite/gcc.dg/vect/vect-102a.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c (renamed from gcc/testsuite/gcc.dg/vect/vect-37.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c (renamed from gcc/testsuite/gcc.dg/vect/vect-43.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c (renamed from gcc/testsuite/gcc.dg/vect/vect-45.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c (renamed from gcc/testsuite/gcc.dg/vect/vect-49.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c (renamed from gcc/testsuite/gcc.dg/vect/vect-51.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c (renamed from gcc/testsuite/gcc.dg/vect/vect-53.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c (renamed from gcc/testsuite/gcc.dg/vect/vect-57.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c (renamed from gcc/testsuite/gcc.dg/vect/vect-61.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c (renamed from gcc/testsuite/gcc.dg/vect/vect-79.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c (renamed from gcc/testsuite/gcc.dg/vect/vect-dv-2.c)0
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-vfa-01.c39
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-vfa-02.c47
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-vfa-03.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-vfa-04.c38
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp6
19 files changed, 188 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr29145.c b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
index 97d190ca278..97d190ca278 100644
--- a/gcc/testsuite/gcc.dg/vect/pr29145.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-101.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c
index e195a58af5f..e195a58af5f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-101.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-102.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c
index 49df4f9bc90..49df4f9bc90 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-102.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-102a.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c
index 35023fc65dc..35023fc65dc 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-102a.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-37.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
index e54e0c5166c..e54e0c5166c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-37.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-43.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
index 258da2827f7..258da2827f7 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-43.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-45.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c
index 8a998564319..8a998564319 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-45.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-49.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c
index 8dfd0e749b5..8dfd0e749b5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-49.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-51.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c
index 541a5ffef3b..541a5ffef3b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-51.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-53.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c
index 91eaabeb93b..91eaabeb93b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-53.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-57.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
index bcac95a0393..bcac95a0393 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-57.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-61.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
index 9f4e8e9882b..9f4e8e9882b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-61.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-79.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c
index 8e98e4d0ed9..8e98e4d0ed9 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-79.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-dv-2.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c
index 30d229c1996..30d229c1996 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-dv-2.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c
diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c
new file mode 100644
index 00000000000..ea5523ed177
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
+int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
+int Y[N] = {};
+
+void
+foo (int *in, int *out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = in[i] + 2;
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i] != result[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c
new file mode 100644
index 00000000000..80d85a785c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int resultY[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
+int resultZ[N] = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
+int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
+int Y[N] = {};
+int Z[N] = {};
+
+void
+foo (int *in, int *out1, int *out2)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out1[i] = in[i] + 2;
+ out2[i] = in[i] + 3;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y, Z);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i] != resultY[i])
+ abort ();
+
+ if (Z[i] != resultZ[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c
new file mode 100644
index 00000000000..aa001bf4d6f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+struct S
+{
+ unsigned short a;
+ unsigned short b;
+};
+
+struct S result[N] = {12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18,
+ 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24,
+ 24, 25, 25, 26, 26, 27, 27, 28};
+struct S X[N] = {10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
+ 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25};
+struct S Y[N] = {};
+
+void
+foo (struct S * in, struct S * out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = in[i].a + 2;
+ out[i].b = in[i].b + 3;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i].a != result[i].a)
+ abort ();
+
+ if (Y[i].b != result[i].b)
+ abort ();
+
+ }
+ return 0;
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c
new file mode 100644
index 00000000000..e43df0086c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[] = {10, 11, 15, 16, 20, 21, 25, 26, 30, 31, 35, 36, 40, 41, 45, 46, 50, 51};
+int X[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0};
+
+void
+foo (int *in, int *out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = in[i] + 5;
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, &X[2]);
+
+ /* check results: */
+ for (i = 0; i < N+2; i++)
+ {
+ if (X[i] != result[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 88ce4d9f483..2208f727d1e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -113,6 +113,12 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \
global SAVED_DEFAULT_VECTCFLAGS
set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+# --param vect-max-version-for-alias-checks=0 tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
# -ffast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ffast-math"