1! RUN: %S/test_errors.sh %s %t %f18 -fopenmp 2! OpenMP Version 4.5 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. 6 7module my_mod 8 contains 9 integer function my_func() 10 my_func = 10 11 end function my_func 12end module my_mod 13 14subroutine workshare(aa, bb, cc, dd, ee, ff, n) 15 use my_mod 16 integer n, i, j 17 real aa(n), bb(n), cc(n), dd(n), ee(n), ff(n) 18 19 !$omp workshare 20 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct 21 aa = my_func() 22 cc = dd 23 ee = ff 24 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() 29 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 33 cc = aa + my_func() 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 37 cc = dd + my_func() 38 elsewhere 39 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct 40 cc = ee + my_func() 41 end where 42 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) 45 46 forall (j = 1:10) 47 aa(j) = aa(j) + bb(j) 48 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() 51 end forall 52 53 !$omp atomic update 54 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct 55 j = j + my_func() 56 57 !$omp atomic capture 58 i = j 59 !ERROR: User defined non-ELEMENTAL function 'my_func' is not allowed in a WORKSHARE construct 60 j = j - my_func() 61 !$omp end atomic 62 63 !$omp end workshare 64 65end subroutine workshare 66