1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
3 ! Check OpenMP construct validity for the following directives:
4 ! 2.21.2 Threadprivate Directive
8 integer, save :: x1
, x2
, x3
, x4
, x5
, x6
, x7
, x8
, x9
9 common /blk1
/ y1
, /blk2
/ y2
, /blk3
/ y3
, /blk4
/ y4
, /blk5
/ y5
11 !$omp threadprivate(x1, x2, x3, x4, x5, x6, x7, x8, x9)
12 !$omp threadprivate(/blk1/, /blk2/, /blk3/, /blk4/, /blk5/)
14 !$omp parallel num_threads(x1)
17 !ERROR: COPYPRIVATE clause is not allowed on the OMP SINGLE directive, use it on OMP END SINGLE directive
18 !$omp single copyprivate(x2, /blk1/)
22 !$omp end single copyprivate(x2, /blk1/)
24 !$omp do schedule(static, x3)
30 !$omp parallel copyin(x4, /blk2/)
33 !$omp parallel if(x5 > 1)
36 !$omp teams thread_limit(x6)
39 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause
40 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause
41 !$omp parallel private(x7, /blk3/)
44 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause
45 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause
46 !$omp parallel firstprivate(x8, /blk4/)
49 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause
50 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause
51 !$omp parallel shared(x9, /blk5/)