Skip to content

Commit 7427d81

Browse files
committed
[Flang][OpenMP][Offload] Add new runtime tests for issue cases
1 parent 73ddd7d commit 7427d81

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
! Offloading test that verifies certain type of character string arrays
2+
! map to and from device without problem.
3+
! REQUIRES: flang, amdgpu
4+
5+
! RUN: %libomptarget-compile-fortran-run-and-check-generic
6+
program main
7+
implicit none
8+
type char_t
9+
CHARACTER(LEN=16), dimension(10,10) :: char_arr
10+
end type char_t
11+
type(char_t) :: dtype_char
12+
13+
!$omp target enter data map(alloc:dtype_char%char_arr)
14+
15+
!$omp target
16+
dtype_char%char_arr(2,2) = 'c'
17+
!$omp end target
18+
19+
!$omp target update from(dtype_char%char_arr)
20+
21+
22+
print *, dtype_char%char_arr(2,2)
23+
end program
24+
25+
!CHECK: c
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
! Offloading test that verifies certain type of character string arrays
2+
! (in this case allocatable) map to and from device without problem.
3+
! REQUIRES: flang, amdgpu
4+
5+
! RUN: %libomptarget-compile-fortran-run-and-check-generic
6+
program main
7+
implicit none
8+
type char_t
9+
CHARACTER(LEN=16), dimension(:,:), allocatable :: char_arr
10+
end type char_t
11+
type(char_t) :: dtype_char
12+
13+
allocate(dtype_char%char_arr(10,10))
14+
15+
!$omp target enter data map(alloc:dtype_char%char_arr)
16+
17+
!$omp target
18+
dtype_char%char_arr(2,2) = 'c'
19+
!$omp end target
20+
21+
!$omp target update from(dtype_char%char_arr)
22+
23+
24+
print *, dtype_char%char_arr(2,2)
25+
end program
26+
27+
!CHECK: c

0 commit comments

Comments
 (0)