| 1 |
! Test to ensure that IS_DEVICE_PTR is removed for non-used variables. |
| 2 |
|
| 3 |
! { dg-do compile } |
| 4 |
! { dg-additional-options "-fdump-tree-gimple" } |
| 5 |
|
| 6 |
program main |
| 7 |
use iso_c_binding |
| 8 |
implicit none |
| 9 |
|
| 10 |
integer :: x, y |
| 11 |
call foo (x, y) |
| 12 |
|
| 13 |
contains |
| 14 |
subroutine foo (a, b) |
| 15 |
integer, target :: a, b |
| 16 |
|
| 17 |
!$omp target data map(a, b) use_device_ptr(a, b) |
| 18 |
!$omp target is_device_ptr(a, b) |
| 19 |
a = 42 |
| 20 |
!$omp end target |
| 21 |
!$omp end target data |
| 22 |
end subroutine foo |
| 23 |
|
| 24 |
end program main |
| 25 |
|
| 26 |
! { dg-final { scan-tree-dump "has_device_addr\\(a\\)" "gimple" } } |
| 27 |
! { dg-final { scan-tree-dump-not "has_device_addr\\(b\\)" "gimple" } } |
| 28 |
! { dg-final { scan-tree-dump-not "is_device_ptr\\(b\\)" "gimple" } } |