Files
clang-p2996/flang/test/Semantics/omp-parallel-shared03.f90
Michael Kruse 58c3f20bbf [flang][windows] Run regression tests under Windows. NFCI.
Allow the lit test suite to run under Windows. This encompasses the following changes:

 * Define `lit_tools_dir` for flang's test configuration
 * Replace `(<command> || true)` idiom with `not <command>`
 * Add `REQUIRES: shell` on tests that invoke a shell script

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D89368
2021-06-10 05:13:44 -05:00

30 lines
727 B
Fortran

!RUN: %S/test_errors.sh %s %t %flang -fopenmp
!REQUIRES: shell
! OpenMP Version 4.5
! 2.15.3.2 parallel shared Clause
program omp_parallel_shared
integer :: i, j, a(10), b(10), c(10)
integer :: k = 10
type my_type
integer :: array(10)
end type my_type
type(my_type) :: my_var
real :: arr(10)
integer :: intx = 10
do i = 1, 10
arr(i) = 0.0
end do
!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.
!$omp parallel shared(arr(i),intx)
do i = 1, 10
c(i) = a(i) + b(i) + k
my_var%array(i) = k+intx
arr(i) = k
end do
!$omp end parallel
end program omp_parallel_shared