forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallocate04.f90
29 lines (25 loc) · 1003 Bytes
/
allocate04.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! REQUIRES: openmp_runtime
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
! OpenMP Version 5.0
! 2.11.3 allocate Directive
! Only the allocator clause is allowed on the allocate directive
! List item in ALLOCATE directive must not be a dummy argument
! List item in ALLOCATE directive must not have POINTER attribute
! List item in ALLOCATE directive must not be a associate name
subroutine allocate(z)
use omp_lib
use iso_c_binding
type(c_ptr), pointer :: p
integer :: x, y, z
associate (a => x)
!$omp allocate(x) allocator(omp_default_mem_alloc)
!ERROR: PRIVATE clause is not allowed on the ALLOCATE directive
!$omp allocate(y) private(y)
!ERROR: List item 'z' in ALLOCATE directive must not be a dummy argument
!$omp allocate(z)
!ERROR: List item 'p' in ALLOCATE directive must not have POINTER attribute
!$omp allocate(p)
!ERROR: List item 'a' in ALLOCATE directive must not be an associate name
!$omp allocate(a)
end associate
end subroutine allocate