Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / workshare01.f90
blob9667a306061c07411d7f2776e8454eb608764700
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
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)
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
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
24 !$omp parallel
25 !$omp single
26 cc = dd
27 !$omp end single
28 !$omp end parallel
30 ee = ff
31 !$omp end workshare
33 end subroutine workshare