| 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 be able to parse 'present' map modifier. |
| 10 |
!$omp target enter data map (present, to: a, b) |
| 11 |
|
| 12 |
!$omp target data map (present, to: a, b) map (always, present, from: c) |
| 13 |
!$omp target map (present, to: a, b) map (present, from: c) |
| 14 |
do i = 1, N |
| 15 |
c(i) = a(i) + b(i) |
| 16 |
end do |
| 17 |
!$omp end target |
| 18 |
!$omp end target data |
| 19 |
|
| 20 |
!$omp target exit data map (always, present, from: c) |
| 21 |
|
| 22 |
! Map clauses with 'present' modifier should go ahead of those without. |
| 23 |
!$omp target map (to: a) map (present, to: b) map (from: c) |
| 24 |
do i = 1, N |
| 25 |
c(i) = a(i) + b(i) |
| 26 |
end do |
| 27 |
!$omp end target |
| 28 |
end program |
| 29 |
|
| 30 |
! { dg-final { scan-tree-dump "pragma omp target enter data map\\(force_present:a \\\[len: \[0-9\]+\\\]\\) map\\(force_present:b \\\[len: \[0-9\]+\\\]\\)" "gimple" } } |
| 31 |
! { dg-final { scan-tree-dump "pragma omp target data map\\(force_present:a \\\[len: \[0-9\]+\\\]\\) map\\(force_present:b \\\[len: \[0-9\]+\\\]\\) map\\(always,present,from:c \\\[len: \[0-9\]+\\\]\\)" "gimple" } } |
| 32 |
! { dg-final { scan-tree-dump "pragma omp target.*map\\(force_present:a \\\[len: \[0-9\]+\\\]\\) map\\(force_present:b \\\[len: \[0-9\]+\\\]\\) map\\(force_present:c \\\[len: \[0-9\]+\\\]\\)" "gimple" } } |
| 33 |
! { dg-final { scan-tree-dump "pragma omp target exit data map\\(always,present,from:c \\\[len: \[0-9\]+\\\]\\)" "gimple" } } |
| 34 |
! { dg-final { scan-tree-dump "pragma omp target.*map\\(force_present:b \\\[len: \[0-9\]+\\\]\\) map\\(to:a \\\[len: \[0-9\]+\\\]\\) map\\(from:c \\\[len: \[0-9\]+\\\]\\)" "gimple" } } |