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
6 program threadprivate02
9 real, save :: eq_a
, eq_b
, eq_c
, eq_d
11 !$omp threadprivate(arr1)
13 !$omp threadprivate(/blk1/)
15 !$omp threadprivate(blk1)
17 !ERROR: A variable in a THREADPRIVATE directive cannot be an element of a common block
18 !$omp threadprivate(a1)
20 equivalence(eq_a
, eq_b
)
21 !ERROR: A variable in a THREADPRIVATE directive cannot appear in an EQUIVALENCE statement
22 !$omp threadprivate(eq_a)
24 !ERROR: A variable in a THREADPRIVATE directive cannot appear in an EQUIVALENCE statement
25 !$omp threadprivate(eq_c)
26 equivalence(eq_c
, eq_d
)
31 integer, save :: arr3(10)
36 !ERROR: A variable that appears in a THREADPRIVATE directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
37 !$omp threadprivate(arr2)
39 !$omp threadprivate(arr3)
41 !$omp threadprivate(/blk2/)
43 !ERROR: A variable in a THREADPRIVATE directive cannot be an element of a common block
44 !$omp threadprivate(a2)
46 !$omp threadprivate(/blk3/)
48 !ERROR: A variable in a THREADPRIVATE directive cannot be an element of a common block
49 !$omp threadprivate(a3)
57 !$omp threadprivate(arr4)
59 !$omp threadprivate(/blk4/)
61 !$omp threadprivate(blk4)
63 !ERROR: A variable in a THREADPRIVATE directive cannot be an element of a common block
64 !$omp threadprivate(a4)
71 !ERROR: A variable that appears in a THREADPRIVATE directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
72 !$omp threadprivate(arr5)
74 !$omp threadprivate(/blk5/)
76 !ERROR: A variable that appears in a THREADPRIVATE directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
77 !$omp threadprivate(blk5)
79 !ERROR: A variable in a THREADPRIVATE directive cannot be an element of a common block
80 !$omp threadprivate(a5)