| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenmp |
| 2 |
! OpenMP Version 5.2, Sections 3.2.1 & 5.3 |
| 3 |
subroutine omp_firstprivate(init) |
| 4 |
integer :: init |
| 5 |
integer :: a(10) |
| 6 |
type my_type |
| 7 |
integer :: val |
| 8 |
end type my_type |
| 9 |
type(my_type) :: my_var |
| 10 |
|
| 11 |
!ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a FIRSTPRIVATE clause |
| 12 |
!$omp parallel firstprivate(a(2)) |
| 13 |
a(2) = init |
| 14 |
!$omp end parallel |
| 15 |
|
| 16 |
!ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a FIRSTPRIVATE clause |
| 17 |
!$omp parallel firstprivate(my_var%val) |
| 18 |
my_var%val = init |
| 19 |
!$omp end parallel |
| 20 |
end subroutine |