File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2119,6 +2119,7 @@ static bool IsPrivatizable(const Symbol *sym) {
21192119 *sym) && /* OpenMP 5.2, 5.1.1: Assumed-size arrays are shared*/
21202120 !sym->owner ().IsDerivedType () &&
21212121 sym->owner ().kind () != Scope::Kind::ImpliedDos &&
2122+ sym->owner ().kind () != Scope::Kind::Forall &&
21222123 !sym->detailsIf <semantics::AssocEntityDetails>() &&
21232124 !sym->detailsIf <semantics::NamelistDetails>() &&
21242125 (!misc ||
Original file line number Diff line number Diff line change 1+ ! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
2+
3+ ! OpenMP 5.2 5.1.1 Variables Referenced in a Construct
4+ ! FORALL indices have predetermined private DSA.
5+ ! As lowering already makes them private, check that their symbols are not
6+ ! modified.
7+
8+ ! DEF: /MainProgram1/a ObjectEntity INTEGER(4)
9+ ! DEF: /MainProgram1/b ObjectEntity INTEGER(4)
10+ integer a(5 ), b(5 )
11+
12+ ! REF: /MainProgram1/a
13+ a = 0
14+ ! REF: /MainProgram1/b
15+ b = 0
16+
17+ ! $omp parallel
18+ ! DEF: /MainProgram1/OtherConstruct1/Forall1/i (Implicit) ObjectEntity INTEGER(4)
19+ ! DEF: /MainProgram1/OtherConstruct1/a HostAssoc INTEGER(4)
20+ ! DEF: /MainProgram1/OtherConstruct1/b HostAssoc INTEGER(4)
21+ forall (i = 1 :5 ) a(i) = b(i) * 2
22+ ! $omp end parallel
23+
24+ ! $omp parallel default(private)
25+ ! DEF: /MainProgram1/OtherConstruct2/Forall1/i (Implicit) ObjectEntity INTEGER(4)
26+ ! DEF: /MainProgram1/OtherConstruct2/a (OmpPrivate) HostAssoc INTEGER(4)
27+ ! DEF: /MainProgram1/OtherConstruct2/b (OmpPrivate) HostAssoc INTEGER(4)
28+ forall (i = 1 :5 ) a(i) = b(i) * 2
29+ ! $omp end parallel
30+ end program
You can’t perform that action at this time.
0 commit comments