41 lines · plain
1! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp2 3! 2.15.2 threadprivate Directive4! The threadprivate directive specifies that variables are replicated,5! with each thread having its own copy. When threadprivate variables are6! referenced in the OpenMP region, we know they are already private to7! their threads, so no new symbol needs to be created.8 9!DEF: /mm Module10module mm11 !$omp threadprivate (i)12contains13 !DEF: /mm/foo PUBLIC (Subroutine) Subprogram14 subroutine foo15 !DEF: /mm/foo/a ObjectEntity INTEGER(4)16 integer :: a = 317 !$omp parallel18 !DEF: /mm/foo/OtherConstruct1/a (OmpShared) HostAssoc INTEGER(4)19 a = 120 !DEF: /mm/i PUBLIC (Implicit, OmpThreadprivate) ObjectEntity INTEGER(4)21 !REF: /mm/foo/OtherConstruct1/a22 i = a23 !$omp end parallel24 !REF: /mm/foo/a25 print *, a26 block27 !DEF: /mm/foo/BlockConstruct1/i ObjectEntity REAL(4)28 real i29 !REF: /mm/foo/BlockConstruct1/i30 i = 3.1431 end block32 end subroutine foo33end module mm34!DEF: /TT MainProgram35program TT36 !REF: /mm37 use :: mm38 !DEF: /TT/foo (Subroutine) Use39 call foo40end program TT41