This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4] Additional testing for deviceptr clause.
- From: James Norris <James_Norris at mentor dot com>
- To: <gcc-patches at gcc dot gnu dot org>, Thomas Schwinge <Thomas_Schwinge at mentor dot com>
- Date: Tue, 23 Jun 2015 07:38:26 -0500
- Subject: [gomp4] Additional testing for deviceptr clause.
- Authentication-results: sourceware.org; auth=none
Hi!
The following patch adds additional testing of the deviceptr
clause.
Patch applied to gomp-4_0-branch.
Thanks!
Jim
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
index e271a37..e62c315 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/deviceptr-1.c
@@ -28,5 +28,26 @@ int main (void)
abort ();
#endif
+ a_1 = a_2 = 0;
+
+#pragma acc data deviceptr (a)
+#pragma acc parallel copyout (a_1, a_2)
+ {
+ a_1 = a;
+ a_2 = &a;
+ }
+
+ if (a != A)
+ abort ();
+ if (a_1 != a)
+ abort ();
+#if ACC_MEM_SHARED
+ if (a_2 != &a)
+ abort ();
+#else
+ if (a_2 == &a)
+ abort ();
+#endif
+
return 0;
}