Skip to content

Commit 00f321e

Browse files
committed
[flang][OpenMP] Add test for checking overloaded operator in atomic update
1 parent 599adf3 commit 00f321e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
! REQUIRES: openmp_runtime
2+
3+
! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
4+
!
5+
6+
module new_operator
7+
implicit none
8+
private
9+
public operator(.MYOPERATOR.)
10+
11+
interface operator(.MYOPERATOR.)
12+
module procedure myprocedure
13+
end interface
14+
contains
15+
pure integer function myprocedure(param1, param2)
16+
integer, intent(in) :: param1, param2
17+
myprocedure = param1 + param2
18+
end function
19+
end module
20+
21+
program sample
22+
use omp_lib
23+
use new_operator
24+
implicit none
25+
integer :: x, y
26+
27+
28+
!$omp atomic update
29+
x = x / y
30+
31+
!$omp atomic update
32+
!ERROR: Invalid or missing operator in atomic update statement
33+
x = x .MYOPERATOR. y
34+
35+
!$omp atomic
36+
!ERROR: Invalid or missing operator in atomic update statement
37+
x = x .MYOPERATOR. y
38+
end program

0 commit comments

Comments
 (0)