| 1 |
function foo (x, y) result (z) |
| 2 |
!$omp requires atomic_default_mem_order(release) |
| 3 |
implicit none |
| 4 |
real :: x, y, z |
| 5 |
|
| 6 |
!$omp atomic write |
| 7 |
x = y |
| 8 |
|
| 9 |
!$omp atomic update |
| 10 |
x = x + 1 |
| 11 |
|
| 12 |
!$omp atomic read ! { dg-error "!.OMP ATOMIC READ at .1. incompatible with RELEASE clause implicitly provided by a REQUIRES directive" } |
| 13 |
z = x |
| 14 |
end |
| 15 |
|
| 16 |
function bar (a, b) result (c) |
| 17 |
!$omp requires atomic_default_mem_order(acquire) |
| 18 |
implicit none |
| 19 |
real :: a, b, c |
| 20 |
|
| 21 |
!$omp atomic write ! { dg-error "!.OMP ATOMIC WRITE at .1. incompatible with ACQUIRES clause implicitly provided by a REQUIRES directive" } |
| 22 |
a = b |
| 23 |
|
| 24 |
!$omp atomic update |
| 25 |
a = a + 1 |
| 26 |
|
| 27 |
!$omp atomic read |
| 28 |
c = a |
| 29 |
end |
| 30 |
|
| 31 |
|