Skip to content

[flang][OpenMP] Add test for checking overloaded operator in atomic update #88471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions flang/test/Semantics/OpenMP/atomic-update-overloaded-ops.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp

module new_operator
implicit none

interface operator(.MYOPERATOR.)
module procedure myprocedure
end interface
contains
pure integer function myprocedure(param1, param2)
integer, intent(in) :: param1, param2
myprocedure = param1 + param2
end function
end module

program sample
use new_operator
implicit none
integer :: x, y

!$omp atomic update
x = x / y

!$omp atomic update
!ERROR: Invalid or missing operator in atomic update statement
x = x .MYOPERATOR. y

!$omp atomic
!ERROR: Invalid or missing operator in atomic update statement
x = x .MYOPERATOR. y
end program