brintos

brintos / llvm-project-archived public Read only

0
0
Text · 919 B · 5fe4efd Raw
28 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=524! OpenMP Version 5.05! 2.11.3 allocate Directive6! The allocate directive must appear in the same scope as the declarations of7! each of its list items and must follow all such declarations.8 9subroutine allocate()10use omp_lib11  integer, allocatable :: x(:)12  integer :: y13  contains14    subroutine sema()15    integer :: a, b16    real, dimension (:,:), allocatable :: darray17 18    !ERROR: A list item on a declarative ALLOCATE must be declared in the same scope in which the directive appears19    !$omp allocate(y)20    print *, a21 22    !WARNING: The executable form of the OpenMP ALLOCATE directive has been deprecated, please use ALLOCATORS instead [-Wopen-mp-usage]23    !$omp allocate(x) allocator(omp_default_mem_alloc)24      allocate ( x(a), darray(a, b) )25    end subroutine sema26 27end subroutine allocate28