public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] add a test case for PR70688
@ 2016-06-01 20:30 Cesar Philippidis
  0 siblings, 0 replies; only message in thread
From: Cesar Philippidis @ 2016-06-01 20:30 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

I had already fixed pr70688 in trunk r236678 with the patch I introduced
here <https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00762.html>. This
patch introduces a new libgomp test case to verify the fix. I'll apply
this patch to trunk and gomp4 as obvious.

Cesar

[-- Attachment #2: pr70688.diff --]
[-- Type: text/x-patch, Size: 739 bytes --]

2016-06-01  Cesar Philippidis  <cesar@codesourcery.com>

	libgomp/
	PR c/70688
	* pr70688.c: New file.


diff --git a/pr70688.c b/pr70688.c
new file mode 100644
index 0000000..9d80577
--- /dev/null
+++ b/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;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-01 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-01 20:30 [PATCH] add a test case for PR70688 Cesar Philippidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).