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 module thread_private01
8 type my_type(kind_param
, len_param
)
9 integer, KIND
:: kind_param
10 integer, LEN
:: len_param
15 type(my_type(2, 4)) :: my_var
18 character(len
=32) :: w
19 integer, dimension(:), allocatable
:: y
21 !$omp threadprivate(my_var)
23 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
24 !$omp threadprivate(my_var%t_i)
26 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
27 !$omp threadprivate(my_var%t_arr)
29 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
30 !$omp threadprivate(my_var%kind_param)
32 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
33 !$omp threadprivate(my_var%len_param)
35 !$omp threadprivate(arr)
37 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
38 !$omp threadprivate(arr(1))
40 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
41 !$omp threadprivate(arr(1:2))
43 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
44 !$omp threadprivate(x%KIND)
46 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
47 !$omp threadprivate(w%LEN)
49 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
50 !$omp threadprivate(y%KIND)