Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / threadprivate04.f90
blobf523711f415671f01ae9dd4fc168ec9304913f10
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 !$omp single copyprivate(x2, /blk1/)
18 !$omp end single
20 !$omp do schedule(static, x3)
21 do i = 1, N
22 y1 = x3
23 end do
24 !$omp end do
26 !$omp parallel copyin(x4, /blk2/)
27 !$omp end parallel
29 !$omp parallel if(x5 > 1)
30 !$omp end parallel
32 !$omp teams thread_limit(x6)
33 !$omp end teams
35 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause
36 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause
37 !$omp parallel private(x7, /blk3/)
38 !$omp end parallel
40 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause
41 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause
42 !$omp parallel firstprivate(x8, /blk4/)
43 !$omp end parallel
45 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause
46 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause
47 !$omp parallel shared(x9, /blk5/)
48 !$omp end parallel
49 end