1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
5 ! Check OpenMP construct validity for the following directives:
6 ! 2.21.2 Threadprivate Directive
8 module thread_private01
10 type my_type(kind_param
, len_param
)
11 integer, KIND
:: kind_param
12 integer, LEN
:: len_param
17 type(my_type(2, 4)) :: my_var
20 character(len
=32) :: w
21 integer, dimension(:), allocatable
:: y
23 !$omp threadprivate(my_var)
25 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
26 !$omp threadprivate(my_var%t_i)
28 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
29 !$omp threadprivate(my_var%t_arr)
31 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
32 !$omp threadprivate(my_var%kind_param)
34 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
35 !$omp threadprivate(my_var%len_param)
37 !$omp threadprivate(arr)
39 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
40 !$omp threadprivate(arr(1))
42 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the THREADPRIVATE directive
43 !$omp threadprivate(arr(1:2))
45 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
46 !$omp threadprivate(x%KIND)
48 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
49 !$omp threadprivate(w%LEN)
51 !ERROR: A type parameter inquiry cannot appear on the THREADPRIVATE directive
52 !$omp threadprivate(y%KIND)