[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-allocate03.f90
blob320a9c9ea4122d2cd2ca4e70630ef8065853f050
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.0
3 ! 2.11.3 allocate Directive
4 ! A variable that is part of another variable (as an array or
5 ! structure element) cannot appear in an allocate directive.
6 subroutine allocate()
7 use omp_lib
9 type my_type
10 integer :: array(10)
11 end type my_type
12 type(my_type) :: my_var
13 real, dimension (:,:), allocatable :: darray
14 integer :: a, b
16 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive
17 !$omp allocate(my_var%array)
19 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive
20 !$omp allocate(darray, my_var%array) allocator(omp_default_mem_alloc)
21 allocate ( darray(a, b) )
23 end subroutine allocate