File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -1813,6 +1813,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPSectionsConstruct &x) {
1813
1813
case llvm::omp::Directive::OMPD_parallel_sections:
1814
1814
case llvm::omp::Directive::OMPD_sections:
1815
1815
PushContext (beginDir.source , beginDir.v );
1816
+ GetContext ().withinConstruct = true ;
1816
1817
break ;
1817
1818
default :
1818
1819
break ;
@@ -1825,6 +1826,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPCriticalConstruct &x) {
1825
1826
const auto &beginCriticalDir{std::get<parser::OmpCriticalDirective>(x.t )};
1826
1827
const auto &endCriticalDir{std::get<parser::OmpEndCriticalDirective>(x.t )};
1827
1828
PushContext (beginCriticalDir.source , llvm::omp::Directive::OMPD_critical);
1829
+ GetContext ().withinConstruct = true ;
1828
1830
if (const auto &criticalName{
1829
1831
std::get<std::optional<parser::Name>>(beginCriticalDir.t )}) {
1830
1832
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