| 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 |
! List items specified in an allocate directive that is associated |
| 7 |
! with an allocate statement must be variables that are allocated |
| 8 |
! by the allocate statement. |
| 9 |
|
| 10 |
subroutine allocate() |
| 11 |
use omp_lib |
| 12 |
integer, dimension(:), allocatable :: a, b, c, d, e, f, & |
| 13 |
g, h, i, j, k, l |
| 14 |
|
| 15 |
!$omp allocate(a) allocator(omp_default_mem_alloc) |
| 16 |
allocate(a(1), b(2)) |
| 17 |
|
| 18 |
!$omp allocate(c, d) allocator(omp_default_mem_alloc) |
| 19 |
allocate(c(3), d(4)) |
| 20 |
|
| 21 |
!$omp allocate(e) allocator(omp_default_mem_alloc) |
| 22 |
!$omp allocate(f, g) allocator(omp_default_mem_alloc) |
| 23 |
!$omp allocate |
| 24 |
allocate(e(5), f(6), g(7)) |
| 25 |
|
| 26 |
!ERROR: Object 'i' in ALLOCATE directive not found in corresponding ALLOCATE statement |
| 27 |
!$omp allocate(h, i) allocator(omp_default_mem_alloc) |
| 28 |
allocate(h(8)) |
| 29 |
|
| 30 |
!ERROR: Object 'j' in ALLOCATE directive not found in corresponding ALLOCATE statement |
| 31 |
!$omp allocate(j, k) allocator(omp_default_mem_alloc) |
| 32 |
!$omp allocate(l) allocator(omp_default_mem_alloc) |
| 33 |
allocate(k(9), l(10)) |
| 34 |
|
| 35 |
end subroutine allocate |