Index: clang/lib/Sema/SemaOpenMP.cpp =================================================================== --- clang/lib/Sema/SemaOpenMP.cpp +++ clang/lib/Sema/SemaOpenMP.cpp @@ -3704,7 +3704,8 @@ /// Var <= UB /// UB > Var /// UB >= Var - bool TestIsLessOp = false; + /// This will has no value when the condition is != + llvm::Optional TestIsLessOp; /// This flag is true when condition is strict ( < or > ). bool TestIsStrictOp = false; /// This flag is true when step is subtracted on each iteration. @@ -3770,8 +3771,8 @@ /// 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 LessOp, bool StrictOp, + SourceRange SR, SourceLocation SL); /// Helper to set loop increment. bool setStep(Expr *NewStep, bool Subtract); }; @@ -3806,15 +3807,17 @@ return false; } -bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, bool LessOp, bool StrictOp, - SourceRange SR, SourceLocation SL) { +bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, llvm::Optional 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; @@ -3854,18 +3857,23 @@ 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(); @@ -4006,7 +4014,12 @@ (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(S)) { if (CE->getNumArgs() == 2) { auto Op = CE->getOperator(); @@ -4024,6 +4037,14 @@ 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; } @@ -4172,8 +4193,8 @@ 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) @@ -4274,8 +4295,9 @@ 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(), @@ -4353,9 +4375,9 @@ 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: clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp +++ clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp @@ -144,9 +144,9 @@ 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: clang/test/OpenMP/distribute_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/distribute_simd_loop_messages.cpp +++ clang/test/OpenMP/distribute_simd_loop_messages.cpp @@ -135,9 +135,9 @@ 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: clang/test/OpenMP/for_loop_messages.cpp =================================================================== --- clang/test/OpenMP/for_loop_messages.cpp +++ clang/test/OpenMP/for_loop_messages.cpp @@ -131,8 +131,8 @@ 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: clang/test/OpenMP/for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/for_simd_loop_messages.cpp +++ clang/test/OpenMP/for_simd_loop_messages.cpp @@ -126,8 +126,8 @@ 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: clang/test/OpenMP/parallel_for_ast_print.cpp =================================================================== --- clang/test/OpenMP/parallel_for_ast_print.cpp +++ clang/test/OpenMP/parallel_for_ast_print.cpp @@ -103,6 +103,29 @@ 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: clang/test/OpenMP/parallel_for_codegen.cpp =================================================================== --- clang/test/OpenMP/parallel_for_codegen.cpp +++ clang/test/OpenMP/parallel_for_codegen.cpp @@ -376,5 +376,85 @@ // 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: clang/test/OpenMP/parallel_for_loop_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_for_loop_messages.cpp +++ clang/test/OpenMP/parallel_for_loop_messages.cpp @@ -108,7 +108,7 @@ 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: clang/test/OpenMP/parallel_for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_for_simd_loop_messages.cpp +++ clang/test/OpenMP/parallel_for_simd_loop_messages.cpp @@ -108,7 +108,7 @@ 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: clang/test/OpenMP/simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/simd_loop_messages.cpp +++ clang/test/OpenMP/simd_loop_messages.cpp @@ -99,7 +99,7 @@ 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: clang/test/OpenMP/target_parallel_for_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_parallel_for_loop_messages.cpp +++ clang/test/OpenMP/target_parallel_for_loop_messages.cpp @@ -108,7 +108,7 @@ 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: clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp +++ clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp @@ -108,7 +108,7 @@ 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: clang/test/OpenMP/target_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_simd_loop_messages.cpp +++ clang/test/OpenMP/target_simd_loop_messages.cpp @@ -108,7 +108,7 @@ 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: clang/test/OpenMP/target_teams_distribute_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_loop_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_loop_messages.cpp @@ -108,8 +108,8 @@ 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: clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp @@ -108,8 +108,8 @@ 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: clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp @@ -108,8 +108,8 @@ 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: clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp @@ -108,8 +108,8 @@ 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: clang/test/OpenMP/taskloop_loop_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_loop_messages.cpp +++ clang/test/OpenMP/taskloop_loop_messages.cpp @@ -131,8 +131,8 @@ 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: clang/test/OpenMP/taskloop_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_simd_loop_messages.cpp +++ clang/test/OpenMP/taskloop_simd_loop_messages.cpp @@ -131,8 +131,8 @@ 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: clang/test/OpenMP/teams_distribute_loop_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_loop_messages.cpp +++ clang/test/OpenMP/teams_distribute_loop_messages.cpp @@ -126,9 +126,9 @@ 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: clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp +++ clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp @@ -126,9 +126,9 @@ 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: clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp +++ clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp @@ -126,9 +126,9 @@ 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: clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp +++ clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp @@ -132,9 +132,9 @@ for (int i = 0; i != 1; i++) c[i] = a[i]; +// Ok #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'}} for (int i = 0;; i++) c[i] = a[i];