Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/privatization-1-compute-loop.f90

raw
1 ! OpenACC privatization: 'loop' construct
2
3 ! { dg-additional-options "-fopt-info-omp-note" }
4 ! { dg-additional-options "--param=openacc-privatization=noisy" } for
5 ! testing/documenting aspects of that functionality.
6
7 ! { dg-additional-options -Wuninitialized }
8
9 ! See also '../../c-c++-common/goacc/privatization-1-compute-loop.c'.
10 !TODO More cases should be added here.
11
12 ! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
13 ! passed to 'incr' may be unset, and in that case, it will be set to [...]",
14 ! so to maintain compatibility with earlier Tcl releases, we manually
15 ! initialize counter variables:
16 ! { dg-line l_dummy[variable c_compute 0 c_loop 0] }
17 ! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
18 ! "WARNING: dg-line var l_dummy defined, but not used".
19
20 module m
21 contains
22 subroutine f (i, j, a)
23 implicit none
24 integer :: i, j, a
25 integer :: x, y
26 integer, parameter :: c = 3
27 integer, external :: g
28
29 !$acc parallel ! { dg-line l_compute[incr c_compute] }
30 !$acc loop collapse(2) private(a) private(x, y) ! { dg-line l_loop[incr c_loop] }
31 do i = 1, 20
32 do j = 1, 25
33 ! Can't have nested scopes fun. (Fortran 'block' construct supported only starting with OpenACC 3.1.)
34
35 ! Don't know how to effect a 'LABEL_DECL' here.
36 ! Don't know how to effect a 'TYPE_DECL' here.
37 ! Don't know how to effect a 'FUNCTION_DECL' here.
38 ! Don't know how to effect a 'RESULT_DECL' here.
39 ! Don't know how to effect a 'VAR_DECL' here.
40 ! (See C/C++ example.)
41
42 a = g (i, j, a, c)
43 ! { dg-warning {'a' is used uninitialized} TODO { xfail *-*-* } .-1 }
44 x = a
45 !$acc atomic write
46 y = a
47 end do
48 end do
49 !$acc end parallel
50 ! { dg-note {variable 'i\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute }
51 ! { dg-note {variable 'j\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute }
52 ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
53 ! { dg-note {variable 'j\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
54 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
55 ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
56 ! { dg-note {variable 'a' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
57 ! { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop }
58 ! { dg-note {variable 'y' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop }
59 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_loop$c_loop }
60 ! { dg-note {variable 'y' ought to be adjusted for OpenACC privatization level: 'vector'} "" { target *-*-* } l_loop$c_loop }
61 end subroutine f
62 end module m