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