aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/depend-3.c
blob: 22fcd8d9c704821e3601402e5851ee95a8fb7628 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */

void bar (int a[10][10][10]);
void
foo (int a[10][10][10], int **b, int x)
{
  int c[10][10][10];
  #pragma omp task depend(out: a[2:4][3:0][:7])	/* { dg-error "zero length array section" } */
    bar (a);
  #pragma omp task depend(inout: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */
    bar (a);
  #pragma omp task depend(in: c[:][:][10:])	/* { dg-error "zero length array section" } */
    bar (c);
  #pragma omp task depend(out: a[2:4][3:0][:x])	/* { dg-error "zero length array section" } */
    bar (a);
  #pragma omp task depend(inout: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */
    bar (a);
  #pragma omp task depend(in: c[:][x-2:x][10:])	/* { dg-error "zero length array section" } */
    bar (c);
}