aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/goacc/reduction.f95
blob: a13574b150c715f7c7b7cebebb7835b055a66b60 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
! { dg-do compile } 
! { dg-additional-options "-fmax-errors=100" } 

subroutine foo (ia1)
integer :: i1, i2, i3
integer, dimension (*) :: ia1
integer, dimension (10) :: ia2
real :: r1
real, dimension (5) :: ra1
double precision :: d1
double precision, dimension (4) :: da1
complex :: c1
complex, dimension (7) :: ca1
logical :: l1
logical, dimension (3) :: la1
character (5) :: a1
type t
  integer :: i
end type
type(t) :: t1
type(t), dimension (2) :: ta1
real, pointer :: p1 => NULL()
integer, allocatable :: aa1 (:,:)
save i2
common /blk/ i1

!$acc parallel reduction (+:ia2)
!$acc end parallel
!$acc parallel reduction (+:ra1)
!$acc end parallel
!$acc parallel reduction (+:ca1)
!$acc end parallel
!$acc parallel reduction (+:da1)
!$acc end parallel
!$acc parallel reduction (.and.:la1)
!$acc end parallel
!$acc parallel reduction (+:i3, r1, d1, c1)
!$acc end parallel
!$acc parallel reduction (*:i3, r1, d1, c1)
!$acc end parallel
!$acc parallel reduction (-:i3, r1, d1, c1)
!$acc end parallel
!$acc parallel reduction (.and.:l1)
!$acc end parallel
!$acc parallel reduction (.or.:l1)
!$acc end parallel
!$acc parallel reduction (.eqv.:l1)
!$acc end parallel
!$acc parallel reduction (.neqv.:l1)
!$acc end parallel
!$acc parallel reduction (min:i3, r1, d1)
!$acc end parallel
!$acc parallel reduction (max:i3, r1, d1)
!$acc end parallel
!$acc parallel reduction (iand:i3)
!$acc end parallel
!$acc parallel reduction (ior:i3)
!$acc end parallel
!$acc parallel reduction (ieor:i3)
!$acc end parallel
!$acc parallel reduction (+:/blk/)	! { dg-error "Syntax error" }
!$acc end parallel			! { dg-error "Unexpected" }
!$acc parallel reduction (*:p1)		! { dg-error "POINTER object" }
!$acc end parallel
!$acc parallel reduction (-:aa1)
!$acc end parallel
!$acc parallel reduction (*:ia1)	! { dg-error "Assumed size" }
!$acc end parallel
!$acc parallel reduction (+:l1)		! { dg-error "OMP DECLARE REDUCTION \\+ not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (*:la1)	! { dg-error "OMP DECLARE REDUCTION \\* not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (-:a1)		! { dg-error "OMP DECLARE REDUCTION - not found for type CHARACTER" }
!$acc end parallel
!$acc parallel reduction (+:t1)		! { dg-error "OMP DECLARE REDUCTION \\+ not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (*:ta1)	! { dg-error "OMP DECLARE REDUCTION \\* not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (.and.:i3)	! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type INTEGER" }
!$acc end parallel
!$acc parallel reduction (.or.:ia2)	! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type INTEGER" }
!$acc end parallel
!$acc parallel reduction (.eqv.:r1)	! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (.neqv.:ra1)	! { dg-error "OMP DECLARE REDUCTION \\.neqv\\. not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (.and.:d1)	! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (.or.:da1)	! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (.eqv.:c1)	! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (.neqv.:ca1)	! { dg-error "OMP DECLARE REDUCTION \\.neqv\\. not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (.and.:a1)	! { dg-error "OMP DECLARE REDUCTION \\.and\\. not found for type CHARACTER" }
!$acc end parallel
!$acc parallel reduction (.or.:t1)	! { dg-error "OMP DECLARE REDUCTION \\.or\\. not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (.eqv.:ta1)	! { dg-error "OMP DECLARE REDUCTION \\.eqv\\. not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (min:c1)	! { dg-error "OMP DECLARE REDUCTION min not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (max:ca1)	! { dg-error "OMP DECLARE REDUCTION max not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (max:l1)	! { dg-error "OMP DECLARE REDUCTION max not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (min:la1)	! { dg-error "OMP DECLARE REDUCTION min not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (max:a1)	! { dg-error "OMP DECLARE REDUCTION max not found for type CHARACTER" }
!$acc end parallel
!$acc parallel reduction (min:t1)	! { dg-error "OMP DECLARE REDUCTION min not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (max:ta1)	! { dg-error "OMP DECLARE REDUCTION max not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (iand:r1)	! { dg-error "OMP DECLARE REDUCTION iand not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (ior:ra1)	! { dg-error "OMP DECLARE REDUCTION ior not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (ieor:d1)	! { dg-error "OMP DECLARE REDUCTION ieor not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (ior:da1)	! { dg-error "OMP DECLARE REDUCTION ior not found for type REAL" }
!$acc end parallel
!$acc parallel reduction (iand:c1)	! { dg-error "OMP DECLARE REDUCTION iand not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (ior:ca1)	! { dg-error "OMP DECLARE REDUCTION ior not found for type COMPLEX" }
!$acc end parallel
!$acc parallel reduction (ieor:l1)	! { dg-error "OMP DECLARE REDUCTION ieor not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (iand:la1)	! { dg-error "OMP DECLARE REDUCTION iand not found for type LOGICAL" }
!$acc end parallel
!$acc parallel reduction (ior:a1)	! { dg-error "OMP DECLARE REDUCTION ior not found for type CHARACTER" }
!$acc end parallel
!$acc parallel reduction (ieor:t1)	! { dg-error "OMP DECLARE REDUCTION ieor not found for type TYPE" }
!$acc end parallel
!$acc parallel reduction (iand:ta1)	! { dg-error "OMP DECLARE REDUCTION iand not found for type TYPE" }
!$acc end parallel

end subroutine

! { dg-error "Array 'ia2' is not permitted in reduction" "" { target "*-*-*" } 27 }
! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } 29 }
! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } 31 }
! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } 33 }
! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } 35 }
! { dg-error "Array 'aa1' is not permitted in reduction" "" { target "*-*-*" } 65 }
! { dg-error "Array 'ia1' is not permitted in reduction" "" { target "*-*-*" } 67 }
! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } 71 }
! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } 77 }
! { dg-error "Array 'ia2' is not permitted in reduction" "" { target "*-*-*" } 81 }
! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } 85 }
! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } 89 }
! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } 93 }
! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } 99 }
! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } 103 }
! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } 107 }
! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } 113 }
! { dg-error "Array 'ra1' is not permitted in reduction" "" { target "*-*-*" } 117 }
! { dg-error "Array 'da1' is not permitted in reduction" "" { target "*-*-*" } 121 }
! { dg-error "Array 'ca1' is not permitted in reduction" "" { target "*-*-*" } 125 }
! { dg-error "Array 'la1' is not permitted in reduction" "" { target "*-*-*" } 129 }
! { dg-error "Array 'ta1' is not permitted in reduction" "" { target "*-*-*" } 135 }