Debian Codegraph @

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

raw
1 ! OpenACC privatization: compute 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.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_function 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) ! { dg-line l_function[incr c_function] }
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 private(i, j, a) private(x, y) ! { dg-line l_compute[incr c_compute] }
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 ! { dg-warning {'i' is used uninitialized} {} { target *-*-* } .-1 }
41 ! { dg-note {'i' was declared here} {} { target *-*-* } l_function$c_function }
42 ! { dg-warning {'j' is used uninitialized} {} { target *-*-* } .-3 }
43 ! { dg-note {'j' was declared here} {} { target *-*-* } l_function$c_function }
44 ! { dg-warning {'a' is used uninitialized} {} { target *-*-* } .-5 }
45 ! { dg-note {'a' was declared here} {} { target *-*-* } l_function$c_function }
46 x = a
47 !$acc atomic write ! ... to force 'TREE_ADDRESSABLE'.
48 y = a
49 !$acc end parallel
50 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_compute$c_compute }
51 ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_compute$c_compute }
52 ! { dg-note {variable 'a' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_compute$c_compute }
53 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute }
54 end subroutine f
55 end module m