[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-allocate05.f90
blob89cf83dbe521fdcd93d0e2293fda1fb812a4fc35
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.0
3 ! 2.11.3 allocate Directive
4 ! allocate directives that appear in a target region must specify an allocator
5 ! clause unless a requires directive with the dynamic_allocators clause is present
6 ! in the same compilation unit.
8 subroutine allocate()
9 use omp_lib
10 integer :: a, b
11 real, dimension (:,:), allocatable :: darray
13 !$omp target
14 !$omp allocate allocator(omp_default_mem_alloc)
15 allocate ( darray(a, b) )
16 !$omp end target
18 !$omp target
19 !ERROR: ALLOCATE directives that appear in a TARGET region must specify an allocator clause
20 !$omp allocate
21 allocate ( darray(a, b) )
22 !$omp end target
24 end subroutine allocate