2022-04-18 15:02:25 -07:00

27 lines
593 B
Fortran

! @@name: atomic_restrict.3
! @@type: F-fixed
! @@compilable: maybe
! @@linkable: no
! @@expect: failure
! @@version: omp_3.1
SUBROUTINE ATOMIC_WRONG3
INTEGER:: I
REAL:: R
EQUIVALENCE(I,R)
!$OMP PARALLEL
!$OMP ATOMIC UPDATE
I = I + 1
! incorrect because I and R reference the same location
! but have different types
!$OMP END PARALLEL
!$OMP PARALLEL
!$OMP ATOMIC UPDATE
R = R + 1.0
! incorrect because I and R reference the same location
! but have different types
!$OMP END PARALLEL
END SUBROUTINE ATOMIC_WRONG3