1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
4 ! 2.7.4 workshare Construct
5 ! The !omp workshare construct must not contain any user defined
6 ! function calls unless the function is ELEMENTAL.
10 integer function my_func()
15 subroutine workshare(aa
, bb
, cc
, dd
, ee
, ff
, n
)
18 real aa(n
), bb(n
), cc(n
), dd(n
), ee(n
), ff(n
)
21 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
26 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
27 where (aa
.ne
. my_func()) aa
= bb
* cc
28 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
29 where (dd
.lt
. 5) dd
= aa
* my_func()
31 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
32 where (aa
.ge
. my_func())
33 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
35 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
36 elsewhere (aa
.le
. my_func())
37 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
40 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
44 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
45 forall (j
= 1:my_func()) aa(j
) = aa(j
) + bb(j
)
50 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
51 where (cc
.le
. j
) cc
= cc
+ my_func()
55 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
60 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct
66 end subroutine workshare