blob: 497b824b4fc72e400b5afb6b630ea69a03849568 (
plain)
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
30
31
32
33
34
35
36
37
38
|
! Offloading test checking interaction of allocatables with enter, exit and
! target
! REQUIRES: flang, amdgpu
! RUN: %libomptarget-compile-fortran-run-and-check-generic
program main
integer, allocatable :: A(:)
allocate(A(10))
!$omp target enter data map(alloc: A)
!$omp target
do I = 1, 10
A(I) = I
end do
!$omp end target
!$omp target exit data map(from: A)
!$omp target exit data map(delete: A)
do i = 1, 10
print *, A(i)
end do
deallocate(A)
end program
! CHECK: 1
! CHECK: 2
! CHECK: 3
! CHECK: 4
! CHECK: 5
! CHECK: 6
! CHECK: 7
! CHECK: 8
! CHECK: 9
! CHECK: 10
|