Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / copyin03.f90
blob7c3759aa2e116a3af8ea9cc755810ee88cbd8cf6
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.
8 program omp_copyin
10 integer :: a(10), b(10)
11 common /cmn/ j, k
13 !$omp threadprivate(/cmn/)
15 j = 20
16 k = 10
18 !$omp parallel copyin(/cmn/)
19 a(:5) = k
20 b(:5) = j
21 !$omp end parallel
23 j = j + k
24 k = k * j
26 !$omp parallel copyin(j, k)
27 a(6:) = j
28 b(6:) = k
29 !$omp end parallel
31 print *, a, b
33 end program omp_copyin