gcc/testsuite/gfortran.dg/gomp/atomic-22.f90
raw| 1 | module mod |
| 2 | integer i, j |
| 3 | |
| 4 | contains |
| 5 | subroutine foo () |
| 6 | integer v |
| 7 | !$omp atomic release |
| 8 | i = i + 1 |
| 9 | !$omp atomic read |
| 10 | v = j |
| 11 | end |
| 12 | end module |
| 13 | |
| 14 | module m2 |
| 15 | !$omp requires atomic_default_mem_order (acq_rel) ! OK |
| 16 | contains |
| 17 | subroutine bar |
| 18 | !$omp atomic release |
| 19 | i = i + 1 |
| 20 | !$omp requires atomic_default_mem_order (acq_rel) ! { dg-error "must appear in the specification part of a program unit" } |
| 21 | !$omp atomic read |
| 22 | v = j |
| 23 | end subroutine |
| 24 | end module m2 |