[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-parallel-shared02.f90
blobe91e47fbc87a2275b18f015973d50387416e322e
1 !RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 !REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.15.3.2 parallel shared Clause
5 program omp_parallel_shared
6 integer :: i, j, a(10), b(10), c(10)
7 integer :: k = 10
8 integer :: array(10)
10 do i = 1, 10
11 array(i) = i
12 end do
14 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a PRIVATE or SHARED clause or on the ALLOCATE directive.
15 !$omp parallel shared(array(i))
16 do i = 1, 10
17 c(i) = a(i) + b(i) + k
18 array(i) = k
19 end do
20 !$omp end parallel
21 end program omp_parallel_shared