Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / symbol05.f90
blobfa0a8f65a429412ae2f46fd85cdfd33c12a5f6cc
1 ! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
3 ! 2.15.2 threadprivate Directive
4 ! The threadprivate directive specifies that variables are replicated,
5 ! with each thread having its own copy. When threadprivate variables are
6 ! referenced in the OpenMP region, we know they are already private to
7 ! their threads, so no new symbol needs to be created.
9 !DEF: /mm Module
10 module mm
11 !$omp threadprivate (i)
12 contains
13 !DEF: /mm/foo PUBLIC (Subroutine) Subprogram
14 subroutine foo
15 !DEF: /mm/foo/a ObjectEntity INTEGER(4)
16 integer :: a = 3
17 !$omp parallel
18 !REF: /mm/foo/a
19 a = 1
20 !DEF: /mm/i PUBLIC (Implicit, OmpThreadprivate) ObjectEntity INTEGER(4)
21 !REF: /mm/foo/a
22 i = a
23 !$omp end parallel
24 !REF: /mm/foo/a
25 print *, a
26 block
27 !DEF: /mm/foo/BlockConstruct1/i ObjectEntity REAL(4)
28 real i
29 !REF: /mm/foo/BlockConstruct1/i
30 i = 3.14
31 end block
32 end subroutine foo
33 end module mm
34 !DEF: /tt MainProgram
35 program tt
36 !REF: /mm
37 use :: mm
38 !DEF: /tt/foo (Subroutine) Use
39 call foo
40 end program tt