From: Tom de Vries Date: Mon, 24 Aug 2015 15:01:44 +0000 (+0000) Subject: Add libgomp.oacc-c-c++-common/vector-loop.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1358a747957c9f9bd64126c297740621bee4c6b2;p=gcc.git Add libgomp.oacc-c-c++-common/vector-loop.c 2015-08-24 Tom de Vries PR tree-optimization/65468 * testsuite/libgomp.oacc-c-c++-common/vector-loop.c: New test. From-SVN: r227130 --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 43aaa524c2a..7bb4fafb05f 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2015-08-24 Tom de Vries + + PR tree-optimization/65468 + * testsuite/libgomp.oacc-c-c++-common/vector-loop.c: New test. + 2015-08-24 Tom de Vries PR tree-optimization/65468 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 00000000000..cc915a96f2c --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-loop.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ + +#include + +#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; +}