| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-fdump-tree-gimple" } |
| 3 |
|
| 4 |
program main |
| 5 |
implicit none |
| 6 |
integer, parameter :: N = 1000 |
| 7 |
integer :: a(N), b(N), c(N), i |
| 8 |
|
| 9 |
! Should generate implicit 'map(present, alloc)' clauses. |
| 10 |
!$omp target defaultmap (present: aggregate) |
| 11 |
do i = 1, N |
| 12 |
c(i) = a(i) + b(i) |
| 13 |
end do |
| 14 |
!$omp end target |
| 15 |
|
| 16 |
! Should generate implicit 'map(present, alloc)' clauses, |
| 17 |
! and they should go before other non-present clauses. |
| 18 |
!$omp target map(from: c) defaultmap (present: aggregate) |
| 19 |
do i = 1, N |
| 20 |
c(i) = a(i) + b(i) |
| 21 |
end do |
| 22 |
!$omp end target |
| 23 |
end program |
| 24 |
|
| 25 |
! { dg-final { scan-tree-dump "pragma omp target.*defaultmap\\(present:aggregate\\).*map\\(force_present:c \\\[len: \[0-9\]+\\\] \\\[runtime_implicit\\\]\\) map\\(force_present:b \\\[len: \[0-9\]+\\\] \\\[runtime_implicit\\\]\\) map\\(force_present:a \\\[len: \[0-9\]+\\\] \\\[runtime_implicit\\\]\\)" "gimple" } } |
| 26 |
! { dg-final { scan-tree-dump "pragma omp target.*map\\(force_present:b \\\[len: \[0-9\]+\\\] \\\[runtime_implicit\\\]\\) map\\(force_present:a \\\[len: \[0-9\]+\\\] \\\[runtime_implicit\\\]\\) map\\(from:c \\\[len: \[0-9\]+\\\]\\) defaultmap\\(present:aggregate\\)" "gimple" } } |