Re-land commit 3787fd942f
This patch adds support for storing OpenMP REQUIRES information in the
semantics symbols for programs/subprograms and modules/submodules, and
populates them during directive resolution. A pass is added to name resolution
that makes sure this information is also propagated across top-level programs,
functions and subprograms.
Storing REQUIRES information inside of semantics symbols will also allow
supporting the propagation of this information across Fortran modules. This
will come as a separate patch.
The `bool DirectiveAttributeVisitor::Pre(const parser::SpecificationPart &x)`
method is removed since it resulted in specification parts being visited twice.
This is patch 3/5 of a series splitting D149337 to simplify review.
Differential Revision: https://reviews.llvm.org/D157983
15 lines
485 B
Fortran
15 lines
485 B
Fortran
! RUN: %python %S/../test_errors.py %s %flang -fopenmp
|
|
! OpenMP Version 5.0
|
|
! 2.4 Requires directive
|
|
! All atomic_default_mem_order clauses in 'requires' directives found within a
|
|
! compilation unit must specify the same ordering.
|
|
|
|
subroutine f
|
|
!$omp requires atomic_default_mem_order(seq_cst)
|
|
end subroutine f
|
|
|
|
!ERROR: Conflicting 'ATOMIC_DEFAULT_MEM_ORDER' REQUIRES clauses found in compilation unit
|
|
subroutine g
|
|
!$omp requires atomic_default_mem_order(relaxed)
|
|
end subroutine g
|