re PR c/70688 (bogus OpenACC data clause errors involving reductions)
PR c/70688 * pr70688.c: New file. From-SVN: r237011
This commit is contained in:
parent
880ce6a8a4
commit
3616a8c52e
2 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-06-01 Cesar Philippidis <cesar@codesourcery.com>
|
||||
|
||||
PR c/70688
|
||||
* pr70688.c: New file.
|
||||
|
||||
2016-05-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* testsuite/libgomp.c/doacross-1.c (main): Use schedule(static)
|
||||
|
|
27
libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
Normal file
27
libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* Verify that reduction variables can appear in data clause. */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
const int n = 100;
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int s = 0;
|
||||
int array[n];
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
array[i] = i+1;
|
||||
|
||||
#pragma acc parallel loop num_gangs (10) copy (s) reduction (+:s)
|
||||
for (int i = 0; i < n; i++)
|
||||
s += array[i];
|
||||
|
||||
#pragma acc parallel loop num_gangs (10) reduction (+:s) copy (s)
|
||||
for (int i = 0; i < n; i++)
|
||||
s += array[i];
|
||||
|
||||
assert (s == n * (n + 1));
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue