[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-reduction02.f90
blob8cac4fb9f07c8a3f9154422e082ae779ae4c7b8c
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
7 integer :: i
8 integer :: k = 10
9 integer :: j = 10
11 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
12 !$omp parallel do reduction(+:k), reduction(-:k)
13 do i = 1, 10
14 k = k + 1
15 end do
16 !$omp end parallel do
18 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
19 !$omp parallel do reduction(+:k), reduction(-:j), reduction(+:k)
20 do i = 1, 10
21 k = k + 1
22 end do
23 !$omp end parallel do
25 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
26 !$omp parallel do reduction(+:j), reduction(-:k), reduction(+:k)
27 do i = 1, 10
28 k = k + 1
29 end do
30 !$omp end parallel do
32 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
33 !$omp parallel do reduction(+:j), reduction(-:k), private(k)
34 do i = 1, 10
35 k = k + 1
36 end do
37 !$omp end parallel do
38 end program omp_reduction