7ba8651ed2
PR c++/80029 gcc/ * gimplify.c (is_oacc_declared): New function. (oacc_default_clause): Use it to set default flags for acc declared variables inside parallel regions. (gimplify_scan_omp_clauses): Strip firstprivate pointers for acc declared variables. (gimplify_oacc_declare): Gimplify the declare clauses. Add the declare attribute to any decl as necessary. libgomp/ * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: New test. From-SVN: r246381
26 lines
345 B
C
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;
|
|
}
|