[HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (#117017)
[llvm-project.git] / flang / test / Semantics / OpenMP / threadprivate01.f90
blobc2cf9ba99ab046cf1ff9e95064c58bb525e78854
1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! OpenMP Version 5.1
5 ! Check OpenMP construct validity for the following directives:
6 ! 2.21.2 Threadprivate Directive
8 module thread_private01
9 use omp_lib
10 type my_type(kind_param, len_param)
11 integer, KIND :: kind_param
12 integer, LEN :: len_param
13 integer :: t_i
14 integer :: t_arr(10)
15 end type my_type
17 type(my_type(2, 4)) :: my_var
18 integer :: arr(10)
19 integer(kind=4) :: x
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)
53 end