[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-allocate01.f90
blob92a7c23ff2765152245aa9473fc0d456b2d3d1b3
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.0
3 ! 2.11.3 allocate Directive
4 ! The allocate directive must appear in the same scope as the declarations of
5 ! each of its list items and must follow all such declarations.
7 subroutine allocate()
8 use omp_lib
9 integer :: x
10 contains
11 subroutine sema()
12 integer :: a, b
13 real, dimension (:,:), allocatable :: darray
15 !ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
16 !$omp allocate(x)
17 print *, a
19 !ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
20 !$omp allocate(x) allocator(omp_default_mem_alloc)
21 allocate ( darray(a, b) )
22 end subroutine sema
24 end subroutine allocate