1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
3 ! 2.15.4.2 copyprivate Clause
4 ! All list items that appear in the copyprivate clause must be either
5 ! threadprivate or private in the enclosing context.
7 program omp_copyprivate
8 integer :: a(10), b(10)
11 !$omp threadprivate(k)
20 !$omp end single copyprivate(k)
23 !ERROR: COPYPRIVATE variable 'b' is not PRIVATE or THREADPRIVATE in outer context
24 !$omp end single copyprivate(b)
27 !$omp parallel sections private(a)
32 !ERROR: COPYPRIVATE variable 'a' is not PRIVATE or THREADPRIVATE in outer context
33 !$omp end single copyprivate(a)
35 !$omp end parallel sections
37 !The use of FIRSTPRIVATE with COPYPRIVATE is allowed
38 !$omp parallel firstprivate(a)
41 !$omp end single copyprivate(a)
46 end program omp_copyprivate