Files
clang-p2996/flang/test/Semantics/OpenMP/allocators05.f90
Krzysztof Parzyszek cdbd22876b [flang][OpenMP] Use new modifiers in ALLOCATE clause (#117627)
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.
2024-12-02 08:11:49 -06:00

27 lines
1012 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
! allocate directives that appear in a target region must specify an
! allocator clause unless a requires directive with the dynamic_allocators
! clause is present in the same compilation unit.
subroutine allocate()
use omp_lib
integer :: i
integer, allocatable :: a(:), b(:)
integer, parameter :: LEN = 2
!$omp target private(a, b)
!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(LEN))
!ERROR: ALLOCATORS directives that appear in a TARGET region must specify an allocator
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATORS directive appears
!$omp allocators allocate(b)
allocate(b(LEN))
!$omp end target
end subroutine