aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaOpenACC
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaOpenACC')
-rw-r--r--clang/test/SemaOpenACC/combined-construct-reduction-clause.cpp7
-rw-r--r--clang/test/SemaOpenACC/compute-construct-clause-ast.cpp27
-rw-r--r--clang/test/SemaOpenACC/compute-construct-reduction-clause.c17
-rw-r--r--clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp16
-rw-r--r--clang/test/SemaOpenACC/loop-construct-reduction-ast.cpp54
5 files changed, 35 insertions, 86 deletions
diff --git a/clang/test/SemaOpenACC/combined-construct-reduction-clause.cpp b/clang/test/SemaOpenACC/combined-construct-reduction-clause.cpp
index 72d7e6b..1b50336 100644
--- a/clang/test/SemaOpenACC/combined-construct-reduction-clause.cpp
+++ b/clang/test/SemaOpenACC/combined-construct-reduction-clause.cpp
@@ -2,7 +2,7 @@
struct CompositeOfScalars {
int I;
- float F;
+ float F; // #COS_FLOAT
short J;
char C;
double D;
@@ -30,6 +30,11 @@ void uses(unsigned Parm) {
for(int i = 0; i < 5; ++i);
#pragma acc serial loop reduction(&: CoS, I, F)
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-error@-2{{invalid operands to binary expression ('float' and 'float')}}
+ // expected-error@-3{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-5{{invalid operands to binary expression ('float' and 'float')}}
for(int i = 0; i < 5; ++i);
#pragma acc kernels loop reduction(min: CoS, Array[I], Array[0:I])
diff --git a/clang/test/SemaOpenACC/compute-construct-clause-ast.cpp b/clang/test/SemaOpenACC/compute-construct-clause-ast.cpp
index babff53..c4ff12d 100644
--- a/clang/test/SemaOpenACC/compute-construct-clause-ast.cpp
+++ b/clang/test/SemaOpenACC/compute-construct-clause-ast.cpp
@@ -86,15 +86,6 @@ void NormalFunc(int i, float f) {
// CHECK-NEXT: CXXBoolLiteralExpr
// CHECK-NEXT: NullStmt
-#pragma acc serial reduction(|: f)
- while(true);
- // CHECK-NEXT: OpenACCComputeConstruct{{.*}}serial
- // CHECK-NEXT: reduction clause Operator: |
- // CHECK-NEXT: DeclRefExpr{{.*}} 'float' lvalue ParmVar{{.*}} 'f' 'float'
- // CHECK-NEXT: WhileStmt
- // CHECK-NEXT: CXXBoolLiteralExpr
- // CHECK-NEXT: NullStmt
-
#pragma acc parallel reduction(^: i)
while(true);
@@ -283,16 +274,6 @@ void TemplFunc() {
// CHECK-NEXT: CXXBoolLiteralExpr
// CHECK-NEXT: NullStmt
-#pragma acc parallel reduction(&: T::SomeFloat)
- while(true);
- // CHECK-NEXT: OpenACCComputeConstruct{{.*}}parallel
- // CHECK-NEXT: reduction clause Operator: &
- // CHECK-NEXT: DependentScopeDeclRefExpr{{.*}} '<dependent type>' lvalue
- // CHECK-NEXT: NestedNameSpecifier TypeSpec 'T'
- // CHECK-NEXT: WhileStmt
- // CHECK-NEXT: CXXBoolLiteralExpr
- // CHECK-NEXT: NullStmt
-
#pragma acc serial reduction(|: i)
while(true);
// CHECK-NEXT: OpenACCComputeConstruct{{.*}}serial
@@ -475,14 +456,6 @@ void TemplFunc() {
// CHECK-NEXT: CXXBoolLiteralExpr
// CHECK-NEXT: NullStmt
- // CHECK-NEXT: OpenACCComputeConstruct{{.*}}parallel
- // CHECK-NEXT: reduction clause Operator: &
- // CHECK-NEXT: DeclRefExpr{{.*}} 'const float' lvalue Var{{.*}} 'SomeFloat' 'const float'
- // CHECK-NEXT: NestedNameSpecifier TypeSpec 'InstTy'
- // CHECK-NEXT: WhileStmt
- // CHECK-NEXT: CXXBoolLiteralExpr
- // CHECK-NEXT: NullStmt
-
// CHECK-NEXT: OpenACCComputeConstruct{{.*}}serial
// CHECK-NEXT: reduction clause Operator: |
// CHECK-NEXT: DeclRefExpr{{.*}} 'typename InstTy::IntTy':'int' lvalue Var{{.*}} 'i' 'typename InstTy::IntTy':'int'
diff --git a/clang/test/SemaOpenACC/compute-construct-reduction-clause.c b/clang/test/SemaOpenACC/compute-construct-reduction-clause.c
index 265c498..96c01d0 100644
--- a/clang/test/SemaOpenACC/compute-construct-reduction-clause.c
+++ b/clang/test/SemaOpenACC/compute-construct-reduction-clause.c
@@ -2,7 +2,7 @@
struct CompositeOfScalars {
int I;
- float F;
+ float F; // #COS_FLOAT
short J;
char C;
double D;
@@ -58,6 +58,11 @@ void uses(unsigned Parm) {
// Vars in a reduction must be a scalar or a composite of scalars.
#pragma acc parallel reduction(&: CoS, I, F)
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-error@-2{{invalid operands to binary expression ('float' and 'float')}}
+ // expected-error@-3{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-5{{invalid operands to binary expression ('float' and 'float')}}
while (1);
// expected-error@+3{{invalid type 'struct CompositeOfScalars' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
// expected-note@#COS_FIELD{{used as field 'COS' of composite 'CompositeHasComposite'}}
@@ -69,12 +74,18 @@ void uses(unsigned Parm) {
while (1);
#pragma acc parallel reduction(&: CoS, Array[I], Array[0:I])
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-3{{invalid operands to binary expression ('float' and 'float')}}
while (1);
struct CompositeHasComposite ChCArray[5];
- // expected-error@+3{{invalid type 'struct CompositeOfScalars' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
+ // expected-error@+6{{invalid type 'struct CompositeOfScalars' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
// expected-note@#COS_FIELD{{used as field 'COS' of composite 'CompositeHasComposite'}}
- // 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}}
+ // expected-note@+4{{OpenACC 'reduction' variable reference must be a scalar variable or a composite of scalars, or an array, sub-array, or element of scalar types}}
+ // expected-error@+3{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@+1{{invalid operands to binary expression ('float' and 'float')}}
#pragma acc parallel reduction(&: CoS, Array[I], ChCArray[0:I])
while (1);
diff --git a/clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp b/clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp
index edc67ce..e3a487a 100644
--- a/clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp
+++ b/clang/test/SemaOpenACC/compute-construct-reduction-clause.cpp
@@ -2,7 +2,7 @@
struct CompositeOfScalars {
int I;
- float F;
+ float F; // #COS_FLOAT
short J;
char C;
double D;
@@ -61,6 +61,11 @@ void uses(unsigned Parm) {
// Vars in a reduction must be a scalar or a composite of scalars.
#pragma acc parallel reduction(&: CoS, I, F)
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-error@-2{{invalid operands to binary expression ('float' and 'float')}}
+ // expected-error@-3{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-5{{invalid operands to binary expression ('float' and 'float')}}
while (1);
// expected-error@+3{{invalid type 'struct CompositeOfScalars' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
// expected-note@#COS_FIELD{{used as field 'COS' of composite 'CompositeHasComposite'}}
@@ -71,6 +76,9 @@ void uses(unsigned Parm) {
while (1);
#pragma acc parallel reduction(&: CoS, Array[I], Array[0:I])
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-3{{invalid operands to binary expression ('float' and 'float')}}
while (1);
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, or composite variable member}}
@@ -211,6 +219,9 @@ void TemplUses(T Parm, U CoS, V ChC) {
// Vars in a reduction must be a scalar or a composite of scalars.
#pragma acc parallel reduction(&: CoS, Var, Parm)
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-3{{invalid operands to binary expression ('float' and 'float')}}
while (1);
// expected-error@+3{{invalid type 'struct CompositeOfScalars' used in OpenACC 'reduction' variable reference; type is not a scalar value}}
// expected-note@#COS_FIELD{{used as field 'COS' of composite 'CompositeHasComposite'}}
@@ -223,6 +234,9 @@ void TemplUses(T Parm, U CoS, V ChC) {
while (1);
#pragma acc parallel reduction(&: CoS, Array[Var], Array[0:Var])
+ // expected-error@-1{{variable of type 'float' referenced in OpenACC 'reduction' clause does not have a valid operation available}}
+ // expected-note@#COS_FLOAT{{while forming combiner for compound type 'CompositeOfScalars'}}
+ // expected-error@-3{{invalid operands to binary expression ('float' and 'float')}}
while (1);
// expected-error@+1{{OpenACC variable is not a valid variable name, sub-array, array element, or composite variable member}}
diff --git a/clang/test/SemaOpenACC/loop-construct-reduction-ast.cpp b/clang/test/SemaOpenACC/loop-construct-reduction-ast.cpp
index 4afb370..2daa56b4 100644
--- a/clang/test/SemaOpenACC/loop-construct-reduction-ast.cpp
+++ b/clang/test/SemaOpenACC/loop-construct-reduction-ast.cpp
@@ -102,24 +102,6 @@ void NormalFunc(int i, float f) {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
-#pragma acc loop reduction(|: f)
- for(int i = 0; i < 5; ++i);
- // CHECK-NEXT: OpenACCLoopConstruct{{.*}}<orphan>
- // CHECK-NEXT: reduction clause Operator: |
- // CHECK-NEXT: DeclRefExpr{{.*}} 'float' lvalue ParmVar{{.*}} 'f' 'float'
- // CHECK-NEXT: ForStmt
- // CHECK-NEXT: DeclStmt
- // CHECK-NEXT: VarDecl{{.*}} i 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 0
- // CHECK-NEXT: <<<NULL>>>
- // CHECK-NEXT: BinaryOperator{{.*}}'<'
- // CHECK-NEXT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 5
- // CHECK-NEXT: UnaryOperator{{.*}}++
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: NullStmt
-
#pragma acc loop reduction(^: i)
for(int i = 0; i < 5; ++i);
@@ -267,25 +249,6 @@ void TemplFunc() {
// CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
// CHECK-NEXT: NullStmt
-#pragma acc loop reduction(&: T::SomeFloat)
- for(int i = 0; i < 5; ++i);
- // CHECK-NEXT: OpenACCLoopConstruct{{.*}}<orphan>
- // CHECK-NEXT: reduction clause Operator: &
- // CHECK-NEXT: DependentScopeDeclRefExpr{{.*}} '<dependent type>' lvalue
- // CHECK-NEXT: NestedNameSpecifier TypeSpec 'T'
- // CHECK-NEXT: ForStmt
- // CHECK-NEXT: DeclStmt
- // CHECK-NEXT: VarDecl{{.*}} i 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 0
- // CHECK-NEXT: <<<NULL>>>
- // CHECK-NEXT: BinaryOperator{{.*}}'<'
- // CHECK-NEXT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 5
- // CHECK-NEXT: UnaryOperator{{.*}}++
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: NullStmt
-
#pragma acc loop reduction(|: i)
for(int i = 0; i < 5; ++i);
// CHECK-NEXT: OpenACCLoopConstruct{{.*}}<orphan>
@@ -440,23 +403,6 @@ void TemplFunc() {
// CHECK-NEXT: NullStmt
//
// CHECK-NEXT: OpenACCLoopConstruct{{.*}}<orphan>
- // CHECK-NEXT: reduction clause Operator: &
- // CHECK-NEXT: DeclRefExpr{{.*}} 'const float' lvalue Var{{.*}} 'SomeFloat' 'const float'
- // CHECK-NEXT: NestedNameSpecifier TypeSpec 'InstTy'
- // CHECK-NEXT: ForStmt
- // CHECK-NEXT: DeclStmt
- // CHECK-NEXT: VarDecl{{.*}} i 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 0
- // CHECK-NEXT: <<<NULL>>>
- // CHECK-NEXT: BinaryOperator{{.*}}'<'
- // CHECK-NEXT: ImplicitCastExpr
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 5
- // CHECK-NEXT: UnaryOperator{{.*}}++
- // CHECK-NEXT: DeclRefExpr{{.*}}'i' 'int'
- // CHECK-NEXT: NullStmt
- //
- // CHECK-NEXT: OpenACCLoopConstruct{{.*}}<orphan>
// CHECK-NEXT: reduction clause Operator: |
// CHECK-NEXT: DeclRefExpr{{.*}} 'typename InstTy::IntTy':'int' lvalue Var{{.*}} 'i' 'typename InstTy::IntTy':'int'
// CHECK-NEXT: ForStmt