From: Tom de Vries Date: Tue, 1 Dec 2015 14:44:00 +0000 (+0000) Subject: Move pr46032*.c tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6b65a61e955444c5bae6ddfb412a6b6f80ba618;p=gcc.git Move pr46032*.c tests 2015-12-01 Tom de Vries * 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. From-SVN: r231113 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dac81219664..0ad56153604 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2015-12-01 Tom de Vries + + * 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 * gfortran.dg/goacc/gang-static.f95: Add tests for gang num arguments. diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-2.c b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c new file mode 100644 index 00000000000..e110880bd8e --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr46032-2.c @@ -0,0 +1,29 @@ +/* { 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" } } */ + diff --git a/gcc/testsuite/gcc.dg/gomp/pr46032-3.c b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c new file mode 100644 index 00000000000..a4af7ec4a8a --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr46032-3.c @@ -0,0 +1,28 @@ +/* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/pr46032-2.c b/gcc/testsuite/gcc.dg/pr46032-2.c deleted file mode 100644 index d769597ab98..00000000000 --- a/gcc/testsuite/gcc.dg/pr46032-2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { 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" } } */ - diff --git a/gcc/testsuite/gcc.dg/pr46032-3.c b/gcc/testsuite/gcc.dg/pr46032-3.c deleted file mode 100644 index a9e74d09602..00000000000 --- a/gcc/testsuite/gcc.dg/pr46032-3.c +++ /dev/null @@ -1,29 +0,0 @@ -/* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/pr46032.c b/gcc/testsuite/gcc.dg/pr46032.c deleted file mode 100644 index aae00199413..00000000000 --- a/gcc/testsuite/gcc.dg/pr46032.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { 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" } } */ - diff --git a/gcc/testsuite/gcc.dg/vect/pr46032.c b/gcc/testsuite/gcc.dg/vect/pr46032.c new file mode 100644 index 00000000000..8aa725a4245 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr46032.c @@ -0,0 +1,49 @@ +/* { 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" } } */ +