Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/c-c++-common/gomp/depend-4.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/c-c++-common/gomp/depend-4.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +void +foo (int *p, int (*q)[10], int r[10], int s[10][10]) +{ + int a[10], b[10][10]; + #pragma omp task depend (inout: p[-1:2]) + ; + #pragma omp task depend (inout: q[-1:2][2:4]) + ; + #pragma omp task depend (inout: q[-1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */ + ; + #pragma omp task depend (inout: r[-1:2]) + ; + #pragma omp task depend (inout: s[-1:2][2:4]) + ; + #pragma omp task depend (inout: s[-1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */ + ; + #pragma omp task depend (inout: a[-1:2]) /* { dg-error "negative low bound in array section in" } */ + ; + #pragma omp task depend (inout: b[-1:2][2:4]) /* { dg-error "negative low bound in array section in" } */ + ; + #pragma omp task depend (inout: b[1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */ + ; + #pragma omp task depend (inout: p[2:-3]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: q[2:-3][:]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: r[2:-5]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: s[2:-5][:]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: a[2:-5]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */ + ; + #pragma omp task depend (inout: b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */ + ; +}