[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-parallel-shared04.f90
blobcb63e45cd5cf2a9ded1c51fcdfbb79706f6e09a8
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 type my_type
9 integer :: array(10)
10 end type my_type
12 type(my_type) :: my_var
14 real :: arr(10)
15 integer :: intx = 10
17 do i = 1, 10
18 arr(i) = 0.0
19 end do
21 !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.
22 !$omp parallel shared(arr,intx,my_var%array(1))
23 do i = 1, 10
24 c(i) = a(i) + b(i) + k
25 my_var%array(i) = k+intx
26 arr(i) = k
27 end do
28 !$omp end parallel
29 end program omp_parallel_shared