aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-08-24 15:01:44 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-08-24 15:01:44 +0000
commit1358a747957c9f9bd64126c297740621bee4c6b2 (patch)
treecd25ed0f0deb25b606a392c41db863851eb27e8d /libgomp
parent6ce436451477990cb52ba22d31620547cbbff5ff (diff)
downloadgcc-1358a747957c9f9bd64126c297740621bee4c6b2.zip
gcc-1358a747957c9f9bd64126c297740621bee4c6b2.tar.gz
gcc-1358a747957c9f9bd64126c297740621bee4c6b2.tar.bz2
Add libgomp.oacc-c-c++-common/vector-loop.c
2015-08-24 Tom de Vries <tom@codesourcery.com> PR tree-optimization/65468 * testsuite/libgomp.oacc-c-c++-common/vector-loop.c: New test. From-SVN: r227130
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c33
2 files changed, 38 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 43aaa52..7bb4faf 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,6 +1,11 @@
2015-08-24 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/65468
+ * testsuite/libgomp.oacc-c-c++-common/vector-loop.c: New test.
+
+2015-08-24 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/65468
* testsuite/libgomp.c/static-chunk-size-one.c: New test.
2015-08-24 Joost VandeVondele <vondele@gnu.gcc.org>
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
new file mode 100644
index 0000000..cc915a9
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+#define N 1024
+
+unsigned int a[N];
+unsigned int b[N];
+unsigned int c[N];
+unsigned int n = N;
+
+int
+main (void)
+{
+ for (unsigned int i; i < n; ++i)
+ {
+ a[i] = i % 3;
+ b[i] = i % 5;
+ }
+
+#pragma acc parallel vector_length (32) copyin (a,b) copyout (c)
+ {
+#pragma acc loop /* vector clause is missing, since it's not yet supported. */
+ for (unsigned int i = 0; i < n; i++)
+ c[i] = a[i] + b[i];
+ }
+
+ for (unsigned int i; i < n; ++i)
+ if (c[i] != (i % 3) + (i % 5))
+ abort ();
+
+ return 0;
+}