gcc/libgomp/testsuite/libgomp.c/pr86660.c
Jakub Jelinek 5883c5ccc9 re PR middle-end/86660 (libgomp.c++/for-15.C ICEs with nvptx offloading)
PR middle-end/86660
	* omp-low.c (scan_sharing_clauses): Don't ignore map clauses for
	declare target to variables if they have always,{to,from,tofrom} map
	kinds.

	* testsuite/libgomp.c/pr86660.c: New test.

From-SVN: r263010
2018-07-26 18:12:02 +02:00

29 lines
356 B
C

/* PR middle-end/86660 */
#pragma omp declare target
int v[20];
void
foo (void)
{
if (v[7] != 2)
__builtin_abort ();
v[7] = 1;
}
#pragma omp end declare target
int
main ()
{
v[5] = 8;
v[7] = 2;
#pragma omp target map (always, tofrom: v)
{
foo ();
v[5] = 3;
}
if (v[7] != 1 || v[5] != 3)
__builtin_abort ();
return 0;
}