gcc/libgomp/testsuite/libgomp.c/pr90779.c
Jakub Jelinek 211b7533bf re PR middle-end/90779 (Fortran array initialization in offload regions)
PR middle-end/90779
	* gimplify.c: Include omp-offload.h and context.h.
	(gimplify_bind_expr): Add "omp declare target" attributes
	to static block scope variables inside of target region or target
	functions.

	* c-c++-common/goacc/routine-5.c (func2): Don't expect error for
	static block scope variable in #pragma acc routine.

	* testsuite/libgomp.c/pr90779.c: New test.
	* testsuite/libgomp.fortran/pr90779.f90: New test.

From-SVN: r272322
2019-06-15 09:09:04 +02:00

19 lines
235 B
C

/* PR middle-end/90779 */
extern void abort (void);
int
main ()
{
int i, j;
for (i = 0; i < 2; ++i)
#pragma omp target map(from: j)
{
static int k = 5;
j = ++k;
}
if (j != 7)
abort ();
return 0;
}