Add goacc/uninit-copy-clause.{c,f95} testcases
2016-03-24 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.
---
.../c-c++-common/goacc/uninit-copy-clause.c | 38 ++++++++++++++++++++++
.../gfortran.dg/goacc/uninit-copy-clause.f95 | 29 +++++++++++++++++
2 files changed, 67 insertions(+)
new file mode 100644
@@ -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;
+ }
+
+}
new file mode 100644
@@ -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