Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / fortran / basic-target-region-3D-array-section.f90
blobca0364543c20f8aaf31463c8a2be357e32e20af4
1 ! Basic offloading test of a regular array explicitly
2 ! passed within a target region
3 ! REQUIRES: flang, amdgpu
5 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
6 program main
7 implicit none
8 integer :: inArray(3,3,3)
9 integer :: outArray(3,3,3)
10 integer :: i, j, k
11 integer :: j2 = 3, k2 = 3
13 do i = 1, 3
14 do j = 1, 3
15 do k = 1, 3
16 inArray(i, j, k) = 42
17 outArray(i, j, k) = 0
18 end do
19 end do
20 end do
22 j = 1
23 k = 1
24 !$omp target map(tofrom:inArray(1:3, 1:3, 2:2), outArray(1:3, 1:3, 1:3), j, k, j2, k2)
25 do while (j <= j2)
26 k = 1
27 do while (k <= k2)
28 outArray(k, j, 2) = inArray(k, j, 2)
29 k = k + 1
30 end do
31 j = j + 1
32 end do
33 !$omp end target
35 print *, outArray
37 end program
39 ! CHECK: 0 0 0 0 0 0 0 0 0 42 42 42 42 42 42 42 42 42 0 0 0 0 0 0 0 0 0