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