Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/implied-copy-1.f90

raw
1 ! { dg-additional-options "-fdump-tree-gimple" }
2
3 ! Test for implied copy of reduction variable on combined construct.
4
5 subroutine test
6 implicit none
7 integer a(100), i, s, p
8 p = 1
9
10 !$acc parallel loop reduction(+:s) reduction(*:p)
11 do i = 1, 100
12 s = s + a(i)
13 p = p * a(i)
14 end do
15 !$acc end parallel loop
16
17 !$acc serial loop reduction(+:s) reduction(*:p)
18 do i = 1, 100
19 s = s + a(i)
20 p = p * a(i)
21 end do
22 !$acc end serial loop
23
24 !$acc kernels loop reduction(+:s) reduction(*:p)
25 do i = 1, 100
26 s = s + a(i)
27 p = p * a(i)
28 end do
29 !$acc end kernels loop
30 end subroutine test
31
32 ! { dg-final { scan-tree-dump-times "map\\(force_tofrom:s \\\[len: \[0-9\]+\\\]\\)" 1 "gimple" } }
33 ! { dg-final { scan-tree-dump-times "map\\(force_tofrom:p \\\[len: \[0-9\]+\\\]\\)" 1 "gimple" } }
34 ! { dg-final { scan-tree-dump-times "map\\(tofrom:s \\\[len: \[0-9\]+\\\]\\)" 2 "gimple" } }
35 ! { dg-final { scan-tree-dump-times "map\\(tofrom:p \\\[len: \[0-9\]+\\\]\\)" 2 "gimple" } }