File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1649,6 +1649,15 @@ void OmpAttributeVisitor::ResolveSeqLoopIndexInParallelOrTaskConstruct(
1649
1649
break ;
1650
1650
}
1651
1651
}
1652
+ // If this symbol already has a data-sharing attribute then there is nothing
1653
+ // to do here.
1654
+ if (const Symbol * symbol{iv.symbol }) {
1655
+ for (auto symMap : targetIt->objectWithDSA ) {
1656
+ if (symMap.first ->name () == symbol->name ()) {
1657
+ return ;
1658
+ }
1659
+ }
1660
+ }
1652
1661
// If this symbol is already Private or Firstprivate in the enclosing
1653
1662
// OpenMP parallel or task then there is nothing to do here.
1654
1663
if (auto *symbol{targetIt->scope .FindSymbol (iv.source )}) {
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
4
+ ! Iteration variables of non-associated loops may be listed in DSA clauses.
5
+
6
+ ! DEF: /shared_iv (Subroutine)Subprogram
7
+ subroutine shared_iv
8
+ ! DEF: /shared_iv/i ObjectEntity INTEGER(4)
9
+ integer i
10
+
11
+ ! $omp parallel shared(i)
12
+ ! $omp single
13
+ ! REF: /shared_iv/i
14
+ do i = 0 , 1
15
+ end do
16
+ ! $omp end single
17
+ ! $omp end parallel
18
+ end subroutine
You can’t perform that action at this time.
0 commit comments