25 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=504! OpenMP Version 5.25! Inherited from 2.11.3 allocate directive6! allocate directives that appear in a target region must specify an7! allocator clause unless a requires directive with the dynamic_allocators8! clause is present in the same compilation unit.9 10subroutine allocate()11 use omp_lib12 13 integer :: i14 integer, allocatable :: a(:), b(:)15 integer, parameter :: LEN = 216 17 !$omp target private(a, b)18 !$omp allocators allocate(omp_default_mem_alloc: a)19 allocate(a(LEN))20 !ERROR: An ALLOCATE clause in a TARGET region must specify an allocator or REQUIRES(DYNAMIC_ALLOCATORS) must be specified21 !$omp allocators allocate(b)22 allocate(b(LEN))23 !$omp end target24end subroutine25