| 1 |
! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp |
| 2 |
! OpenMP Version 4.5 |
| 3 |
! 2.15.4.2 copyprivate Clause |
| 4 |
! Pointers with the INTENT(IN) attribute may not appear in a copyprivate clause. |
| 5 |
|
| 6 |
subroutine omp_copyprivate(p) |
| 7 |
integer :: a(10), b(10), c(10) |
| 8 |
integer, pointer, intent(in) :: p |
| 9 |
|
| 10 |
a = 10 |
| 11 |
b = 20 |
| 12 |
|
| 13 |
!$omp parallel |
| 14 |
!$omp single |
| 15 |
c = a + b + p |
| 16 |
!ERROR: COPYPRIVATE variable 'p' is not PRIVATE or THREADPRIVATE in outer context |
| 17 |
!ERROR: Pointer 'p' with the INTENT(IN) attribute may not appear in a COPYPRIVATE clause |
| 18 |
!$omp end single copyprivate(p) |
| 19 |
!$omp end parallel |
| 20 |
|
| 21 |
print *, c |
| 22 |
|
| 23 |
end subroutine omp_copyprivate |