xref: /llvm-project/flang/test/Semantics/OpenMP/allocators06.f90 (revision cdbd22876b71acad9e5eeceadc0d8859e6e73b18)
1! REQUIRES: openmp_runtime
2
3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
4! OpenMP Version 5.2
5! Inherited from 2.11.3 allocate directive
6! The allocate directive must appear in the same scope as the declarations of
7! each of its list items and must follow all such declarations.
8
9subroutine allocate()
10    use omp_lib
11    integer, allocatable :: a
12contains
13    subroutine test()
14        !ERROR: List items must be declared in the same scoping unit in which the ALLOCATORS directive appears
15        !$omp allocators allocate(omp_default_mem_alloc: a)
16            allocate(a)
17    end subroutine
18end subroutine
19