Debian Codegraph @

flang/test/Semantics/OpenMP/allocate05.f90

raw
1 ! REQUIRES: openmp_runtime
2
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! OpenMP Version 5.0
5 ! 2.11.3 allocate Directive
6 ! allocate directives that appear in a target region must specify an allocator
7 ! clause unless a requires directive with the dynamic_allocators clause is present
8 ! in the same compilation unit.
9
10 subroutine allocate()
11 use omp_lib
12 integer :: a, b
13 real, dimension (:,:), allocatable :: darray
14
15 !$omp target
16 !$omp allocate allocator(omp_default_mem_alloc)
17 allocate ( darray(a, b) )
18 !$omp end target
19
20 !$omp target
21 !ERROR: ALLOCATE directives that appear in a TARGET region must specify an allocator clause
22 !$omp allocate
23 allocate ( darray(a, b) )
24 !$omp end target
25
26 end subroutine allocate