brintos

brintos / llvm-project-archived public Read only

0
0
Text · 878 B · 3609f38 Raw
27 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags4! OpenMP Version 5.05! 2.11.3 allocate Directive6! A variable that is part of another variable (as an array or7! structure element) cannot appear in an allocate directive.8subroutine allocate()9use omp_lib10 11  type my_type12    integer :: array(10)13  end type my_type14  type(my_type) :: my_var15  real, dimension (:,:), allocatable :: darray16  integer :: a, b17 18  !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive19  !$omp allocate(my_var%array)20  continue21 22  !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATE directive23  !$omp allocate(darray, my_var%array) allocator(omp_default_mem_alloc)24    allocate ( darray(a, b) )25 26end subroutine allocate27