[flang-commits] [flang] 67002b5 - [flang][OpenMP] Fix semantic check of test case in taskloop simd construct
Arnamoy Bhattacharyya via flang-commits
flang-commits at lists.llvm.org
Wed Jul 14 07:33:34 PDT 2021
Author: Peixin Qiao
Date: 2021-07-14T10:34:17-04:00
New Revision: 67002b5f20c2c4c9bd5e89f79077ae8d6e165aae
URL: https://github.com/llvm/llvm-project/commit/67002b5f20c2c4c9bd5e89f79077ae8d6e165aae
DIFF: https://github.com/llvm/llvm-project/commit/67002b5f20c2c4c9bd5e89f79077ae8d6e165aae.diff
LOG: [flang][OpenMP] Fix semantic check of test case in taskloop simd construct
The following semantic check is removed in OpenMP Version 5.0:
```
Taskloop simd construct restrictions: No reduction clause can be specified.
```
Also fix several typos.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D105874
Added:
Modified:
flang/lib/Semantics/check-omp-structure.cpp
flang/test/Semantics/omp-clause-validity01.f90
flang/test/Semantics/omp-taskloop-simd01.f90
Removed:
################################################################################
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index bc6d4a3766636..e8e5ca991f14f 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -931,7 +931,7 @@ void OmpStructureChecker::Leave(const parser::OpenMPAtomicConstruct &) {
// 3. Checks on clauses which are not in 'struct OmpClause' from parse-tree.h.
void OmpStructureChecker::Leave(const parser::OmpClauseList &) {
- // 2.7 Loop Construct Restriction
+ // 2.7.1 Loop Construct Restriction
if (llvm::omp::doSet.test(GetContext().directive)) {
if (auto *clause{FindClause(llvm::omp::Clause::OMPC_schedule)}) {
// only one schedule clause is allowed
diff --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90
index fe0bcf8f4e854..79d3c1d6c2f9a 100644
--- a/flang/test/Semantics/omp-clause-validity01.f90
+++ b/flang/test/Semantics/omp-clause-validity01.f90
@@ -7,8 +7,6 @@
! 2.7.1 Loop construct
! ...
-! TODO: all the internal errors
-
integer :: b = 128
integer :: z, c = 32
integer, parameter :: num = 16
@@ -87,7 +85,7 @@
do i = 1, N
z = 2
enddo
- !$omp end target data
+ !$omp end target data
!ERROR: SCHEDULE clause is not allowed on the PARALLEL directive
!$omp parallel schedule(static)
@@ -177,7 +175,7 @@
exit outofparallel
end do inner
end do outer
- !$end omp do
+ !$omp end do
!$omp end parallel
end do outofparallel
diff --git a/flang/test/Semantics/omp-taskloop-simd01.f90 b/flang/test/Semantics/omp-taskloop-simd01.f90
index d7b2960d58823..7cfa384ab2d49 100644
--- a/flang/test/Semantics/omp-taskloop-simd01.f90
+++ b/flang/test/Semantics/omp-taskloop-simd01.f90
@@ -1,18 +1,15 @@
! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! XFAIL: *
+! REQUIRES: shell
-! OpenMP Version 4.5
-! 2.9.3 taskloop simd Construct
-! No reduction clause may be specified for !$omp taskloop simd.
+! OpenMP Version 5.0
+! 2.10.3 taskloop simd Construct
program omp_taskloop_simd
integer i , j , k
- !ERROR: Unexpected clause specified for !$OMP taskloop simd
!$omp taskloop simd reduction(+:k)
do i=1,10000
do j=1,i
- call loop_body(i, j)
k = k + 1
end do
end do
More information about the flang-commits
mailing list