[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-depend01.f90
blobbb420563ed36bd6fdceae5b730730f2c30eda42f
1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 ! REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.13.9 Depend Clause
5 ! List items used in depend clauses cannot be zero-length array sections.
7 program omp_depend
8 integer :: a(10) , b(10,10)
9 a = 10
10 b = 20
12 !$omp parallel
13 !$omp single
15 !ERROR: 'a' in DEPEND clause is a zero size array section
16 !ERROR: 'b' in DEPEND clause is a zero size array section
17 !$omp task shared(a,b) depend(out: a(2:1), b(3:1, 1:-1))
18 a(2:1) = b(2, 2)
19 !$omp end task
21 !ERROR: Stride should not be specified for array section in DEPEND clause
22 !$omp task shared(x) depend(in: a(5:10:1))
23 print *, a(5:10), b
24 !$omp end task
26 !$omp end single
27 !$omp end parallel
29 end program omp_depend