Files
clang-p2996/flang/test/Semantics/OpenMP/allocators06.f90
Ethan Luis McDonough 7f0d54b429 [flang][openmp] Allocators construct semantic checks
This patch applies the semantic checks for executable allocation directives to the new allocators construct.  It also introduces a new check that ensures all items in the list appear in the corresponding Fortran allocate statement.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D150428
2023-08-02 12:59:06 -05:00

17 lines
594 B
Fortran

! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! 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