[flang] Update CommandTest for AIX (NFC) (#118403)
[llvm-project.git] / flang / test / Semantics / OpenMP / allocate01.f90
blob6ccb8bb09e8305a459b7a8f0e5e9e25295de8417
1 ! REQUIRES: openmp_runtime
3 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
4 ! OpenMP Version 5.0
5 ! 2.11.3 allocate Directive
6 ! The allocate directive must appear in the same scope as the declarations of
7 ! each of its list items and must follow all such declarations.
9 subroutine allocate()
10 use omp_lib
11 integer, allocatable :: x(:)
12 integer :: y
13 contains
14 subroutine sema()
15 integer :: a, b
16 real, dimension (:,:), allocatable :: darray
18 !ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
19 !$omp allocate(y)
20 print *, a
22 !ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
23 !$omp allocate(x) allocator(omp_default_mem_alloc)
24 allocate ( x(a), darray(a, b) )
25 end subroutine sema
27 end subroutine allocate