Retro68/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c
2017-10-07 02:16:47 +02:00

26 lines
345 B
C

/* Verify that acc declare accept VLA variables. */
#include <assert.h>
int
main ()
{
int N = 1000;
int i, A[N];
#pragma acc declare copy(A)
for (i = 0; i < N; i++)
A[i] = -i;
#pragma acc kernels
for (i = 0; i < N; i++)
A[i] = i;
#pragma acc update host(A)
for (i = 0; i < N; i++)
assert (A[i] == i);
return 0;
}