[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-reduction06.f90
blob6b71bd620133fc5c9ad3935338f7aa8150886cfc
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 list item that appears in a REDUCTION clause should have a contiguous storage array section.
13 !$omp parallel do reduction(+:a(1:10:3))
14 do i = 1, 10
15 k = k + 1
16 end do
17 !$omp end parallel do
19 !ERROR: A list item that appears in a REDUCTION clause should have a contiguous storage array section.
20 !$omp parallel do reduction(+:b(1:10:3,1:8:1,1:5:1))
21 do i = 1, 10
22 k = k + 1
23 end do
24 !$omp end parallel do
26 !ERROR: A list item that appears in a REDUCTION clause should have a contiguous storage array section.
27 !$omp parallel do reduction(+:b(1:10:1,1:8:2,1:5:1))
28 do i = 1, 10
29 k = k + 1
30 end do
31 !$omp end parallel do
32 end program omp_reduction