+2015-12-01 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/pr46032.c: Move to ...
+ * gcc.dg/vect/pr46032.c: here. Add dg-require-effective-target
+ vect_int.
+ * gcc.dg/pr46032-2.c: Move to ...
+ * gcc.dg/gomp/pr46032-2.c: ... here. Drop dg-require-effective-target fopenmp.
+ * gcc.dg/pr46032-3.c: Move to ...
+ * gcc.dg/gomp/pr46032-3.c: ... here. Drop dg-require-effective-target fopenmp.
+
2015-12-01 Cesar Philippidis <cesar@codesourcery.com>
* gfortran.dg/goacc/gang-static.f95: Add tests for gang num arguments.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+
+#define N 2
+
+int
+foo (void)
+{
+ int a[N], b[N], c[N];
+ int *ap = &a[0];
+ int *bp = &b[0];
+ int *cp = &c[0];
+
+#pragma omp parallel for
+ for (unsigned int idx = 0; idx < N; idx++)
+ {
+ ap[idx] = 1;
+ bp[idx] = 2;
+ cp[idx] = ap[idx];
+ }
+
+ return *cp;
+}
+
+/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+
+#define N 2
+
+int
+foo (void)
+{
+ int a[N], c[N];
+ int *ap = &a[0];
+ int *bp = &a[0];
+ int *cp = &c[0];
+
+#pragma omp parallel for
+ for (unsigned int idx = 0; idx < N; idx++)
+ {
+ ap[idx] = 1;
+ bp[idx] = 2;
+ cp[idx] = ap[idx];
+ }
+
+ return *cp;
+}
+
+/* { dg-final { scan-tree-dump-times "\\] = 1;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-require-effective-target fopenmp } */
-/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
-
-#define N 2
-
-int
-foo (void)
-{
- int a[N], b[N], c[N];
- int *ap = &a[0];
- int *bp = &b[0];
- int *cp = &c[0];
-
-#pragma omp parallel for
- for (unsigned int idx = 0; idx < N; idx++)
- {
- ap[idx] = 1;
- bp[idx] = 2;
- cp[idx] = ap[idx];
- }
-
- return *cp;
-}
-
-/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */
-
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-require-effective-target fopenmp } */
-/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
-
-#define N 2
-
-int
-foo (void)
-{
- int a[N], c[N];
- int *ap = &a[0];
- int *bp = &a[0];
- int *cp = &c[0];
-
-#pragma omp parallel for
- for (unsigned int idx = 0; idx < N; idx++)
- {
- ap[idx] = 1;
- bp[idx] = 2;
- cp[idx] = ap[idx];
- }
-
- return *cp;
-}
-
-/* { dg-final { scan-tree-dump-times "\\] = 1;" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 1 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-require-effective-target fopenmp } */
-/* { dg-options "-O2 -fopenmp -ftree-vectorize -std=c99 -fipa-pta -fdump-tree-vect-all" } */
-
-extern void abort (void);
-
-#define nEvents 1000
-
-static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize")))
-init (unsigned *results, unsigned *pData)
-{
- unsigned int i;
- for (i = 0; i < nEvents; ++i)
- pData[i] = i % 3;
-}
-
-static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize")))
-check (unsigned *results)
-{
- unsigned sum = 0;
- for (int idx = 0; idx < (int)nEvents; idx++)
- sum += results[idx];
-
- if (sum != 1998)
- abort ();
-}
-
-int
-main (void)
-{
- unsigned results[nEvents];
- unsigned pData[nEvents];
- unsigned coeff = 2;
-
- init (&results[0], &pData[0]);
-
-#pragma omp parallel for
- for (int idx = 0; idx < (int)nEvents; idx++)
- results[idx] = coeff * pData[idx];
-
- check (&results[0]);
-
- return 0;
-}
-
-/* { dg-final { scan-tree-dump-times "note: vectorized 1 loop" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" } } */
-
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target fopenmp } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-options "-O2 -fopenmp -ftree-vectorize -std=c99 -fipa-pta -fdump-tree-vect-all" } */
+
+extern void abort (void);
+
+#define nEvents 1000
+
+static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize")))
+init (unsigned *results, unsigned *pData)
+{
+ unsigned int i;
+ for (i = 0; i < nEvents; ++i)
+ pData[i] = i % 3;
+}
+
+static void __attribute__((noinline, noclone, optimize("-fno-tree-vectorize")))
+check (unsigned *results)
+{
+ unsigned sum = 0;
+ for (int idx = 0; idx < (int)nEvents; idx++)
+ sum += results[idx];
+
+ if (sum != 1998)
+ abort ();
+}
+
+int
+main (void)
+{
+ unsigned results[nEvents];
+ unsigned pData[nEvents];
+ unsigned coeff = 2;
+
+ init (&results[0], &pData[0]);
+
+#pragma omp parallel for
+ for (int idx = 0; idx < (int)nEvents; idx++)
+ results[idx] = coeff * pData[idx];
+
+ check (&results[0]);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loop" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" } } */
+