[flang-commits] [flang] [Flang][OpenMP] Reenable and fix final few tests 6/6 (PR #93295)
via flang-commits
flang-commits at lists.llvm.org
Fri May 24 03:51:19 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-openmp
@llvm/pr-subscribers-flang-semantics
Author: Kiran Chandramohan (kiranchandramohan)
<details>
<summary>Changes</summary>
Add do02.f90 and taskloop03.f90 that were removed in https://github.com/llvm/llvm-project/pull/92739
Replace shell script tests with python.
Remove XFAIL from a test that can be enabled now.
---
Full diff: https://github.com/llvm/llvm-project/pull/93295.diff
4 Files Affected:
- (added) flang/test/Semantics/OpenMP/do02.f90 (+20)
- (modified) flang/test/Semantics/OpenMP/sections03.f90 (+2-4)
- (modified) flang/test/Semantics/OpenMP/simd03.f90 (+2-5)
- (added) flang/test/Semantics/OpenMP/taskloop03.f90 (+24)
``````````diff
diff --git a/flang/test/Semantics/OpenMP/do02.f90 b/flang/test/Semantics/OpenMP/do02.f90
new file mode 100644
index 0000000000000..987593a39c036
--- /dev/null
+++ b/flang/test/Semantics/OpenMP/do02.f90
@@ -0,0 +1,20 @@
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
+
+! OpenMP Version 4.5
+! 2.7.1 Loop Construct
+! Exit statement terminating !$OMP DO loop
+
+program omp_do
+ integer i, j, k
+
+ !$omp do
+ do i = 1, 10
+ do j = 1, 10
+ print *, "Hello"
+ end do
+ !ERROR: EXIT to construct outside of DO construct is not allowed
+ exit
+ end do
+ !$omp end do
+
+end program omp_do
diff --git a/flang/test/Semantics/OpenMP/sections03.f90 b/flang/test/Semantics/OpenMP/sections03.f90
index b170f8674d19d..921e27f2e1c38 100644
--- a/flang/test/Semantics/OpenMP/sections03.f90
+++ b/flang/test/Semantics/OpenMP/sections03.f90
@@ -1,7 +1,5 @@
-! UNSUPPORTED: system-windows
-! Marking as unsupported due to suspected long runtime on Windows
-! RUN: %python %S/../test_errors.py %s %flang -fopenmp
-!XFAIL: *
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
+! XFAIL: *
! OpenMP version 5.0.0
! 2.8.1 sections construct
! Orphaned section directives are prohibited. That is, the section directives must appear within the sections construct and must not be encountered elsewhere in the sections region
diff --git a/flang/test/Semantics/OpenMP/simd03.f90 b/flang/test/Semantics/OpenMP/simd03.f90
index 8df48368fa969..944114839b591 100644
--- a/flang/test/Semantics/OpenMP/simd03.f90
+++ b/flang/test/Semantics/OpenMP/simd03.f90
@@ -1,7 +1,4 @@
-! UNSUPPORTED: system-windows
-! Marking as unsupported due to suspected long runtime on Windows
-! RUN: %S/test_errors.sh %s %t %flang -fopenmp
-! XFAIL: *
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
! OpenMP Version 4.5
! 2.8.1 simd Construct
@@ -16,7 +13,7 @@ program omp_simd
!$omp simd
do i = 1, 10
- !ERROR: Invalid OpenMP construct inside simd region
+ !ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct and the `ORDERED` construct with the `SIMD` clause.
!$omp single
a(i) = i
!$omp end single
diff --git a/flang/test/Semantics/OpenMP/taskloop03.f90 b/flang/test/Semantics/OpenMP/taskloop03.f90
new file mode 100644
index 0000000000000..afb880d73844d
--- /dev/null
+++ b/flang/test/Semantics/OpenMP/taskloop03.f90
@@ -0,0 +1,24 @@
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
+
+! OpenMP Version 4.5
+! 2.9.2 taskloop Construct
+! All loops associated with the taskloop construct must be perfectly nested,
+! there must be no intervening code or any OpenMP directive between
+! any two loops
+
+program omp_taskloop
+ integer i, j
+
+ !$omp taskloop private(j) grainsize(500) nogroup
+ do i=1, 10000
+ do j=1, i
+ call loop_body(i, j)
+ end do
+ !ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
+ !$omp single
+ print *, "omp single"
+ !$omp end single
+ end do
+ !$omp end taskloop
+
+end program omp_taskloop
``````````
</details>
https://github.com/llvm/llvm-project/pull/93295
More information about the flang-commits
mailing list