36 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags4! OpenMP Version 5.05! 2.11.3 allocate Directive6! List items specified in an allocate directive that is associated7! with an allocate statement must be variables that are allocated8! by the allocate statement.9 10subroutine allocate()11use omp_lib12 integer, dimension(:), allocatable :: a, b, c, d, e, f, &13 g, h, i, j, k, l14 15 !$omp allocate(a) allocator(omp_default_mem_alloc)16 allocate(a(1), b(2))17 18 !$omp allocate(c, d) allocator(omp_default_mem_alloc)19 allocate(c(3), d(4))20 21 !$omp allocate(e) allocator(omp_default_mem_alloc)22 !$omp allocate(f, g) allocator(omp_default_mem_alloc)23 !$omp allocate24 allocate(e(5), f(6), g(7))25 26 !ERROR: A list item on an executable ALLOCATE must be specified on the associated ALLOCATE statement27 !$omp allocate(h, i) allocator(omp_default_mem_alloc)28 allocate(h(8))29 30 !ERROR: A list item on an executable ALLOCATE must be specified on the associated ALLOCATE statement31 !$omp allocate(j, k) allocator(omp_default_mem_alloc)32 !$omp allocate(l) allocator(omp_default_mem_alloc)33 allocate(k(9), l(10))34 35end subroutine allocate36