]> granicus.if.org Git - clang/commitdiff
[OPENMP] Support relational-op != (not-equal) as one of the canonical
authorKelvin Li <kkwli0@gmail.com>
Wed, 21 Nov 2018 19:10:48 +0000 (19:10 +0000)
committerKelvin Li <kkwli0@gmail.com>
Wed, 21 Nov 2018 19:10:48 +0000 (19:10 +0000)
forms of random access iterator

In OpenMP 4.5, only 4 relational operators are supported: <, <=, >,
and >=.  This work is to enable support for relational operator
!= (not-equal) as one of the canonical forms.

Patch by Anh Tuyen Tran

Differential Revision: https://reviews.llvm.org/D54441

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347405 91177308-0d34-0410-b5e6-96231b3b80d8

23 files changed:
lib/Sema/SemaOpenMP.cpp
test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
test/OpenMP/distribute_simd_loop_messages.cpp
test/OpenMP/for_loop_messages.cpp
test/OpenMP/for_simd_loop_messages.cpp
test/OpenMP/parallel_for_ast_print.cpp
test/OpenMP/parallel_for_codegen.cpp
test/OpenMP/parallel_for_loop_messages.cpp
test/OpenMP/parallel_for_simd_loop_messages.cpp
test/OpenMP/simd_loop_messages.cpp
test/OpenMP/target_parallel_for_loop_messages.cpp
test/OpenMP/target_parallel_for_simd_loop_messages.cpp
test/OpenMP/target_simd_loop_messages.cpp
test/OpenMP/target_teams_distribute_loop_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
test/OpenMP/taskloop_loop_messages.cpp
test/OpenMP/taskloop_simd_loop_messages.cpp
test/OpenMP/teams_distribute_loop_messages.cpp
test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
test/OpenMP/teams_distribute_simd_loop_messages.cpp

index c5ac084e17f70a548080aa285682c363eb1717c8..a2a935944c11f5f1f37c297e2914dd3990888059 100644 (file)
@@ -3905,7 +3905,8 @@ class OpenMPIterationSpaceChecker {
   ///   Var <= UB
   ///   UB  >  Var
   ///   UB  >= Var
-  bool TestIsLessOp = false;
+  /// This will have no value when the condition is !=
+  llvm::Optional<bool> TestIsLessOp;
   /// This flag is true when condition is strict ( < or > ).
   bool TestIsStrictOp = false;
   /// This flag is true when step is subtracted on each iteration.
@@ -3971,8 +3972,8 @@ private:
   /// Helper to set loop counter variable and its initializer.
   bool setLCDeclAndLB(ValueDecl *NewLCDecl, Expr *NewDeclRefExpr, Expr *NewLB);
   /// Helper to set upper bound.
-  bool setUB(Expr *NewUB, bool LessOp, bool StrictOp, SourceRange SR,
-             SourceLocation SL);
+  bool setUB(Expr *NewUB, llvm::Optional<bool> LessOp, bool StrictOp,
+             SourceRange SR, SourceLocation SL);
   /// Helper to set loop increment.
   bool setStep(Expr *NewStep, bool Subtract);
 };
@@ -4007,15 +4008,17 @@ bool OpenMPIterationSpaceChecker::setLCDeclAndLB(ValueDecl *NewLCDecl,
   return false;
 }
 
-bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, bool LessOp, bool StrictOp,
-                                        SourceRange SR, SourceLocation SL) {
+bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, llvm::Optional<bool> LessOp,
+                                        bool StrictOp, SourceRange SR,
+                                        SourceLocation SL) {
   // State consistency checking to ensure correct usage.
   assert(LCDecl != nullptr && LB != nullptr && UB == nullptr &&
          Step == nullptr && !TestIsLessOp && !TestIsStrictOp);
   if (!NewUB)
     return true;
   UB = NewUB;
-  TestIsLessOp = LessOp;
+  if (LessOp)
+    TestIsLessOp = LessOp;
   TestIsStrictOp = StrictOp;
   ConditionSrcRange = SR;
   ConditionLoc = SL;
@@ -4055,18 +4058,23 @@ bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) {
     bool IsConstPos =
         IsConstant && Result.isSigned() && (Subtract == Result.isNegative());
     bool IsConstZero = IsConstant && !Result.getBoolValue();
+
+    // != with increment is treated as <; != with decrement is treated as >
+    if (!TestIsLessOp.hasValue())
+      TestIsLessOp = IsConstPos || (IsUnsigned && !Subtract);
     if (UB && (IsConstZero ||
-               (TestIsLessOp ? (IsConstNeg || (IsUnsigned && Subtract))
-                             : (IsConstPos || (IsUnsigned && !Subtract))))) {
+               (TestIsLessOp.getValue() ? 
+                  (IsConstNeg || (IsUnsigned && Subtract)) :
+                  (IsConstPos || (IsUnsigned && !Subtract))))) {
       SemaRef.Diag(NewStep->getExprLoc(),
                    diag::err_omp_loop_incr_not_compatible)
-          << LCDecl << TestIsLessOp << NewStep->getSourceRange();
+          << LCDecl << TestIsLessOp.getValue() << NewStep->getSourceRange();
       SemaRef.Diag(ConditionLoc,
                    diag::note_omp_loop_cond_requres_compatible_incr)
-          << TestIsLessOp << ConditionSrcRange;
+          << TestIsLessOp.getValue() << ConditionSrcRange;
       return true;
     }
-    if (TestIsLessOp == Subtract) {
+    if (TestIsLessOp.getValue() == Subtract) {
       NewStep =
           SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep)
               .get();
@@ -4207,7 +4215,12 @@ bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
                      (BO->getOpcode() == BO_GT || BO->getOpcode() == BO_GE),
                      (BO->getOpcode() == BO_LT || BO->getOpcode() == BO_GT),
                      BO->getSourceRange(), BO->getOperatorLoc());
-    }
+    } else if (BO->getOpcode() == BO_NE)
+        return setUB(getInitLCDecl(BO->getLHS()) == LCDecl ?
+                       BO->getRHS() : BO->getLHS(),
+                     /*LessOp=*/llvm::None,
+                     /*StrictOp=*/true,
+                     BO->getSourceRange(), BO->getOperatorLoc());
   } else if (auto *CE = dyn_cast<CXXOperatorCallExpr>(S)) {
     if (CE->getNumArgs() == 2) {
       auto Op = CE->getOperator();
@@ -4225,6 +4238,14 @@ bool OpenMPIterationSpaceChecker::checkAndSetCond(Expr *S) {
                        Op == OO_Less || Op == OO_Greater, CE->getSourceRange(),
                        CE->getOperatorLoc());
         break;
+      case OO_ExclaimEqual: 
+        return setUB(getInitLCDecl(CE->getArg(0)) == LCDecl ?
+                     CE->getArg(1) : CE->getArg(0),
+                     /*LessOp=*/llvm::None,
+                     /*StrictOp=*/true,
+                     CE->getSourceRange(),
+                     CE->getOperatorLoc());
+        break;
       default:
         break;
       }
@@ -4373,8 +4394,8 @@ Expr *OpenMPIterationSpaceChecker::buildNumIterations(
   if (VarType->isIntegerType() || VarType->isPointerType() ||
       SemaRef.getLangOpts().CPlusPlus) {
     // Upper - Lower
-    Expr *UBExpr = TestIsLessOp ? UB : LB;
-    Expr *LBExpr = TestIsLessOp ? LB : UB;
+    Expr *UBExpr = TestIsLessOp.getValue() ? UB : LB;
+    Expr *LBExpr = TestIsLessOp.getValue() ? LB : UB;
     Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get();
     Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get();
     if (!Upper || !Lower)
@@ -4475,8 +4496,9 @@ Expr *OpenMPIterationSpaceChecker::buildPreCond(
 
   ExprResult CondExpr =
       SemaRef.BuildBinOp(S, DefaultLoc,
-                         TestIsLessOp ? (TestIsStrictOp ? BO_LT : BO_LE)
-                                      : (TestIsStrictOp ? BO_GT : BO_GE),
+                         TestIsLessOp.getValue() ? 
+                           (TestIsStrictOp ? BO_LT : BO_LE) :
+                           (TestIsStrictOp ? BO_GT : BO_GE),
                          NewLB.get(), NewUB.get());
   if (CondExpr.isUsable()) {
     if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(),
@@ -4554,9 +4576,9 @@ Expr *OpenMPIterationSpaceChecker::buildOrderedLoopData(
       SemaRef.getLangOpts().CPlusPlus) {
     // Upper - Lower
     Expr *Upper =
-        TestIsLessOp ? Cnt : tryBuildCapture(SemaRef, UB, Captures).get();
+        TestIsLessOp.getValue() ? Cnt : tryBuildCapture(SemaRef, UB, Captures).get();
     Expr *Lower =
-        TestIsLessOp ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt;
+        TestIsLessOp.getValue() ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt;
     if (!Upper || !Lower)
       return nullptr;
 
index 4d91a703cd14e315dfccc0b80f2a6156fe81ec4f..2c0d7ab742858863942d58df7d73200768164915 100644 (file)
@@ -144,9 +144,9 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target
 #pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
 #pragma omp distribute parallel for simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index e3a972a434b82660b70f7b0d80e3af7463223470..b46bdad0b6414fde39c250776680cbac68f51fc8 100644 (file)
@@ -135,9 +135,9 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+  // Ok
   #pragma omp target
   #pragma omp teams
-  // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   #pragma omp distribute simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 37ff0fc0ca2dd4baee38c8e6372e6eae940def94..8817c77acf1586d86f2a51c970c1a408b298c6dc 100644 (file)
@@ -131,8 +131,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
 #pragma omp for
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index a3ae84efd4aec7f0c53af2a4dba68a03e304677f..29ab738dd149751c933b40c5d400cd18b86c8881 100644 (file)
@@ -126,8 +126,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
 #pragma omp for simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 1e77bc855a22ada6a34a8ae23df1aefb87be5e58..036279030c1d7d0fc7981dcf4a439fe988f803cf 100644 (file)
@@ -103,6 +103,29 @@ T tmain(T argc) {
   return T();
 }
 
+int increment () {
+  #pragma omp for
+  for (int i = 5 ; i != 0; ++i)
+    ;
+  // CHECK:      int increment() {
+  // CHECK-NEXT:   #pragma omp for
+  // CHECK-NEXT:     for (int i = 5; i != 0; ++i)
+  // CHECK-NEXT:       ;
+  return 0;
+}
+
+int decrement_nowait () {
+  #pragma omp for nowait
+  for (int j = 5 ; j != 0; --j)
+    ;
+  // CHECK:      int decrement_nowait() {
+  // CHECK-NEXT:   #pragma omp for nowait
+  // CHECK-NEXT:     for (int j = 5; j != 0; --j)
+  // CHECK-NEXT:       ;
+  return 0;
+}
+
+
 int main(int argc, char **argv) {
   int b = argc, c, d, e, f, h;
   static int a;
index 1036b61e04a6d798d94a9bbfb8cfa156db3b2917..a3d307afac974b51e57697448aaa9a829b73d37a 100644 (file)
@@ -376,5 +376,85 @@ void parallel_for(float *a, const int n) {
 // TERM_DEBUG-DAG: [[DBG_LOC_START]] = !DILocation(line: [[@LINE-4]],
 // TERM_DEBUG-DAG: [[DBG_LOC_END]] = !DILocation(line: [[@LINE-18]],
 
+// CHECK-LABEL: increment
+int increment () {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
+  #pragma omp for
+// Determine UB = min(UB, GlobalUB)
+// CHECK: call void @__kmpc_for_static_init_4([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
+// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// CHECK-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
+// CHECK-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
+// CHECK: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
+// CHECK-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
+// CHECK-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
+// CHECK-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
+// CHECK-NEXT: br label %[[LOOP1_HEAD:.+]]
+
+// Loop header
+// CHECK: [[LOOP1_HEAD]]
+// CHECK: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
+// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// CHECK-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
+// CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
+
+  for (int i = 0 ; i != 5; ++i)
+// Start of body: calculate i from IV:
+// CHECK: [[LOOP1_BODY]]
+// CHECK: [[IV1_1:%.+]] = load i32, i32* [[OMP_IV]]
+// CHECK-NEXT: [[CALC_I_1:%.+]] = mul nsw i32 [[IV1_1]], 1
+// CHECK-NEXT: [[CALC_I_2:%.+]] = add nsw i32 0, [[CALC_I_1]]
+// CHECK-NEXT: store i32 [[CALC_I_2]], i32* [[LC_I:.+]]
+// CHECK: [[IV1_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
+// CHECK-NEXT: [[ADD1_2:%.+]] = add nsw i32 [[IV1_2]], 1
+// CHECK-NEXT: store i32 [[ADD1_2]], i32* [[OMP_IV]]
+// CHECK-NEXT: br label %[[LOOP1_HEAD]]
+    ;
+// CHECK: [[LOOP1_END]]
+// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]])
+// CHECK: __kmpc_barrier
+  return 0;
+// CHECK: ret i32 0
+}
+
+// CHECK-LABEL: decrement_nowait
+int decrement_nowait () {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
+  #pragma omp for nowait
+// Determine UB = min(UB, GlobalUB)
+// CHECK: call void @__kmpc_for_static_init_4([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
+// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// CHECK-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
+// CHECK-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
+// CHECK: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
+// CHECK-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
+// CHECK-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
+// CHECK-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
+// CHECK-NEXT: br label %[[LOOP1_HEAD:.+]]
+
+// Loop header
+// CHECK: [[LOOP1_HEAD]]
+// CHECK: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
+// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// CHECK-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
+// CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
+  for (int j = 5 ; j != 0; --j)
+// Start of body: calculate i from IV:
+// CHECK: [[LOOP1_BODY]]
+// CHECK: [[IV2_1:%.+]] = load i32, i32* [[OMP_IV]]
+// CHECK-NEXT: [[CALC_II_1:%.+]] = mul nsw i32 [[IV2_1]], 1
+// CHECK-NEXT: [[CALC_II_2:%.+]] = sub nsw i32 5, [[CALC_II_1]]
+// CHECK-NEXT: store i32 [[CALC_II_2]], i32* [[LC_I:.+]]
+// CHECK: [[IV2_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
+// CHECK-NEXT: [[ADD2_2:%.+]] = add nsw i32 [[IV2_2]], 1
+// CHECK-NEXT: store i32 [[ADD2_2]], i32* [[OMP_IV]]
+// CHECK-NEXT: br label %[[LOOP1_HEAD]]
+    ;
+// CHECK: [[LOOP1_END]]
+// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]])
+// CHECK-NOT: __kmpc_barrier
+  return 0;
+// CHECK: ret i32 0
+}
 #endif // HEADER
 
index 193c84e27fa595dbe972b90afdeeb659c294f019..12020c37a575eae6e8df29a3db24d601730186a5 100644 (file)
@@ -108,7 +108,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
 #pragma omp parallel for
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index d9d05cccc54cd6f80b82db413cdd7273eb22c511..ba54cb2c09ac9e6f9be7d2564890d0f10fb6bc7f 100644 (file)
@@ -108,7 +108,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
 #pragma omp parallel for simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index b9d146c2150a6849357ff1f4154e6045b3750ff3..80f3cb14b76e59a0404bf8be71d57e19a29ecc25 100644 (file)
@@ -99,7 +99,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-  // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+  // Ok
   #pragma omp simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 416cbfa1f3c3f44b8e59a2062934223926b70b03..6cc1f80887d6e32cc2490c273961480a75ffbae7 100644 (file)
@@ -108,7 +108,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
 #pragma omp target parallel for
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index fabf389150d09db9a1a35d6377a0f8e3dbf376d2..e2e80186cd8894c535c86611e6a2087b9e32b3c6 100644 (file)
@@ -108,7 +108,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
 #pragma omp target parallel for simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 760bfe0496c2fd0a3636cbba66e59d807a97455b..4ab02e7550580acdf4f7394809c16b1b698387e7 100644 (file)
@@ -108,7 +108,7 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
 #pragma omp target simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index b090c288a20186124adeae4bde20c8acad4d5e23..0ce8cbf71baac538f9e027768df9b66a777c75e8 100644 (file)
@@ -108,8 +108,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 01bf38deb97c3828f3959741c472eaa470ab8f74..ca537dd976ddd48fca05828b946468bba1c92e37 100644 (file)
@@ -108,8 +108,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 1378ea4eb65c523a1a5a22e133e88e272270c751..6c7cb795059f4f7274c2fd7c67243ba432cf20d8 100644 (file)
@@ -108,8 +108,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 463c88df2c3e8b1690b17de90d9aa257276ab9eb..cba8e8205611dedebfd16a50168f3afa763f56a7 100644 (file)
@@ -108,8 +108,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 4ce83b4ae1aeb9df601f474dd39176229a5a7924..324114d6d745d712ade7eec704da5b5179b66a5f 100644 (file)
@@ -131,8 +131,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
 #pragma omp taskloop
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 71aa9dfe1143ba42636eb74edb84cdce9a2a10b5..fcae0130d96c21695e7e5d2e5790f632b8d136b8 100644 (file)
@@ -131,8 +131,8 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
 #pragma omp taskloop simd
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
index 0d3ed75cb3629308e4627fd847999d790e514f04..a96d86d7d6af385855690ebb66f444726d648d37 100644 (file)
@@ -126,9 +126,9 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target
 #pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 7ee1e5ab5779764c52a2be719bad4ece169a7bed..42dc92e3cecae5b619e144d82bf70b40754d9b8b 100644 (file)
@@ -126,9 +126,9 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target
 #pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index fc32aac0dfa2dfc50e0ebfbd9b982d0af52080cf..a1c928073697babd1352af6145a36a81beb4b373 100644 (file)
@@ -126,9 +126,9 @@ int test_iteration_spaces() {
   for (int i = 0; !!i; i++)
     c[i] = a[i];
 
+// Ok
 #pragma omp target
 #pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
   for (int i = 0; i != 1; i++)
     c[i] = a[i];
 
index 7ca6721689b57aee09d00211aa71a2e72ea1d44e..777f0812ce43adbb5306960a1a8a00dad5895e81 100644 (file)
@@ -128,7 +128,7 @@ int test_iteration_spaces() {
 
 #pragma omp target
 #pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// Ok
   for (int i = 0; i != 1; i++)
     c[i] = a[i];