public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix libgomp OpenACC test
@ 2015-10-12 20:25 James Norris
  0 siblings, 0 replies; only message in thread
From: James Norris @ 2015-10-12 20:25 UTC (permalink / raw)
  To: GCC Patches

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

Hi,

The attached patch fixes a test where the for-loop
iterator was not initialized.

Committed to trunk as obvious.

Jim

[-- Attachment #2: test.patch --]
[-- Type: text/x-patch, Size: 668 bytes --]

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
index cc915a9..8a51ee3 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
@@ -12,7 +12,7 @@ unsigned int n = N;
 int
 main (void)
 {
-  for (unsigned int i; i < n; ++i)
+  for (unsigned int i = 0; i < n; ++i)
     {
       a[i] = i % 3;
       b[i] = i % 5;
@@ -25,7 +25,7 @@ main (void)
       c[i] = a[i] + b[i];
   }
 
-  for (unsigned int i; i < n; ++i)
+  for (unsigned int i = 0; i < n; ++i)
     if (c[i] != (i % 3) + (i % 5))
       abort ();
 

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

only message in thread, other threads:[~2015-10-12 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 20:25 [PATCH] Fix libgomp OpenACC test James Norris

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).