[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / flang / test / Semantics / OpenMP / allocators04.f90
blob212e48fbd1b263808fca3c711c3f9aa5e2a55a93
1 ! REQUIRES: openmp_runtime
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 ! If list items within the ALLOCATE directive have the SAVE attribute, are a common block name, or are declared in the scope of a
7 ! module, then only predefined memory allocator parameters can be used in the allocator clause
8 ! SAVE and common block names can't be declared as allocatable, only module scope variables are tested
10 module AllocateModule
11 integer, allocatable :: a, b
12 end module
14 subroutine allocate()
15 use omp_lib
16 use AllocateModule
18 integer(kind=omp_allocator_handle_kind) :: custom_allocator
19 type(omp_alloctrait) :: trait(1)
21 trait(1)%key = fallback
22 trait(1)%value = default_mem_fb
23 custom_allocator = omp_init_allocator(omp_default_mem_space, 1, trait)
25 !$omp allocators allocate(omp_default_mem_alloc: a)
26 allocate(a)
28 !ERROR: If list items within the ALLOCATORS directive have the SAVE attribute, are a common block name, or are declared in the scope of a module, then only predefined memory allocator parameters can be used in the allocator clause
29 !$omp allocators allocate(custom_allocator: b)
30 allocate(b)
31 end subroutine