The ALLOCATORS construct is one of the few constructs that require a special form of the associated block. Convert the AST node to use OmpDirectiveSpecification for the directive and the optional end directive, and to use parser::Block as the body: the form of the block is checked in the semantic checks (with a more meaningful message).
28 lines
634 B
Fortran
28 lines
634 B
Fortran
!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
|
|
|
|
subroutine f00
|
|
implicit none
|
|
integer, allocatable :: a(:)
|
|
|
|
!$omp allocators allocate(a)
|
|
!ERROR: The body of the ALLOCATORS construct should be an ALLOCATE statement
|
|
continue
|
|
end
|
|
|
|
subroutine f01
|
|
implicit none
|
|
integer, allocatable :: a(:)
|
|
|
|
!ERROR: The ALLOCATORS construct should contain a single ALLOCATE statement
|
|
!$omp allocators allocate(a)
|
|
!$omp end allocators
|
|
end
|
|
|
|
subroutine f02
|
|
implicit none
|
|
integer, allocatable :: a(:)
|
|
|
|
!ERROR: The ALLOCATORS construct should contain a single ALLOCATE statement
|
|
!$omp allocators allocate(a)
|
|
end
|