| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-fdump-tree-gimple" } |
| 3 |
|
| 4 |
module test |
| 5 |
integer, parameter :: N = 100 |
| 6 |
contains |
| 7 |
subroutine f (x, y, z) |
| 8 |
integer :: x(N), y(N), z(N) |
| 9 |
|
| 10 |
!$omp target map (to: v1, v2) map(from: v3) |
| 11 |
!$omp metadirective & |
| 12 |
!$omp& when(device={arch("nvptx")}: teams loop) & |
| 13 |
!$omp& default(parallel loop) |
| 14 |
do i = 1, N |
| 15 |
z(i) = x(i) * y(i) |
| 16 |
enddo |
| 17 |
!$omp end target |
| 18 |
end subroutine |
| 19 |
end module |
| 20 |
|
| 21 |
! If offload device "nvptx" isn't supported, the front end can eliminate |
| 22 |
! that alternative and not produce a metadirective at all. Otherwise this |
| 23 |
! won't be resolved until late. |
| 24 |
! { dg-final { scan-tree-dump-not "#pragma omp metadirective" "gimple" { target { ! offload_nvptx } } } } |
| 25 |
|
| 26 |
! The following two are xfail because the bogus error triggers and thus prevents the dump, cf. PR118694 |
| 27 |
! { dg-final { scan-tree-dump "#pragma omp metadirective" "gimple" { target { offload_nvptx } xfail { offload_nvptx } } } } |
| 28 |
! { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } 10 } |