aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/goacc/enter-exit-data.f95
blob: 8f1715e659d586d5518d6dcc66004bb4314fb82a (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
! { dg-do compile } 
! { dg-additional-options "-fmax-errors=100" } 

module test 
  implicit none
contains

  subroutine foo (vi)
  logical :: l
  integer, value :: vi
  integer :: i, ia(10), a(10), b(2:8)
  complex :: c, ca(10)
  real, target:: r
  real :: ra(10)
  real, pointer :: rp
  real, dimension(:), allocatable :: aa
  type t
  integer :: i
  end type
  type(t) :: ti
  type(t), allocatable :: tia
  type(t), target :: tit
  type(t), pointer :: tip
  rp => r
  tip => tit

  ! enter data
  !$acc enter data
  !$acc enter data if (.false.)
  !$acc enter data if (l)
  !$acc enter data if (.false.) if (l) ! { dg-error "Unclassifiable" }
  !$acc enter data if (i) ! { dg-error "LOGICAL" }
  !$acc enter data if (1) ! { dg-error "LOGICAL" }
  !$acc enter data if (a) ! { dg-error "LOGICAL" }
  !$acc enter data if (b(5:6)) ! { dg-error "LOGICAL" }
  !$acc enter data async (l) ! { dg-error "INTEGER" }
  !$acc enter data async (.true.) ! { dg-error "INTEGER" }
  !$acc enter data async (1) 
  !$acc enter data async (i) 
  !$acc enter data async (a) ! { dg-error "INTEGER" }
  !$acc enter data async (b(5:6)) ! { dg-error "INTEGER" }
  !$acc enter data wait (l) ! { dg-error "INTEGER" }
  !$acc enter data wait (.true.) ! { dg-error "INTEGER" }
  !$acc enter data wait (i, 1) 
  !$acc enter data wait (a) ! { dg-error "INTEGER" }
  !$acc enter data wait (b(5:6)) ! { dg-error "INTEGER" }
  !$acc enter data copyin (tip) ! { dg-error "POINTER" }
  !$acc enter data copyin (tia) ! { dg-error "ALLOCATABLE" }
  !$acc enter data create (tip) ! { dg-error "POINTER" }
  !$acc enter data create (tia) ! { dg-error "ALLOCATABLE" }
  !$acc enter data present_or_copyin (tip) ! { dg-error "POINTER" }
  !$acc enter data present_or_copyin (tia) ! { dg-error "ALLOCATABLE" }
  !$acc enter data present_or_create (tip) ! { dg-error "POINTER" }
  !$acc enter data present_or_create (tia) ! { dg-error "ALLOCATABLE" }
  !$acc enter data copyin (i) create (i) ! { dg-error "multiple clauses" }
  !$acc enter data copyin (i) present_or_copyin (i) ! { dg-error "multiple clauses" }
  !$acc enter data create (i) present_or_copyin (i) ! { dg-error "multiple clauses" }
  !$acc enter data copyin (i) present_or_create (i) ! { dg-error "multiple clauses" }
  !$acc enter data create (i) present_or_create (i) ! { dg-error "multiple clauses" }
  !$acc enter data present_or_copyin (i) present_or_create (i) ! { dg-error "multiple clauses" }

  ! exit data
  !$acc exit data
  !$acc exit data if (.false.)
  !$acc exit data if (l)
  !$acc exit data if (.false.) if (l) ! { dg-error "Unclassifiable" }
  !$acc exit data if (i) ! { dg-error "LOGICAL" }
  !$acc exit data if (1) ! { dg-error "LOGICAL" }
  !$acc exit data if (a) ! { dg-error "LOGICAL" }
  !$acc exit data if (b(5:6)) ! { dg-error "LOGICAL" }
  !$acc exit data async (l) ! { dg-error "INTEGER" }
  !$acc exit data async (.true.) ! { dg-error "INTEGER" }
  !$acc exit data async (1) 
  !$acc exit data async (i) 
  !$acc exit data async (a) ! { dg-error "INTEGER" }
  !$acc exit data async (b(5:6)) ! { dg-error "INTEGER" }
  !$acc exit data wait (l) ! { dg-error "INTEGER" }
  !$acc exit data wait (.true.) ! { dg-error "INTEGER" }
  !$acc exit data wait (i, 1) 
  !$acc exit data wait (a) ! { dg-error "INTEGER" }
  !$acc exit data wait (b(5:6)) ! { dg-error "INTEGER" }
  !$acc exit data copyout (tip) ! { dg-error "POINTER" }
  !$acc exit data copyout (tia) ! { dg-error "ALLOCATABLE" }
  !$acc exit data delete (tip) ! { dg-error "POINTER" }
  !$acc exit data delete (tia) ! { dg-error "ALLOCATABLE" }
  !$acc exit data copyout (i) delete (i) ! { dg-error "multiple clauses" }
  end subroutine foo
end module test