| 1 |
! REQUIRES: openmp_runtime |
| 2 |
|
| 3 |
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags |
| 4 |
! OpenMP Version 5.2 |
| 5 |
! 6.7 allocators construct |
| 6 |
! A variable that is part of another variable (as an array or |
| 7 |
! structure element) cannot appear in an allocatprs construct. |
| 8 |
|
| 9 |
subroutine allocate() |
| 10 |
use omp_lib |
| 11 |
|
| 12 |
type my_type |
| 13 |
integer, allocatable :: array(:) |
| 14 |
end type my_type |
| 15 |
|
| 16 |
type(my_type) :: my_var |
| 17 |
|
| 18 |
!ERROR: A variable that is part of another variable (as an array or structure element) cannot appear on the ALLOCATORS directive |
| 19 |
!$omp allocators allocate(my_var%array) |
| 20 |
allocate(my_var%array(10)) |
| 21 |
|
| 22 |
end subroutine allocate |