aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/goacc/deep-copy-2.f90
blob: 1e556b16b47a7ca6ce547d1e2aeb1644aaf4e799 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
! { dg-do compile }

! Test of attach/detach with "acc data", two clauses at once.

program dtype
  implicit none
  integer, parameter :: n = 512
  type mytype
    integer, allocatable :: a(:)
  end type mytype
  integer i

  type(mytype) :: var

  allocate(var%a(1:n))

!$acc data copy(var) copy(var%a) ! { dg-error "Symbol .var. has mixed component and non-component accesses" }

!$acc data copy(var%a) copy(var) ! { dg-error "Symbol .var. has mixed component and non-component accesses" }

!$acc parallel loop
  do i = 1,n
    var%a(i) = i
  end do
!$acc end parallel loop

!$acc end data

!$acc end data

  do i = 1,n
    if (i .ne. var%a(i)) stop 1
  end do

  deallocate(var%a)

end program dtype