There are some cases in which variables used in OpenMP constructs are predetermined as private. The semantic checks for copyprivate were not handling those cases. Besides that, shared symbols were not being properly represented in some cases. When there was no previously declared private (implicit) symbol, no new association symbols, representing shared ones, were being created. These symbols must always be inserted in constructs that may privatize the original symbol: parallel, teams and task generating constructs. Fixes #87214 and #86907
18 lines
435 B
Fortran
18 lines
435 B
Fortran
!RUN: %python %S/../test_errors.py %s %flang -fopenmp
|
|
! OpenMP Version 4.5
|
|
! 2.15.3.2 parallel shared Clause
|
|
program omp_parallel_shared
|
|
type derived
|
|
integer :: field(2, 3)
|
|
end type
|
|
integer :: field(2)
|
|
type(derived) :: y
|
|
|
|
! Check that derived type fields and variables with the same name
|
|
! don't cause errors.
|
|
!$omp parallel
|
|
y%field(2, 3) = 1
|
|
field(1) = 1
|
|
!$omp end parallel
|
|
end program omp_parallel_shared
|