Again, this simplifies the semantic checks and lowering quite a bit. Update the check for positive alignment to use a more informative message, and to highlight the modifier itsef, not the whole clause. Remove the checks for the allocator expression itself being positive: there is nothing in the spec that says that it should be positive. Remove the "simple" modifier from the AllocateT template, since both simple and complex modifiers are the same thing, only differing in syntax.
19 lines
647 B
Fortran
19 lines
647 B
Fortran
! REQUIRES: openmp_runtime
|
|
|
|
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
|
|
! OpenMP Version 5.2
|
|
! Inherited from 2.11.3 allocate directive
|
|
! The allocate directive must appear in the same scope as the declarations of
|
|
! each of its list items and must follow all such declarations.
|
|
|
|
subroutine allocate()
|
|
use omp_lib
|
|
integer, allocatable :: a
|
|
contains
|
|
subroutine test()
|
|
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATORS directive appears
|
|
!$omp allocators allocate(omp_default_mem_alloc: a)
|
|
allocate(a)
|
|
end subroutine
|
|
end subroutine
|