1! { dg-do compile }
2! { dg-additional-options "-fdump-tree-gimple" }
3
4subroutine foo ()
5  implicit none
6  integer :: p,k
7  integer  :: a
8  !$acc parallel loop reduction(+:a)
9  do p = 1,5
10  enddo
11  !$acc end parallel loop
12  !$acc kernels loop reduction(+:a)
13  do k = 2,6
14  enddo
15  !$acc end kernels loop
16end subroutine
17
18! { dg-final { scan-tree-dump-times "target oacc_parallel reduction..:a. map.tofrom.a." 1 "gimple" } }
19! { dg-final { scan-tree-dump-times "acc loop private.p. reduction..:a." 1 "gimple" } }
20! { dg-final { scan-tree-dump-times "target oacc_kernels map.force_tofrom:a .len: 4.." 1 "gimple" } }
21! { dg-final { scan-tree-dump-times "acc loop private.k. reduction..:a." 1 "gimple" } }
22
23