[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-reduction05.f90
blob1e1f7f13ead97dc55a48af4855d2f2064b58f8ae
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
2 ! REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.15.3.6 Reduction Clause
6 program omp_reduction
8 integer :: i
9 integer :: k = 10
10 integer :: a(10),b(10,10,10)
12 !ERROR: 'a' in REDUCTION clause is a zero size array section
13 !$omp parallel do reduction(+:a(1:0:2))
14 do i = 1, 10
15 k = k + 1
16 end do
17 !$omp end parallel do
19 !ERROR: 'a' in REDUCTION clause is a zero size array section
20 !$omp parallel do reduction(+:a(1:0))
21 do i = 1, 10
22 k = k + 1
23 end do
24 !$omp end parallel do
26 !ERROR: 'b' in REDUCTION clause is a zero size array section
27 !$omp parallel do reduction(+:b(1:6,5,1:0))
28 do i = 1, 10
29 k = k + 1
30 end do
31 !$omp end parallel do
33 !ERROR: 'b' in REDUCTION clause is a zero size array section
34 !$omp parallel do reduction(+:b(1:6,1:0:5,1:10))
35 do i = 1, 10
36 k = k + 1
37 end do
38 !$omp end parallel do
39 end program omp_reduction