llvm-project/flang/test/Semantics/omp-atomic.f90

23 lines
321 B
Fortran

! OPTIONS: -fopenmp
! Check OpenMP 2.13.6 atomic Construct
a = 1.0
!$omp parallel num_threads(4)
!$omp atomic seq_cst, read
b = a
!$omp atomic seq_cst write
a = b
!$omp end atomic
!$omp atomic capture seq_cst
b = a
a = a + 1
!$omp end atomic
!$omp atomic
a = a + 1
!$omp end parallel
end