summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorcesar <cesar@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-01 20:37:44 +0000
committercesar <cesar@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-01 20:37:44 +0000
commit2720c8db1b161268619d612ad2a01ad0fea642a2 (patch)
treed618152a17ef24e0340ec6c83a5f4d306230df4d /libgomp
parent6f9aa2fa4936e28ad8b79fce3d449c5b000207dd (diff)
downloadgcc-2720c8db1b161268619d612ad2a01ad0fea642a2.tar.gz
PR c/70688
* pr70688.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237011 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c27
2 files changed, 32 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 9dcdda83b5d..eebbb27c566 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-01 Cesar Philippidis <cesar@codesourcery.com>
+
+ PR c/70688
+ * pr70688.c: New file.
+
2016-05-26 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/doacross-1.c (main): Use schedule(static)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
new file mode 100644
index 00000000000..f9556e34a46
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
@@ -0,0 +1,27 @@
+/* Verify that reduction variables can appear in data clause. */
+
+#include <assert.h>
+
+const int n = 100;
+
+int
+main ()
+{
+ int s = 0;
+ int array[n];
+
+ for (int i = 0; i < n; i++)
+ array[i] = i+1;
+
+#pragma acc parallel loop num_gangs (10) copy (s) reduction (+:s)
+ for (int i = 0; i < n; i++)
+ s += array[i];
+
+#pragma acc parallel loop num_gangs (10) reduction (+:s) copy (s)
+ for (int i = 0; i < n; i++)
+ s += array[i];
+
+ assert (s == n * (n + 1));
+
+ return 0;
+}