Debian Codegraph @

libgomp/testsuite/libgomp.oacc-fortran/reference-reductions.f90

raw
1 ! Test reductions on dummy arguments inside modules.
2
3 ! { dg-do run }
4
5 ! { dg-additional-options -Wuninitialized }
6
7 module prm
8 implicit none
9
10 contains
11
12 subroutine param_reduction(var)
13 implicit none
14 integer(kind=8) :: var
15 integer :: j,k
16
17 !$acc parallel copy(var)
18 !$acc loop reduction(+ : var) gang
19 ! { dg-bogus {'var\.[0-9]+' is used uninitialized} TODO { xfail *-*-* } .-1 }
20 ! { dg-note {'var\.[0-9]+' was declared here} {} { target *-*-* } .-2 }
21 do k=1,10
22 !$acc loop vector reduction(+ : var)
23 ! { dg-bogus {'var\.[0-9]+' may be used uninitialized} TODO { xfail { ! __OPTIMIZE__ } } .-1 }
24 ! { dg-note {'var\.[0-9]+' was declared here} {} { target { ! __OPTIMIZE__ } } .-2 }
25 do j=1,100
26 var = var + 1.0
27 enddo
28 enddo
29 !$acc end parallel
30 end subroutine param_reduction
31
32 end module prm
33
34 program test
35 use prm
36 implicit none
37
38 integer(8) :: r
39
40 r=10.0
41 call param_reduction (r)
42
43 if (r .ne. 1010) stop 1
44 end program test