1! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
2! OpenMP Version 4.5
3! 2.15.4.1 copyin Clause
4! A list item that appears in a copyin clause must be threadprivate.
5! Named variables appearing in a threadprivate common block may be specified
6! It is not necessary to specify the whole common block.
7
8program omp_copyin
9
10  integer :: a(10), b(10)
11  common /cmn/ j, k
12
13  !$omp threadprivate(/cmn/)
14
15  j = 20
16  k = 10
17
18  !$omp parallel copyin(/cmn/)
19  a(:5) = k
20  b(:5) = j
21  !$omp end parallel
22
23  j = j + k
24  k = k * j
25
26  !$omp parallel copyin(j, k)
27  a(6:) = j
28  b(6:) = k
29  !$omp end parallel
30
31  print *, a, b
32
33end program omp_copyin
34