[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / flang / test / Semantics / OpenMP / threadprivate04.f90
blob3d8c7fb8de8fa16774a6c0432de0278515c95ae5
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.1
3 ! Check OpenMP construct validity for the following directives:
4 ! 2.21.2 Threadprivate Directive
6 program main
7 integer :: i, N = 10
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)
15 !$omp end parallel
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/)
19 !$omp end single
21 !$omp single
22 !$omp end single copyprivate(x2, /blk1/)
24 !$omp do schedule(static, x3)
25 do i = 1, N
26 y1 = x3
27 end do
28 !$omp end do
30 !$omp parallel copyin(x4, /blk2/)
31 !$omp end parallel
33 !$omp parallel if(x5 > 1)
34 !$omp end parallel
36 !$omp teams thread_limit(x6)
37 !$omp end teams
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/)
42 !$omp end parallel
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/)
47 !$omp end parallel
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/)
52 !$omp end parallel
53 end