
The previous approach rewrote the atomic constructs in the AST based on the REQUIRES ATOMIC_DEFAULT_MEM_ORDER directives. The new approach checks for incorrect uses of REQUIRED ADMO in the semantic analysis, and applies it in lowering, eliminating the need for a separate tree-rewriting procedure.
17 lines
301 B
Fortran
17 lines
301 B
Fortran
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s
|
|
|
|
module m
|
|
!$omp requires atomic_default_mem_order(acquire)
|
|
|
|
contains
|
|
|
|
subroutine f00(x, v)
|
|
integer :: x, v
|
|
!CHECK: omp.atomic.write %{{[ %#=0-9]+}} memory_order(relaxed)
|
|
!$omp atomic write
|
|
x = v
|
|
end
|
|
|
|
end module
|
|
|