[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-allocate05.f90
blob04bcf9119e0f883130d21f116e6da05ebe43cc20
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.0
3 ! 2.11.3 allocate Directive
4 ! allocate directives that appear in a target region must specify an allocator
5 ! clause unless a requires directive with the dynamic_allocators clause is present
6 ! in the same compilation unit.
8 subroutine allocate()
9 use omp_lib
10 integer :: a, b
11 real, dimension (:,:), allocatable :: darray
13 !$omp target
14 !$omp allocate allocator(omp_default_mem_alloc)
15 allocate ( darray(a, b) )
16 !$omp end target
18 !$omp target
19 !ERROR: ALLOCATE directives that appear in a TARGET region must specify an allocator clause
20 !$omp allocate
21 allocate ( darray(a, b) )
22 !$omp end target
24 end subroutine allocate