File tree 3 files changed +39
-0
lines changed 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -1811,6 +1811,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPSectionsConstruct &x) {
1811
1811
case llvm::omp::Directive::OMPD_parallel_sections:
1812
1812
case llvm::omp::Directive::OMPD_sections:
1813
1813
PushContext (beginDir.source , beginDir.v );
1814
+ GetContext ().withinConstruct = true ;
1814
1815
break ;
1815
1816
default :
1816
1817
break ;
@@ -1823,6 +1824,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPCriticalConstruct &x) {
1823
1824
const auto &beginCriticalDir{std::get<parser::OmpCriticalDirective>(x.t )};
1824
1825
const auto &endCriticalDir{std::get<parser::OmpEndCriticalDirective>(x.t )};
1825
1826
PushContext (beginCriticalDir.source , llvm::omp::Directive::OMPD_critical);
1827
+ GetContext ().withinConstruct = true ;
1826
1828
if (const auto &criticalName{
1827
1829
std::get<std::optional<parser::Name>>(beginCriticalDir.t )}) {
1828
1830
ResolveOmpName (*criticalName, Symbol::Flag::OmpCriticalLock);
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
2
+
3
+ ! Check that loop iteration variables are private and predetermined, even when
4
+ ! nested inside parallel/critical constructs.
5
+
6
+ ! DEF: /test1 (Subroutine) Subprogram
7
+ subroutine test1
8
+ ! DEF: /test1/i ObjectEntity INTEGER(4)
9
+ integer i
10
+
11
+ ! $omp parallel default(none)
12
+ ! $omp critical
13
+ ! DEF: /test1/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
14
+ do i = 1 , 10
15
+ end do
16
+ ! $omp end critical
17
+ ! $omp end parallel
18
+ end subroutine
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
2
+
3
+ ! Check that loop iteration variables are private and predetermined, even when
4
+ ! nested inside parallel/sections constructs.
5
+
6
+ ! DEF: /test1 (Subroutine) Subprogram
7
+ subroutine test1
8
+ ! DEF: /test1/i ObjectEntity INTEGER(4)
9
+ integer i
10
+
11
+ ! $omp parallel default(none)
12
+ ! $omp sections
13
+ ! $omp section
14
+ ! DEF: /test1/OtherConstruct1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
15
+ do i = 1 , 10
16
+ end do
17
+ ! $omp end sections
18
+ ! $omp end parallel
19
+ end subroutine
You can’t perform that action at this time.
0 commit comments