1! Offloading test checking interaction of two derived type's with a mix of
2! explicit and implicit member mapping of arrays to target one with bounds.
3! REQUIRES: flang, amdgpu
4
5! RUN: %libomptarget-compile-fortran-run-and-check-generic
6program main
7    type :: scalar_array
8        real(4) :: break_0
9        real(4) :: array_x(10)
10        real(4) :: break_1
11        real(4) :: array_y(10)
12        real(4) :: break_3
13    end type scalar_array
14
15    type(scalar_array) :: scalar_arr1
16    type(scalar_array) :: scalar_arr2
17
18  do i = 1, 10
19    scalar_arr1%array_x(i) = i
20  end do
21
22  !$omp target map(tofrom:scalar_arr2%array_x(3:6))
23    do i = 3, 6
24      scalar_arr2%array_x(i) = scalar_arr1%array_x(i)
25    end do
26  !$omp end target
27
28  print*, scalar_arr1%array_x
29  print*, scalar_arr2%array_x
30end program main
31
32!CHECK: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
33!CHECK: 0. 0. 3. 4. 5. 6. 0. 0. 0. 0.
34