[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / flang / test / Semantics / OpenMP / allocate09.f90
blob0f93a340fe1e4be139d596c4abf9dc36f25401d7
1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! OpenMP Version 5.0
5 ! 2.11.3 allocate Directive
6 ! List items specified in an allocate directive that is associated
7 ! with an allocate statement must be variables that are allocated
8 ! by the allocate statement.
10 subroutine allocate()
11 use omp_lib
12 integer, dimension(:), allocatable :: a, b, c, d, e, f, &
13 g, h, i, j, k, l
15 !$omp allocate(a) allocator(omp_default_mem_alloc)
16 allocate(a(1), b(2))
18 !$omp allocate(c, d) allocator(omp_default_mem_alloc)
19 allocate(c(3), d(4))
21 !$omp allocate(e) allocator(omp_default_mem_alloc)
22 !$omp allocate(f, g) allocator(omp_default_mem_alloc)
23 !$omp allocate
24 allocate(e(5), f(6), g(7))
26 !ERROR: Object 'i' in ALLOCATE directive not found in corresponding ALLOCATE statement
27 !$omp allocate(h, i) allocator(omp_default_mem_alloc)
28 allocate(h(8))
30 !ERROR: Object 'j' in ALLOCATE directive not found in corresponding ALLOCATE statement
31 !$omp allocate(j, k) allocator(omp_default_mem_alloc)
32 !$omp allocate(l) allocator(omp_default_mem_alloc)
33 allocate(k(9), l(10))
35 end subroutine allocate