| 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 (a, run_parallel, run_guided) |
| 8 |
integer :: a(N) |
| 9 |
logical :: run_parallel, run_guided |
| 10 |
integer :: i |
| 11 |
|
| 12 |
!$omp begin metadirective when(user={condition(run_parallel)}: parallel) |
| 13 |
!$omp metadirective & |
| 14 |
!$omp& when(construct={parallel}, user={condition(run_guided)}: & |
| 15 |
!$omp& do schedule(guided)) & |
| 16 |
!$omp& when(construct={parallel}: do schedule(static)) |
| 17 |
do i = 1, N |
| 18 |
a(i) = i |
| 19 |
end do |
| 20 |
!$omp end metadirective |
| 21 |
end subroutine |
| 22 |
end module |
| 23 |
|
| 24 |
! { dg-final { scan-tree-dump-not "#pragma omp metadirective" "gimple" } } |
| 25 |
! { dg-final { scan-tree-dump-times "#pragma omp parallel" 1 "gimple" } } |
| 26 |
! { dg-final { scan-tree-dump-times "#pragma omp for" 2 "gimple" } } |