1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
3 ! 2.7.4 workshare Construct
4 ! The !omp workshare construct must not contain any user defined
5 ! function calls unless the function is ELEMENTAL.
9 integer function my_func()
14 subroutine workshare(aa
, bb
, cc
, dd
, ee
, ff
, n
)
17 real aa(n
), bb(n
), cc(n
), dd(n
), ee(n
), ff(n
)
20 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
25 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
26 where (aa
.ne
. my_func()) aa
= bb
* cc
27 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
28 where (dd
.lt
. 5) dd
= aa
* my_func()
30 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
31 where (aa
.ge
. my_func())
32 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
34 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
35 elsewhere (aa
.le
. my_func())
36 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
39 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
43 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
44 forall (j
= 1:my_func()) aa(j
) = aa(j
) + bb(j
)
49 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
50 where (cc
.le
. j
) cc
= cc
+ my_func()
54 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
59 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
65 end subroutine workshare