Skip to content

Commit f4446e4

Browse files
[Test] Add tests
1 parent 0ed7e2c commit f4446e4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

flang/test/Semantics/OpenMP/workshare02.f90

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ module my_mod
99
integer function my_func()
1010
my_func = 10
1111
end function my_func
12+
13+
impure integer function impure_my_func()
14+
impure_my_func_ = 20
15+
end function impure_my_func
16+
17+
impure elemental integer function impure_ele_my_func()
18+
impure_ele_my_func = 20
19+
end function impure_ele_my_func
1220
end module my_mod
1321

1422
subroutine workshare(aa, bb, cc, dd, ee, ff, n)
@@ -61,6 +69,16 @@ subroutine workshare(aa, bb, cc, dd, ee, ff, n)
6169
j = j - my_func()
6270
!$omp end atomic
6371

72+
!ERROR: User defined IMPURE, non-ELEMENTAL function 'impure_my_func' is not allowed in a WORKSHARE construct
73+
cc = impure_my_func()
74+
!ERROR: User defined IMPURE function 'impure_ele_my_func' is not allowed in a WORKSHARE construct
75+
aa(1) = impure_ele_my_func()
76+
6477
!$omp end workshare
6578

79+
!$omp workshare
80+
j = j + 1
81+
!ERROR: At most one NOWAIT clause can appear on the END WORKSHARE directive
82+
!$omp end workshare nowait nowait
83+
6684
end subroutine workshare

0 commit comments

Comments
 (0)