aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Semantics/OpenMP/allocators01.f90
blob: a3342063e25f2bb4eb83252f9bf6faa91010b2f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! REQUIRES: openmp_runtime

! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
! OpenMP Version 5.2
! 6.7 allocators construct
! A list item that appears in an allocate clause must appear as
! one of the variables that is allocated by the allocate-stmt in
! the associated allocator structured block.

subroutine allocate()
use omp_lib

  integer, allocatable :: arr1(:), arr2(:, :), arr3(:), arr4(:, :)

  !$omp allocators allocate(arr3)
    allocate(arr3(3), arr4(4, 4))
  !$omp end allocators

  !ERROR: A list item in an ALLOCATORS construct must be specified on the associated ALLOCATE statement
  !$omp allocators allocate(omp_default_mem_alloc: arr1, arr2)
    allocate(arr2(2, 2))

end subroutine allocate