]>
gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/c-c++-common/gomp/map-2.c
1 /* Test 'map' clause diagnostics. */
3 /* See also corresponding OpenMP C++ variant: '../../g++.dg/gomp/map-2.C'. */
5 /* See also corresponding OpenACC variant: '../goacc/data-clause-2.c'. */
8 foo (int *p
, int (*q
)[10], int r
[10], int s
[10][10])
11 #pragma omp target map (tofrom: p[-1:2])
13 #pragma omp target map (tofrom: q[-1:2][0:10])
15 #pragma omp target map (tofrom: q[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
17 #pragma omp target map (tofrom: r[-1:2])
19 #pragma omp target map (tofrom: s[-1:2][:])
21 #pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
23 #pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
25 #pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
27 #pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
29 #pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */
31 #pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
33 #pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
35 #pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */
37 #pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
39 #pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
41 #pragma omp target map (tofrom: a[2:-5]) /* { dg-error "negative length in array section in" } */
43 #pragma omp target map (tofrom: b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */
45 #pragma omp target map (tofrom: b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
This page took 0.039753 seconds and 5 git commands to generate.