1! RUN: %S/test_errors.sh %s %t %flang_fc1 -fopenmp
2! REQUIRES: shell
3! OpenMP Version 5.0
4! 2.11.3 allocate Directive
5! A variable that is part of another variable (as an array or
6! structure element) cannot appear in an allocate directive.
7subroutine allocate()
8use omp_lib
9
10  type my_type
11    integer :: array(10)
12  end type my_type
13  type(my_type) :: my_var
14  real, dimension (:,:), allocatable :: darray
15  integer :: a, b
16
17  !!ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in an ALLOCATE directive
18  !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a PRIVATE or SHARED clause or 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 in a PRIVATE or SHARED clause or on the ALLOCATE directive.
22  !$omp allocate(darray, my_var%array) allocator(omp_default_mem_alloc)
23    allocate ( darray(a, b) )
24
25end subroutine allocate
26