| 1 |
! { dg-do compile } |
| 2 |
|
| 3 |
module m |
| 4 |
use iso_fortran_env |
| 5 |
implicit none |
| 6 |
integer, parameter :: mrk = maxval(real_kinds) |
| 7 |
integer x, r, z |
| 8 |
real(kind(4.0d0)) d, v |
| 9 |
real(mrk) ld |
| 10 |
|
| 11 |
contains |
| 12 |
subroutine foo (y, e, f) |
| 13 |
integer :: y |
| 14 |
real(kind(4.0d0)) :: e |
| 15 |
real(mrk) :: f |
| 16 |
!$omp atomic update seq_cst fail(acquire) |
| 17 |
x = min(x, y) |
| 18 |
!$omp atomic relaxed fail(relaxed) |
| 19 |
d = max (e, d) |
| 20 |
!$omp atomic fail(SEQ_CST) |
| 21 |
d = min (d, f) |
| 22 |
!$omp atomic seq_cst compare fail(relaxed) |
| 23 |
if (x == 7) x = 24 |
| 24 |
!$omp atomic compare |
| 25 |
if (x == 7) x = 24 |
| 26 |
!$omp atomic compare |
| 27 |
if (x == 123) x = 256 |
| 28 |
!$omp atomic compare |
| 29 |
if (ld == f) ld = 5.0_mrk |
| 30 |
!$omp atomic compare |
| 31 |
if (x == 9) then |
| 32 |
x = 5 |
| 33 |
endif |
| 34 |
!$omp atomic compare update capture seq_cst fail(acquire) |
| 35 |
if (x == 42) then |
| 36 |
x = f |
| 37 |
else |
| 38 |
v = x |
| 39 |
endif |
| 40 |
!$omp atomic capture compare weak |
| 41 |
if (x == 42) then |
| 42 |
x = f |
| 43 |
else |
| 44 |
v = x |
| 45 |
endif |
| 46 |
!$omp atomic capture compare fail(seq_cst) |
| 47 |
if (d == 8.0) then |
| 48 |
d = 16.0 |
| 49 |
else |
| 50 |
v = d |
| 51 |
end if |
| 52 |
end |
| 53 |
end module |