Debian Codegraph @

flang/test/Semantics/OpenMP/copyin03.f90

raw
1 ! RUN: %python %S/../test_errors.py %s %flang -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
8 program 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
33 end program omp_copyin