Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/mapping-tests-2.f90

raw
1 subroutine foo
2 type t
3 integer :: i, j
4 end type t
5
6 type t2
7 type(t) :: cc(3)
8 end type t2
9
10 type(t) x, y(3)
11 type(t2) :: z(3)
12
13 ! OK - map whole aggregated variable
14 !$acc enter data copyin(x)
15 ! map(to:x [len: 8])
16
17 ! OK - map two components of the aggregated variable
18 !$acc enter data copyin(x%j, x%i)
19
20 ! Bad - we cannot mix full-object and component accesses
21 !$acc enter data copyin(x, x%i)
22 ! { dg-error "Symbol .x. has mixed component and non-component accesses" "" { target "*-*-*" } 21 }
23
24 ! Bad - we cannot do a strided access of 'x'
25 ! No C/C++ equivalent
26 !$acc enter data copyin(y(:)%i)
27 ! { dg-error "not a proper array section" "" { target "*-*-*" } 26 }
28
29 ! Bad - again, a strided access
30 !$acc enter data copyin(z(1)%cc(:)%i)
31 ! { dg-error "not a proper array section" "" { target "*-*-*" } 30 }
32 end