This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix libgomp OpenACC test


Hi,

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

Committed to trunk as obvious.

Jim
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 ();
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]