| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenmp |
| 2 |
! OpenMP Version 4.5 |
| 3 |
! 2.7.4 workshare Construct |
| 4 |
! Invalid do construct inside !$omp workshare |
| 5 |
|
| 6 |
subroutine workshare(aa, bb, cc, dd, ee, ff, n) |
| 7 |
integer n, i |
| 8 |
real aa(n,n), bb(n,n), cc(n,n), dd(n,n), ee(n,n), ff(n,n) |
| 9 |
|
| 10 |
!ERROR: The structured block in a WORKSHARE construct may consist of only SCALAR or ARRAY assignments, FORALL or WHERE statements, FORALL, WHERE, ATOMIC, CRITICAL or PARALLEL constructs |
| 11 |
!ERROR: OpenMP constructs enclosed in WORKSHARE construct may consist of ATOMIC, CRITICAL or PARALLEL constructs only |
| 12 |
!$omp workshare |
| 13 |
do i = 1, n |
| 14 |
print *, "omp workshare" |
| 15 |
end do |
| 16 |
|
| 17 |
!$omp critical |
| 18 |
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region |
| 19 |
!$omp single |
| 20 |
aa = bb |
| 21 |
!$omp end single |
| 22 |
!$omp end critical |
| 23 |
|
| 24 |
!$omp parallel |
| 25 |
!$omp single |
| 26 |
cc = dd |
| 27 |
!$omp end single |
| 28 |
!$omp end parallel |
| 29 |
|
| 30 |
ee = ff |
| 31 |
!$omp end workshare |
| 32 |
|
| 33 |
end subroutine workshare |