[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-reduction04.f90
blob75ff094cff26f124f976dcd7038a478e7921e11c
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
5 program omp_Reduction
6 integer :: i
7 integer, parameter :: k = 10
8 common /c/ a, b
10 !ERROR: Variable 'k' on the REDUCTION clause is not definable
11 !$omp parallel do reduction(+:k)
12 do i = 1, 10
13 l = k + 1
14 end do
15 !$omp end parallel do
17 !ERROR: Variable 'c' on the REDUCTION clause is not definable
18 !$omp parallel do reduction(-:/c/)
19 do i = 1, 10
20 l = k + 1
21 end do
22 !$omp end parallel do
23 end program omp_Reduction