Debian Codegraph @

flang/test/Semantics/OpenMP/allocate03.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 ! A variable that is part of another variable (as an array or
7 ! structure element) cannot appear in an allocate directive.
8 subroutine allocate()
9 use omp_lib
10
11 type my_type
12 integer :: array(10)
13 end type my_type
14 type(my_type) :: my_var
15 real, dimension (:,:), allocatable :: darray
16 integer :: a, b
17
18 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive
19 !$omp allocate(my_var%array)
20
21 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive
22 !$omp allocate(darray, my_var%array) allocator(omp_default_mem_alloc)
23 allocate ( darray(a, b) )
24
25 end subroutine allocate