Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion test/smoke-fort-dev/flang-325095-2/use_dev_addr_fort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ program omp_subroutine
allocate(c(N))
c = -42.0

call test0(c)
if (c(3) .ne. 1.0) then
write (*,*) "FAIL : test0:", c
stop 2
endif

print *, c
c(3) = -42.0

! Expected output c(3) = 1
call test1(c)
if (c(3) .ne. 1.0) then
Expand Down Expand Up @@ -46,6 +55,13 @@ program omp_subroutine
print *, "PASS"
return
contains
subroutine test0(c)
double precision, intent(inout) :: c(:)
!$omp target data use_device_ptr(c) map(tofrom: c)
c(3) = 1.0
!$omp end target data
end subroutine

subroutine test1(c)
double precision, intent(inout) :: c(:)
!$omp target enter data map(to:c)
Expand All @@ -69,7 +85,7 @@ subroutine test3()
!$omp target data use_device_ptr(c)
c(3) = 1.0
!$omp end target data
!$omp target update from(c)
!$omp target update from(c)
write (*,*) "test3:", c
end subroutine

Expand Down