diff options
author | Tom de Vries <tom@codesourcery.com> | 2016-04-08 08:48:12 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2016-04-08 08:48:12 +0000 |
commit | 211f3d57b17a275835d37b631591efbd1b446a46 (patch) | |
tree | 7694c1a9e107752b77bff2f49dcc343ae6dcb89c | |
parent | 02cf2861fc129e08f39f951d083713e2646e91b2 (diff) | |
download | gcc-211f3d57b17a275835d37b631591efbd1b446a46.zip gcc-211f3d57b17a275835d37b631591efbd1b446a46.tar.gz gcc-211f3d57b17a275835d37b631591efbd1b446a46.tar.bz2 |
Add goacc/uninit-copy-clause.{c,f95} testcases
2016-04-08 Tom de Vries <tom@codesourcery.com>
* c-c++-common/goacc/uninit-copy-clause.c: New test.
* gfortran.dg/goacc/uninit-copy-clause.f95: New test.
From-SVN: r234824
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c | 38 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95 | 29 |
3 files changed, 72 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c3af0d..bd77314 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-04-08 Tom de Vries <tom@codesourcery.com> + + * c-c++-common/goacc/uninit-copy-clause.c: New test. + * gfortran.dg/goacc/uninit-copy-clause.f95: New test. + 2016-04-08 Alan Modra <amodra@gmail.com> * gcc.target/powerpc/pr70117.c: New. diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c new file mode 100644 index 0000000..b3cc445 --- /dev/null +++ b/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Wuninitialized" } */ + +void +foo (void) +{ + int i; + +#pragma acc kernels + { + i = 1; + } + +} + +void +foo2 (void) +{ + int i; + +#pragma acc kernels copy (i) + { + i = 1; + } + +} + +void +foo3 (void) +{ + int i; + +#pragma acc kernels copyin(i) + { + i = 1; + } + +} diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95 new file mode 100644 index 0000000..b2aae1d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95 @@ -0,0 +1,29 @@ +! { dg-do compile } +! { dg-additional-options "-Wuninitialized" } + +subroutine foo + integer :: i + + !$acc kernels + i = 1 + !$acc end kernels + +end subroutine foo + +subroutine foo2 + integer :: i + + !$acc kernels copy (i) + i = 1 + !$acc end kernels + +end subroutine foo2 + +subroutine foo3 + integer :: i + + !$acc kernels copyin (i) + i = 1 + !$acc end kernels + +end subroutine foo3 |