diff mbox

[gomp4] Add additional test for declare directive

Message ID 55A3DC7B.1060103@codesourcery.com
State New
Headers show

Commit Message

James Norris July 13, 2015, 3:42 p.m. UTC
Hi,

The attached patch adds a test for the copyout clause with
the declare directive. The testing of this clause was
overlooked.

Committed to gomp-4_0-branch.

Jim
diff mbox

Patch

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-1.c
index 584b921..8fbec4d 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-1.c
@@ -7,6 +7,23 @@ 
 #define N 8
 
 void
+subr2 (int *a)
+{
+  int i;
+  int f[N];
+#pragma acc declare copyout (f)
+
+#pragma acc parallel copy (a[0:N])
+  {
+    for (i = 0; i < N; i++)
+      {
+	f[i] = a[i];
+	a[i] = f[i] + f[i] + f[i];
+      }
+  }
+}
+
+void
 subr1 (int *a)
 {
   int f[N];
@@ -93,5 +110,13 @@  main (int argc, char **argv)
 	abort ();
     }
 
+  subr2 (&a[0]);
+
+  for (i = 0; i < 1; i++)
+    {
+      if (a[i] != 1234 * 6)
+	abort ();
+    }
+
   return 0;
 }