This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix libgomp OpenACC test
- From: James Norris <jnorris at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Oct 2015 15:25:40 -0500
- Subject: [PATCH] Fix libgomp OpenACC test
- Authentication-results: sourceware.org; auth=none
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 ();