You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,39 @@ void uses(unsigned Parm) {
112
112
// expected-note@+1{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
113
113
#pragma acc parallel reduction(+:CoCArr[1:1])
114
114
while (1);
115
+
116
+
int *IPtr;
117
+
// expected-error@+2{{invalid type 'int *' used in OpenACC 'reduction' variable reference; type is not a scalar value, or array of scalars, or composite of scalars}}
118
+
// expected-note@+1{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
119
+
#pragma acc parallel reduction(+:IPtr)
120
+
while (1);
121
+
#pragma acc parallel reduction(+:IPtr[1])
122
+
while (1);
123
+
#pragma acc parallel reduction(+:IPtr[1:1])
124
+
while (1);
125
+
126
+
int *IPtrArr[5];
127
+
// expected-error@+3{{invalid type 'int *' used in OpenACC 'reduction' variable reference; type is not a scalar value, or array of scalars, or composite of scalars}}
128
+
// expected-note@+2{{used as element type of array type 'int *'}}
129
+
// expected-note@+1{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
130
+
#pragma acc parallel reduction(+:IPtrArr)
131
+
while (1);
132
+
133
+
structHasPtr { int *I; }; // #HASPTR
134
+
HasPtr HP;
135
+
// expected-error@+3{{invalid type 'int *' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
136
+
// expected-note@#HASPTR{{used as field 'I' of composite 'HasPtr'}}
137
+
// expected-note@+1{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
138
+
#pragma acc parallel reduction(+:HP)
139
+
while (1);
140
+
141
+
HasPtr HPArr[5];
142
+
// expected-error@+4{{invalid type 'int *' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
143
+
// expected-note@+3{{used as element type of array type 'HasPtr'}}
144
+
// expected-note@#HASPTR{{used as field 'I' of composite 'HasPtr'}}
145
+
// expected-note@+1{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
0 commit comments