Skip to content

Commit 98ea51a

Browse files
[Flang][OpenMP] Reenable and fix final few tests 6/6
Add do02.f90 and taskloop03.f90 that were removed in #92739 Replace shell script tests with python. Remove XFAIL from a test that can be enabled now.
1 parent ebc6c28 commit 98ea51a

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

flang/test/Semantics/OpenMP/do02.f90

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
2+
3+
! OpenMP Version 4.5
4+
! 2.7.1 Loop Construct
5+
! Exit statement terminating !$OMP DO loop
6+
7+
program omp_do
8+
integer i, j, k
9+
10+
!$omp do
11+
do i = 1, 10
12+
do j = 1, 10
13+
print *, "Hello"
14+
end do
15+
!ERROR: EXIT to construct outside of DO construct is not allowed
16+
exit
17+
end do
18+
!$omp end do
19+
20+
end program omp_do

flang/test/Semantics/OpenMP/sections03.f90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
! UNSUPPORTED: system-windows
2-
! Marking as unsupported due to suspected long runtime on Windows
3-
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
4-
!XFAIL: *
1+
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
2+
! XFAIL: *
53
! OpenMP version 5.0.0
64
! 2.8.1 sections construct
75
! 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

flang/test/Semantics/OpenMP/simd03.f90

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
! UNSUPPORTED: system-windows
2-
! Marking as unsupported due to suspected long runtime on Windows
3-
! RUN: %S/test_errors.sh %s %t %flang -fopenmp
4-
! XFAIL: *
1+
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
52

63
! OpenMP Version 4.5
74
! 2.8.1 simd Construct
@@ -16,7 +13,7 @@ program omp_simd
1613

1714
!$omp simd
1815
do i = 1, 10
19-
!ERROR: Invalid OpenMP construct inside simd region
16+
!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.
2017
!$omp single
2118
a(i) = i
2219
!$omp end single
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
2+
3+
! OpenMP Version 4.5
4+
! 2.9.2 taskloop Construct
5+
! All loops associated with the taskloop construct must be perfectly nested,
6+
! there must be no intervening code or any OpenMP directive between
7+
! any two loops
8+
9+
program omp_taskloop
10+
integer i, j
11+
12+
!$omp taskloop private(j) grainsize(500) nogroup
13+
do i=1, 10000
14+
do j=1, i
15+
call loop_body(i, j)
16+
end do
17+
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
18+
!$omp single
19+
print *, "omp single"
20+
!$omp end single
21+
end do
22+
!$omp end taskloop
23+
24+
end program omp_taskloop

0 commit comments

Comments
 (0)