summaryrefslogtreecommitdiff
path: root/offload/test/offloading/fortran/dtype-char-array-map.f90
blob: 6b72c9e9510164d0218a04340d963185f87852a5 (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
! Offloading test that verifies certain type of character string arrays
! (in this case allocatable) map to and from device without problem.
! REQUIRES: flang, amdgpu

! RUN: %libomptarget-compile-fortran-run-and-check-generic
program main
  implicit none
  type char_t
    CHARACTER(LEN=16), dimension(:,:), allocatable :: char_arr
  end type char_t
  type(char_t) :: dtype_char

  allocate(dtype_char%char_arr(10,10))

!$omp target enter data map(alloc:dtype_char%char_arr)

!$omp target
    dtype_char%char_arr(2,2) = 'c'
!$omp end target

!$omp target update from(dtype_char%char_arr)


 print *, dtype_char%char_arr(2,2)
end program

!CHECK: c