1! Offloading test checking interaction of two derived type's with a single
2! explicit array member each being mapped with bounds to target
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
19  !$omp target map(tofrom:scalar_arr1%array_x(3:6), scalar_arr2%array_x(3:6))
20    do i = 3, 6
21      scalar_arr2%array_x(i) = i
22      scalar_arr1%array_x(i) = i
23    end do
24  !$omp end target
25
26  print*, scalar_arr1%array_x
27  print*, scalar_arr2%array_x
28end program main
29
30!CHECK: 0. 0. 3. 4. 5. 6. 0. 0. 0. 0.
31!CHECK: 0. 0. 3. 4. 5. 6. 0. 0. 0. 0.
32