[PATCH] D88556: [Flang][OpenMP] Fix issue in only a single nowait clause can appear on a sections directive.
sameeran joshi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 14 03:53:32 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3291041641fe: [Flang][OpenMP] Fix issue in only a single nowait clause can appear on a… (authored by sameeranjoshi).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D88556?vs=295242&id=298102#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88556/new/
https://reviews.llvm.org/D88556
Files:
flang/lib/Semantics/check-omp-structure.cpp
flang/test/Semantics/omp-clause-validity01.f90
flang/test/Semantics/omp-sections01.f90
Index: flang/test/Semantics/omp-sections01.f90
===================================================================
--- flang/test/Semantics/omp-sections01.f90
+++ flang/test/Semantics/omp-sections01.f90
@@ -1,5 +1,4 @@
! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
-! XFAIL: *
! OpenMP Version 4.5
! 2.7.2 sections Construct
@@ -10,7 +9,7 @@
!$omp sections
!$omp section
print *, "omp section"
- !ERROR: Only a single nowait clause can appear on a sections directive.
+ !ERROR: At most one NOWAIT clause can appear on the END SECTIONS directive
!$omp end sections nowait nowait
end program omp_sections
Index: flang/test/Semantics/omp-clause-validity01.f90
===================================================================
--- flang/test/Semantics/omp-clause-validity01.f90
+++ flang/test/Semantics/omp-clause-validity01.f90
@@ -261,6 +261,17 @@
d = 2
!ERROR: NUM_THREADS clause is not allowed on the END SECTIONS directive
!$omp end sections num_threads(4)
+
+ !$omp parallel
+ !$omp sections
+ b = 1
+ !$omp section
+ c = 1
+ d = 2
+ !ERROR: At most one NOWAIT clause can appear on the END SECTIONS directive
+ !$omp end sections nowait nowait
+ !$omp end parallel
+
!$omp end parallel
! 2.11.2 parallel-sections-clause -> parallel-clause |
Index: flang/lib/Semantics/check-omp-structure.cpp
===================================================================
--- flang/lib/Semantics/check-omp-structure.cpp
+++ flang/lib/Semantics/check-omp-structure.cpp
@@ -127,7 +127,7 @@
// 2.7.2 end-sections -> END SECTIONS [nowait-clause]
case llvm::omp::Directive::OMPD_sections:
SetContextDirectiveEnum(llvm::omp::Directive::OMPD_end_sections);
- SetContextAllowed(OmpClauseSet{llvm::omp::Clause::OMPC_nowait});
+ SetContextAllowedOnce(OmpClauseSet{llvm::omp::Clause::OMPC_nowait});
break;
default:
// no clauses are allowed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88556.298102.patch
Type: text/x-patch
Size: 1909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/4992f6ff/attachment.bin>
More information about the llvm-commits
mailing list