Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/privatization-1-routine_gang.f90

raw
1 ! OpenACC privatization: 'routine'
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-routine_gang.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_routine 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 !$acc routine (f) gang ! { dg-line l_routine[incr c_routine] }
26 integer :: x, y
27 integer, parameter :: c = 3
28 integer, external :: g
29
30 ! Can't have nested scopes fun. (Fortran 'block' construct supported only starting with OpenACC 3.1.)
31
32 ! Don't know how to effect a 'LABEL_DECL' here.
33 ! Don't know how to effect a 'TYPE_DECL' here.
34 ! Don't know how to effect a 'FUNCTION_DECL' here.
35 ! Don't know how to effect a 'RESULT_DECL' here.
36 ! Don't know how to effect a 'VAR_DECL' here.
37 ! (See C/C++ example.)
38
39 a = g (i, j, a, c)
40 x = a
41 !$acc atomic write ! ... to force 'TREE_ADDRESSABLE'.
42 y = a
43 end subroutine f
44 ! { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_routine$c_routine }
45 ! { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_routine$c_routine }
46 ! { dg-note {variable 'a' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_routine$c_routine }
47 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { xfail *-*-* } l_routine$c_routine }
48 end module m