1 /* Test 'map' clause diagnostics. */
3 /* See also corresponding OpenMP C/C++ variant: '../../c-c++-common/gomp/map-2.c'. */
5 /* See also corresponding OpenACC variant: '../goacc/data-clause-2.C'. */
9 foo (int *p, int (*q)[10], int r[10], int s[10][10])
12 #pragma omp target map (tofrom: p[-1:2])
14 #pragma omp target map (tofrom: q[-1:2][0:10])
16 #pragma omp target map (tofrom: q[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
18 #pragma omp target map (tofrom: r[-1:2])
20 #pragma omp target map (tofrom: s[-1:2][:])
22 #pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
24 #pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
26 #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
28 #pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
30 #pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */
32 #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
34 #pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
36 #pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */
38 #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
40 #pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
42 #pragma omp target map (tofrom: a[2:-5]) /* { dg-error "negative length in array section in" } */
44 #pragma omp target map (tofrom: b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */
46 #pragma omp target map (tofrom: b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */