In OpenMP 5.0 we allow any lvalue for motion clause and map clause, below are some examples for lvalue:
int *p; int **pp; struct S { int struct *sp; double *d; struct S **sp_arr; }; struct S *s; #pragma omp target update to(*p) #pragma omp target update to(*(p+3)) #pragma omp target update to((p+3)[k]) #pragma omp target update to(**pp) #pragma omp target update to(*pp[0]) #pragma omp target update to(*(pp+l)[2]) #pragma omp target update to((pp+l)[2][3]) #pragma omp target update to(*(s->d)) #pragma omp target update to(*(s->sp->d)) #pragma omp target update to(*(s->sp->d+k)) #pragma omp target update to((s->sp->d+k)[2]) #pragma omp target update to(*(s->sp->sp_arr+k))
Now only add test for motion clause, after the implementation is fine,
will add test for map since the core logic is in the same helper
function.
This assertion must check that the expression is just an lvalue, no?