Retro68/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/collapse-4.c

28 lines
374 B
C
Raw Normal View History

2015-08-28 15:33:40 +00:00
/* { dg-do run } */
#include <string.h>
int
main (void)
{
int l = 0;
int b[3][3];
int i, j;
memset (b, '\0', sizeof (b));
2017-04-10 11:32:00 +00:00
#pragma acc parallel copy(b[0:3][0:3])
2015-08-28 15:33:40 +00:00
{
#pragma acc loop collapse(2) reduction(+:l)
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
if (b[i][j] != 16)
l += 1;
}
if (l != 2 * 2)
__builtin_abort();
return 0;
}