diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6902,221 +6902,344 @@ return Res; } -/// Build the expression to calculate the number of iterations. -Expr *OpenMPIterationSpaceChecker::buildNumIterations( - Scope *S, ArrayRef ResultIterSpaces, bool LimitedType, - llvm::MapVector &Captures) const { - ExprResult Diff; - QualType VarType = LCDecl->getType().getNonReferenceType(); - if (VarType->isIntegerType() || VarType->isPointerType() || - SemaRef.getLangOpts().CPlusPlus) { - Expr *LBVal = LB; - Expr *UBVal = UB; - // LB = TestIsLessOp.getValue() ? min(LB(MinVal), LB(MaxVal)) : - // max(LB(MinVal), LB(MaxVal)) - if (InitDependOnLC) { - const LoopIterationSpace &IS = - ResultIterSpaces[ResultIterSpaces.size() - 1 - - InitDependOnLC.getValueOr( - CondDependOnLC.getValueOr(0))]; - if (!IS.MinValue || !IS.MaxValue) - return nullptr; - // OuterVar = Min - ExprResult MinValue = - SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); - if (!MinValue.isUsable()) - return nullptr; - - ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, - IS.CounterVar, MinValue.get()); - if (!LBMinVal.isUsable()) - return nullptr; - // OuterVar = Min, LBVal - LBMinVal = - SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); - if (!LBMinVal.isUsable()) - return nullptr; - // (OuterVar = Min, LBVal) - LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); - if (!LBMinVal.isUsable()) - return nullptr; - - // OuterVar = Max - ExprResult MaxValue = - SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); - if (!MaxValue.isUsable()) - return nullptr; - - ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, - IS.CounterVar, MaxValue.get()); - if (!LBMaxVal.isUsable()) - return nullptr; - // OuterVar = Max, LBVal - LBMaxVal = - SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); - if (!LBMaxVal.isUsable()) - return nullptr; - // (OuterVar = Max, LBVal) - LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); - if (!LBMaxVal.isUsable()) - return nullptr; - - Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); - Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); - if (!LBMin || !LBMax) - return nullptr; - // LB(MinVal) < LB(MaxVal) - ExprResult MinLessMaxRes = - SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); - if (!MinLessMaxRes.isUsable()) - return nullptr; - Expr *MinLessMax = - tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); - if (!MinLessMax) - return nullptr; - if (TestIsLessOp.getValue()) { - // LB(MinVal) < LB(MaxVal) ? LB(MinVal) : LB(MaxVal) - min(LB(MinVal), - // LB(MaxVal)) - ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, - MinLessMax, LBMin, LBMax); - if (!MinLB.isUsable()) - return nullptr; - LBVal = MinLB.get(); - } else { - // LB(MinVal) < LB(MaxVal) ? LB(MaxVal) : LB(MinVal) - max(LB(MinVal), - // LB(MaxVal)) - ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, - MinLessMax, LBMax, LBMin); - if (!MaxLB.isUsable()) - return nullptr; - LBVal = MaxLB.get(); - } +/// Calculate number of iterations, transforming to unsigned, if number of +/// iterations may be larger than the original type. +static Expr * +calculateNumIters(Sema &SemaRef, Scope *S, SourceLocation DefaultLoc, + Expr *Lower, Expr *Upper, Expr *Step, QualType LCTy, + bool TestIsStrictOp, bool RoundToStep, + llvm::MapVector &Captures) { + ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); + if (!NewStep.isUsable()) + return nullptr; + llvm::APSInt LRes, URes, SRes; + bool IsLowerConst = Lower->isIntegerConstantExpr(LRes, SemaRef.Context); + bool IsStepConst = Step->isIntegerConstantExpr(SRes, SemaRef.Context); + bool NoNeedToConvert = IsLowerConst && !RoundToStep && + ((!TestIsStrictOp && LRes.isNonNegative()) || + (TestIsStrictOp && LRes.isStrictlyPositive())); + bool NeedToReorganize = false; + // Check if any subexpressions in Lower -Step [+ 1] lead to overflow. + if (!NoNeedToConvert && IsLowerConst && + (TestIsStrictOp || (RoundToStep && IsStepConst))) { + NoNeedToConvert = true; + if (RoundToStep) { + unsigned BW = LRes.getBitWidth() > SRes.getBitWidth() + ? LRes.getBitWidth() + : SRes.getBitWidth(); + LRes = LRes.extend(BW + 1); + LRes.setIsSigned(true); + SRes = SRes.extend(BW + 1); + SRes.setIsSigned(true); + LRes -= SRes; + NoNeedToConvert = LRes.trunc(BW).extend(BW + 1) == LRes; + LRes = LRes.trunc(BW); + } + if (TestIsStrictOp) { + unsigned BW = LRes.getBitWidth(); + LRes = LRes.extend(BW + 1); + LRes.setIsSigned(true); + ++LRes; + NoNeedToConvert = + NoNeedToConvert && LRes.trunc(BW).extend(BW + 1) == LRes; + // truncate to the original bitwidth. + LRes = LRes.trunc(BW); + } + NeedToReorganize = NoNeedToConvert; + } + bool IsUpperConst = Upper->isIntegerConstantExpr(URes, SemaRef.Context); + if (NoNeedToConvert && IsLowerConst && IsUpperConst && + (!RoundToStep || IsStepConst)) { + unsigned BW = LRes.getBitWidth() > URes.getBitWidth() ? LRes.getBitWidth() + : URes.getBitWidth(); + LRes = LRes.extend(BW + 1); + LRes.setIsSigned(true); + URes = URes.extend(BW + 1); + URes.setIsSigned(true); + URes -= LRes; + NoNeedToConvert = URes.trunc(BW).extend(BW + 1) == URes; + NeedToReorganize = NoNeedToConvert; + } + // If the boundaries are not constant or (Lower - Step [+ 1]) is not constant + // or less than zero (Upper - (Lower - Step [+ 1]) may overflow) - promote to + // unsigned. + if ((!NoNeedToConvert || (LRes.isNegative() && !IsUpperConst)) && + !LCTy->isDependentType() && LCTy->isIntegerType()) { + QualType LowerTy = Lower->getType(); + QualType UpperTy = Upper->getType(); + uint64_t LowerSize = SemaRef.Context.getTypeSize(LowerTy); + uint64_t UpperSize = SemaRef.Context.getTypeSize(UpperTy); + if ((LowerSize <= UpperSize && UpperTy->hasSignedIntegerRepresentation()) || + (LowerSize > UpperSize && LowerTy->hasSignedIntegerRepresentation())) { + QualType CastType = SemaRef.Context.getIntTypeForBitwidth( + LowerSize > UpperSize ? LowerSize : UpperSize, /*Signed=*/0); + Upper = + SemaRef + .PerformImplicitConversion( + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), + CastType, Sema::AA_Converting) + .get(); + Lower = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(); + NewStep = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, NewStep.get()); } - // UB = TestIsLessOp.getValue() ? max(UB(MinVal), UB(MaxVal)) : - // min(UB(MinVal), UB(MaxVal)) - if (CondDependOnLC) { - const LoopIterationSpace &IS = - ResultIterSpaces[ResultIterSpaces.size() - 1 - - InitDependOnLC.getValueOr( - CondDependOnLC.getValueOr(0))]; - if (!IS.MinValue || !IS.MaxValue) - return nullptr; - // OuterVar = Min - ExprResult MinValue = - SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); - if (!MinValue.isUsable()) - return nullptr; - - ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, - IS.CounterVar, MinValue.get()); - if (!UBMinVal.isUsable()) - return nullptr; - // OuterVar = Min, UBVal - UBMinVal = - SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); - if (!UBMinVal.isUsable()) - return nullptr; - // (OuterVar = Min, UBVal) - UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); - if (!UBMinVal.isUsable()) - return nullptr; + } + if (!Lower || !Upper || NewStep.isInvalid()) + return nullptr; - // OuterVar = Max - ExprResult MaxValue = - SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); - if (!MaxValue.isUsable()) + ExprResult Diff; + // If need to reorganize, then calculate the form as Upper - (Lower - Step [+ + // 1]). + if (NeedToReorganize) { + Diff = Lower; + + if (RoundToStep) { + // Lower - Step + Diff = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Diff.get(), NewStep.get()); + if (!Diff.isUsable()) return nullptr; + } - ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, - IS.CounterVar, MaxValue.get()); - if (!UBMaxVal.isUsable()) - return nullptr; - // OuterVar = Max, UBVal - UBMaxVal = - SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); - if (!UBMaxVal.isUsable()) - return nullptr; - // (OuterVar = Max, UBVal) - UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); - if (!UBMaxVal.isUsable()) - return nullptr; + // Lower - Step [+ 1] + if (TestIsStrictOp) + Diff = SemaRef.BuildBinOp( + S, DefaultLoc, BO_Add, Diff.get(), + SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); + if (!Diff.isUsable()) + return nullptr; - Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); - Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); - if (!UBMin || !UBMax) - return nullptr; - // UB(MinVal) > UB(MaxVal) - ExprResult MinGreaterMaxRes = - SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); - if (!MinGreaterMaxRes.isUsable()) - return nullptr; - Expr *MinGreaterMax = - tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); - if (!MinGreaterMax) - return nullptr; - if (TestIsLessOp.getValue()) { - // UB(MinVal) > UB(MaxVal) ? UB(MinVal) : UB(MaxVal) - max(UB(MinVal), - // UB(MaxVal)) - ExprResult MaxUB = SemaRef.ActOnConditionalOp( - DefaultLoc, DefaultLoc, MinGreaterMax, UBMin, UBMax); - if (!MaxUB.isUsable()) - return nullptr; - UBVal = MaxUB.get(); - } else { - // UB(MinVal) > UB(MaxVal) ? UB(MaxVal) : UB(MinVal) - min(UB(MinVal), - // UB(MaxVal)) - ExprResult MinUB = SemaRef.ActOnConditionalOp( - DefaultLoc, DefaultLoc, MinGreaterMax, UBMax, UBMin); - if (!MinUB.isUsable()) - return nullptr; - UBVal = MinUB.get(); - } - } - // Upper - Lower - Expr *UBExpr = TestIsLessOp.getValue() ? UBVal : LBVal; - Expr *LBExpr = TestIsLessOp.getValue() ? LBVal : UBVal; - Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); - Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); - if (!Upper || !Lower) + Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); + if (!Diff.isUsable()) return nullptr; + // Upper - (Lower - Step [+ 1]). + Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); + if (!Diff.isUsable()) + return nullptr; + } else { Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); - if (!Diff.isUsable() && VarType->getAsCXXRecordDecl()) { + if (!Diff.isUsable() && LCTy->getAsCXXRecordDecl()) { // BuildBinOp already emitted error, this one is to point user to upper // and lower bound, and to tell what is passed to 'operator-'. SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) << Upper->getSourceRange() << Lower->getSourceRange(); return nullptr; } + + if (!Diff.isUsable()) + return nullptr; + + // Upper - Lower [- 1] + if (TestIsStrictOp) + Diff = SemaRef.BuildBinOp( + S, DefaultLoc, BO_Sub, Diff.get(), + SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); + if (!Diff.isUsable()) + return nullptr; + + if (RoundToStep) { + // Upper - Lower [- 1] + Step + Diff = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); + if (!Diff.isUsable()) + return nullptr; + } } + // Parentheses (for dumping/debugging purposes only). + Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); if (!Diff.isUsable()) return nullptr; - // Upper - Lower [- 1] - if (TestIsStrictOp) - Diff = SemaRef.BuildBinOp( - S, DefaultLoc, BO_Sub, Diff.get(), - SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); + // (Upper - Lower [- 1] + Step) / Step or (Upper - Lower) / Step + Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); if (!Diff.isUsable()) return nullptr; - // Upper - Lower [- 1] + Step - ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); - if (!NewStep.isUsable()) - return nullptr; - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Diff.get(), NewStep.get()); - if (!Diff.isUsable()) + return Diff.get(); +} + +/// Build the expression to calculate the number of iterations. +Expr *OpenMPIterationSpaceChecker::buildNumIterations( + Scope *S, ArrayRef ResultIterSpaces, bool LimitedType, + llvm::MapVector &Captures) const { + QualType VarType = LCDecl->getType().getNonReferenceType(); + if (!VarType->isIntegerType() && !VarType->isPointerType() && + !SemaRef.getLangOpts().CPlusPlus) return nullptr; + Expr *LBVal = LB; + Expr *UBVal = UB; + // LB = TestIsLessOp.getValue() ? min(LB(MinVal), LB(MaxVal)) : + // max(LB(MinVal), LB(MaxVal)) + if (InitDependOnLC) { + const LoopIterationSpace &IS = + ResultIterSpaces[ResultIterSpaces.size() - 1 - + InitDependOnLC.getValueOr( + CondDependOnLC.getValueOr(0))]; + if (!IS.MinValue || !IS.MaxValue) + return nullptr; + // OuterVar = Min + ExprResult MinValue = + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); + if (!MinValue.isUsable()) + return nullptr; - // Parentheses (for dumping/debugging purposes only). - Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); - if (!Diff.isUsable()) + ExprResult LBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, + IS.CounterVar, MinValue.get()); + if (!LBMinVal.isUsable()) + return nullptr; + // OuterVar = Min, LBVal + LBMinVal = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMinVal.get(), LBVal); + if (!LBMinVal.isUsable()) + return nullptr; + // (OuterVar = Min, LBVal) + LBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMinVal.get()); + if (!LBMinVal.isUsable()) + return nullptr; + + // OuterVar = Max + ExprResult MaxValue = + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); + if (!MaxValue.isUsable()) + return nullptr; + + ExprResult LBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, + IS.CounterVar, MaxValue.get()); + if (!LBMaxVal.isUsable()) + return nullptr; + // OuterVar = Max, LBVal + LBMaxVal = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, LBMaxVal.get(), LBVal); + if (!LBMaxVal.isUsable()) + return nullptr; + // (OuterVar = Max, LBVal) + LBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, LBMaxVal.get()); + if (!LBMaxVal.isUsable()) + return nullptr; + + Expr *LBMin = tryBuildCapture(SemaRef, LBMinVal.get(), Captures).get(); + Expr *LBMax = tryBuildCapture(SemaRef, LBMaxVal.get(), Captures).get(); + if (!LBMin || !LBMax) + return nullptr; + // LB(MinVal) < LB(MaxVal) + ExprResult MinLessMaxRes = + SemaRef.BuildBinOp(S, DefaultLoc, BO_LT, LBMin, LBMax); + if (!MinLessMaxRes.isUsable()) + return nullptr; + Expr *MinLessMax = + tryBuildCapture(SemaRef, MinLessMaxRes.get(), Captures).get(); + if (!MinLessMax) + return nullptr; + if (TestIsLessOp.getValue()) { + // LB(MinVal) < LB(MaxVal) ? LB(MinVal) : LB(MaxVal) - min(LB(MinVal), + // LB(MaxVal)) + ExprResult MinLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, + MinLessMax, LBMin, LBMax); + if (!MinLB.isUsable()) + return nullptr; + LBVal = MinLB.get(); + } else { + // LB(MinVal) < LB(MaxVal) ? LB(MaxVal) : LB(MinVal) - max(LB(MinVal), + // LB(MaxVal)) + ExprResult MaxLB = SemaRef.ActOnConditionalOp(DefaultLoc, DefaultLoc, + MinLessMax, LBMax, LBMin); + if (!MaxLB.isUsable()) + return nullptr; + LBVal = MaxLB.get(); + } + } + // UB = TestIsLessOp.getValue() ? max(UB(MinVal), UB(MaxVal)) : + // min(UB(MinVal), UB(MaxVal)) + if (CondDependOnLC) { + const LoopIterationSpace &IS = + ResultIterSpaces[ResultIterSpaces.size() - 1 - + InitDependOnLC.getValueOr( + CondDependOnLC.getValueOr(0))]; + if (!IS.MinValue || !IS.MaxValue) + return nullptr; + // OuterVar = Min + ExprResult MinValue = + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MinValue); + if (!MinValue.isUsable()) + return nullptr; + + ExprResult UBMinVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, + IS.CounterVar, MinValue.get()); + if (!UBMinVal.isUsable()) + return nullptr; + // OuterVar = Min, UBVal + UBMinVal = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMinVal.get(), UBVal); + if (!UBMinVal.isUsable()) + return nullptr; + // (OuterVar = Min, UBVal) + UBMinVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMinVal.get()); + if (!UBMinVal.isUsable()) + return nullptr; + + // OuterVar = Max + ExprResult MaxValue = + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, IS.MaxValue); + if (!MaxValue.isUsable()) + return nullptr; + + ExprResult UBMaxVal = SemaRef.BuildBinOp(S, DefaultLoc, BO_Assign, + IS.CounterVar, MaxValue.get()); + if (!UBMaxVal.isUsable()) + return nullptr; + // OuterVar = Max, UBVal + UBMaxVal = + SemaRef.BuildBinOp(S, DefaultLoc, BO_Comma, UBMaxVal.get(), UBVal); + if (!UBMaxVal.isUsable()) + return nullptr; + // (OuterVar = Max, UBVal) + UBMaxVal = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, UBMaxVal.get()); + if (!UBMaxVal.isUsable()) + return nullptr; + + Expr *UBMin = tryBuildCapture(SemaRef, UBMinVal.get(), Captures).get(); + Expr *UBMax = tryBuildCapture(SemaRef, UBMaxVal.get(), Captures).get(); + if (!UBMin || !UBMax) + return nullptr; + // UB(MinVal) > UB(MaxVal) + ExprResult MinGreaterMaxRes = + SemaRef.BuildBinOp(S, DefaultLoc, BO_GT, UBMin, UBMax); + if (!MinGreaterMaxRes.isUsable()) + return nullptr; + Expr *MinGreaterMax = + tryBuildCapture(SemaRef, MinGreaterMaxRes.get(), Captures).get(); + if (!MinGreaterMax) + return nullptr; + if (TestIsLessOp.getValue()) { + // UB(MinVal) > UB(MaxVal) ? UB(MinVal) : UB(MaxVal) - max(UB(MinVal), + // UB(MaxVal)) + ExprResult MaxUB = SemaRef.ActOnConditionalOp( + DefaultLoc, DefaultLoc, MinGreaterMax, UBMin, UBMax); + if (!MaxUB.isUsable()) + return nullptr; + UBVal = MaxUB.get(); + } else { + // UB(MinVal) > UB(MaxVal) ? UB(MaxVal) : UB(MinVal) - min(UB(MinVal), + // UB(MaxVal)) + ExprResult MinUB = SemaRef.ActOnConditionalOp( + DefaultLoc, DefaultLoc, MinGreaterMax, UBMax, UBMin); + if (!MinUB.isUsable()) + return nullptr; + UBVal = MinUB.get(); + } + } + Expr *UBExpr = TestIsLessOp.getValue() ? UBVal : LBVal; + Expr *LBExpr = TestIsLessOp.getValue() ? LBVal : UBVal; + Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get(); + Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get(); + if (!Upper || !Lower) return nullptr; - // (Upper - Lower [- 1] + Step) / Step - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); + ExprResult Diff = + calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, + TestIsStrictOp, /*RoundToStep=*/true, Captures); if (!Diff.isUsable()) return nullptr; @@ -7190,52 +7313,34 @@ MaxExpr = Upper; // Build minimum/maximum value based on number of iterations. - ExprResult Diff; QualType VarType = LCDecl->getType().getNonReferenceType(); - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); + ExprResult Diff = + calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, Step, VarType, + TestIsStrictOp, /*RoundToStep=*/false, Captures); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - // Upper - Lower [- 1] - if (TestIsStrictOp) - Diff = SemaRef.BuildBinOp( - S, DefaultLoc, BO_Sub, Diff.get(), - SemaRef.ActOnIntegerConstant(SourceLocation(), 1).get()); + // ((Upper - Lower [- 1]) / Step) * Step + // Parentheses (for dumping/debugging purposes only). + Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - // Upper - Lower [- 1] + Step ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); if (!NewStep.isUsable()) return std::make_pair(nullptr, nullptr); - - // Parentheses (for dumping/debugging purposes only). - Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); - if (!Diff.isUsable()) - return std::make_pair(nullptr, nullptr); - - // (Upper - Lower [- 1]) / Step - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); + Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - // ((Upper - Lower [- 1]) / Step) * Step // Parentheses (for dumping/debugging purposes only). Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Mul, Diff.get(), NewStep.get()); - if (!Diff.isUsable()) - return std::make_pair(nullptr, nullptr); - - // Convert to the original type or ptrdiff_t, if original type is pointer. - if (!VarType->isAnyPointerType() && - !SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) { - Diff = SemaRef.PerformImplicitConversion( - Diff.get(), VarType, Sema::AA_Converting, /*AllowExplicit=*/true); - } else if (VarType->isAnyPointerType() && + // Convert to the ptrdiff_t, if original type is pointer. + if (VarType->isAnyPointerType() && !SemaRef.Context.hasSameType( Diff.get()->getType(), SemaRef.Context.getUnsignedPointerDiffType())) { @@ -7246,33 +7351,43 @@ if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - // Parentheses (for dumping/debugging purposes only). - Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); - if (!Diff.isUsable()) - return std::make_pair(nullptr, nullptr); - if (TestIsLessOp.getValue()) { // MinExpr = Lower; // MaxExpr = Lower + (((Upper - Lower [- 1]) / Step) * Step) - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Add, Lower, Diff.get()); - if (!Diff.isUsable()) - return std::make_pair(nullptr, nullptr); - Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue*/ false); + Diff = SemaRef.BuildBinOp( + S, DefaultLoc, BO_Add, + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Lower).get(), + Diff.get()); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - MaxExpr = Diff.get(); } else { // MaxExpr = Upper; // MinExpr = Upper - (((Upper - Lower [- 1]) / Step) * Step) - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Diff.get()); - if (!Diff.isUsable()) - return std::make_pair(nullptr, nullptr); - Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue*/ false); + Diff = SemaRef.BuildBinOp( + S, DefaultLoc, BO_Sub, + SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Upper).get(), + Diff.get()); if (!Diff.isUsable()) return std::make_pair(nullptr, nullptr); - MinExpr = Diff.get(); } + // Convert to the original type. + if (SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) + Diff = SemaRef.PerformImplicitConversion(Diff.get(), VarType, + Sema::AA_Converting, + /*AllowExplicit=*/true); + if (!Diff.isUsable()) + return std::make_pair(nullptr, nullptr); + + Diff = SemaRef.ActOnFinishFullExpr(Diff.get(), /*DiscardedValue=*/false); + if (!Diff.isUsable()) + return std::make_pair(nullptr, nullptr); + + if (TestIsLessOp.getValue()) + MaxExpr = Diff.get(); + else + MinExpr = Diff.get(); + return std::make_pair(MinExpr, MaxExpr); } @@ -7378,44 +7493,23 @@ if (!Cnt) return nullptr; } - ExprResult Diff; QualType VarType = LCDecl->getType().getNonReferenceType(); - if (VarType->isIntegerType() || VarType->isPointerType() || - SemaRef.getLangOpts().CPlusPlus) { - // Upper - Lower - Expr *Upper = TestIsLessOp.getValue() - ? Cnt - : tryBuildCapture(SemaRef, LB, Captures).get(); - Expr *Lower = TestIsLessOp.getValue() - ? tryBuildCapture(SemaRef, LB, Captures).get() - : Cnt; - if (!Upper || !Lower) - return nullptr; - - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Sub, Upper, Lower); - - if (!Diff.isUsable() && VarType->getAsCXXRecordDecl()) { - // BuildBinOp already emitted error, this one is to point user to upper - // and lower bound, and to tell what is passed to 'operator-'. - SemaRef.Diag(Upper->getBeginLoc(), diag::err_omp_loop_diff_cxx) - << Upper->getSourceRange() << Lower->getSourceRange(); - return nullptr; - } - } - - if (!Diff.isUsable()) + if (!VarType->isIntegerType() && !VarType->isPointerType() && + !SemaRef.getLangOpts().CPlusPlus) return nullptr; - - // Parentheses (for dumping/debugging purposes only). - Diff = SemaRef.ActOnParenExpr(DefaultLoc, DefaultLoc, Diff.get()); - if (!Diff.isUsable()) + // Upper - Lower + Expr *Upper = TestIsLessOp.getValue() + ? Cnt + : tryBuildCapture(SemaRef, LB, Captures).get(); + Expr *Lower = TestIsLessOp.getValue() + ? tryBuildCapture(SemaRef, LB, Captures).get() + : Cnt; + if (!Upper || !Lower) return nullptr; - ExprResult NewStep = tryBuildCapture(SemaRef, Step, Captures); - if (!NewStep.isUsable()) - return nullptr; - // (Upper - Lower) / Step - Diff = SemaRef.BuildBinOp(S, DefaultLoc, BO_Div, Diff.get(), NewStep.get()); + ExprResult Diff = calculateNumIters(SemaRef, S, DefaultLoc, Lower, Upper, + Step, VarType, /*TestIsStrictOp=*/false, + /*RoundToStep=*/false, Captures); if (!Diff.isUsable()) return nullptr; diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c --- a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c @@ -167,14 +167,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -306,14 +307,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -507,14 +509,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -711,14 +714,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -916,14 +920,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -1123,14 +1128,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -1333,26 +1339,28 @@ // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1558,26 +1566,28 @@ // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1845,26 +1855,28 @@ // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -2135,26 +2147,28 @@ // CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | `-IntegerLiteral {{.*}} <> 'int' 1 diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c --- a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c @@ -167,14 +167,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -306,14 +307,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -507,14 +509,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -711,14 +714,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -916,14 +920,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -1123,14 +1128,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -1333,26 +1339,28 @@ // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1558,26 +1566,28 @@ // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1845,26 +1855,28 @@ // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -2135,26 +2147,28 @@ // CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | `-IntegerLiteral {{.*}} <> 'int' 1 diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute-simd.c b/clang/test/AST/ast-dump-openmp-teams-distribute-simd.c --- a/clang/test/AST/ast-dump-openmp-teams-distribute-simd.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute-simd.c @@ -103,14 +103,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -178,14 +179,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -283,14 +285,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -391,14 +394,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -500,14 +504,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -611,14 +616,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -725,26 +731,28 @@ // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -854,26 +862,28 @@ // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1013,26 +1023,28 @@ // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1175,26 +1187,28 @@ // CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | `-IntegerLiteral {{.*}} <> 'int' 1 diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute.c b/clang/test/AST/ast-dump-openmp-teams-distribute.c --- a/clang/test/AST/ast-dump-openmp-teams-distribute.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute.c @@ -103,14 +103,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -178,14 +179,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -283,14 +285,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -391,14 +394,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -500,14 +504,15 @@ // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -611,14 +616,15 @@ // CHECK-NEXT: | | `-BinaryOperator {{.*}} > 'int' '-' // CHECK-NEXT: | | |-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | |-DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} 'x' 'int' @@ -725,26 +731,28 @@ // CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -854,26 +862,28 @@ // CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1013,26 +1023,28 @@ // CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 @@ -1175,26 +1187,28 @@ // CHECK-NEXT: | | |-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | | `-ImplicitCastExpr {{.*}} 'long' // CHECK-NEXT: | | `-BinaryOperator {{.*}} 'int' '/' // CHECK-NEXT: | | |-ParenExpr {{.*}} 'int' -// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '+' -// CHECK-NEXT: | | | |-BinaryOperator {{.*}} > 'int' '-' -// CHECK-NEXT: | | | | |-BinaryOperator {{.*}} 'int' '-' -// CHECK-NEXT: | | | | | |-ImplicitCastExpr {{.*}} 'int' -// CHECK-NEXT: | | | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' -// CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 -// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} <> 'int' 1 -// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | |-ImplicitCastExpr {{.*}} 'int' +// CHECK-NEXT: | | | | `-DeclRefExpr {{.*}} 'int' lvalue OMPCapturedExpr {{.*}} '.capture_expr.' 'int' +// CHECK-NEXT: | | | `-ParenExpr {{.*}} 'int' +// CHECK-NEXT: | | | `-BinaryOperator {{.*}} > 'int' '+' +// CHECK-NEXT: | | | |-BinaryOperator {{.*}} 'int' '-' +// CHECK-NEXT: | | | | |-IntegerLiteral {{.*}} 'int' 0 +// CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 1 +// CHECK-NEXT: | | | `-IntegerLiteral {{.*}} <> 'int' 1 // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 1 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} <> 'long' // CHECK-NEXT: | `-IntegerLiteral {{.*}} <> 'int' 1 diff --git a/clang/test/OpenMP/for_codegen.cpp b/clang/test/OpenMP/for_codegen.cpp --- a/clang/test/OpenMP/for_codegen.cpp +++ b/clang/test/OpenMP/for_codegen.cpp @@ -80,11 +80,11 @@ // CHECK: store i32 [[J_LB_VAL]], i32* [[J_LB:%.+]], // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]], // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]], - // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]] - // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1 - // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1 - // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1 - // CHECK: [[CAST:%.+]] = sext i32 [[DIV_ST]] to i64 + // CHECK: [[SUB:%.+]] = sub i32 [[J_UB_VAL]], [[J_LB_VAL]] + // CHECK: [[SUB_ST:%.+]] = sub i32 [[SUB]], 1 + // CHECK: [[ADD_ST:%.+]] = add i32 [[SUB_ST]], 1 + // CHECK: [[DIV_ST:%.+]] = udiv i32 [[ADD_ST]], 1 + // CHECK: [[CAST:%.+]] = zext i32 [[DIV_ST]] to i64 // CHECK: [[MUL:%.+]] = mul nsw i64 4, [[CAST]] // CHECK: [[NUM_ITERS_VAL:%.+]] = sub nsw i64 [[MUL]], 1 // CHECK: store i64 [[NUM_ITERS_VAL]], i64* [[NUM_ITERS:%.+]], @@ -122,12 +122,12 @@ // CHECK: [[IV_VAL:%.+]] = load i64, i64* [[IV]], // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]], // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]], - // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]] - // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1 - // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1 - // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1 - // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]] - // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64 + // CHECK: [[SUB:%.+]] = sub i32 [[J_UB_VAL]], [[J_LB_VAL]] + // CHECK: [[SUB_ST:%.+]] = sub i32 [[SUB]], 1 + // CHECK: [[ADD_ST:%.+]] = add i32 [[SUB_ST]], 1 + // CHECK: [[DIV_ST:%.+]] = udiv i32 [[ADD_ST]], 1 + // CHECK: [[MUL:%.+]] = mul i32 1, [[DIV_ST]] + // CHECK: [[CAST:%.+]] = zext i32 [[MUL]] to i64 // CHECK: [[DIV:%.+]] = sdiv i64 [[IV_VAL]], [[CAST]] // CHECK: [[MUL:%.+]] = mul nsw i64 [[DIV]], 1 // CHECK: [[ADD:%.+]] = add nsw i64 0, [[MUL]] @@ -139,21 +139,21 @@ // CHECK: [[IV_VAL1:%.+]] = load i64, i64* [[IV]], // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]], // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]], - // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]] - // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1 - // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1 - // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1 - // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]] - // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64 + // CHECK: [[SUB:%.+]] = sub i32 [[J_UB_VAL]], [[J_LB_VAL]] + // CHECK: [[SUB_ST:%.+]] = sub i32 [[SUB]], 1 + // CHECK: [[ADD_ST:%.+]] = add i32 [[SUB_ST]], 1 + // CHECK: [[DIV_ST:%.+]] = udiv i32 [[ADD_ST]], 1 + // CHECK: [[MUL:%.+]] = mul i32 1, [[DIV_ST]] + // CHECK: [[CAST:%.+]] = zext i32 [[MUL]] to i64 // CHECK: [[DIV:%.+]] = sdiv i64 [[IV_VAL1]], [[CAST]] // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]], // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]], - // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]] - // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1 - // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1 - // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1 - // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]] - // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64 + // CHECK: [[SUB:%.+]] = sub i32 [[J_UB_VAL]], [[J_LB_VAL]] + // CHECK: [[SUB_ST:%.+]] = sub i32 [[SUB]], 1 + // CHECK: [[ADD_ST:%.+]] = add i32 [[SUB_ST]], 1 + // CHECK: [[DIV_ST:%.+]] = udiv i32 [[ADD_ST]], 1 + // CHECK: [[MUL:%.+]] = mul i32 1, [[DIV_ST]] + // CHECK: [[CAST:%.+]] = zext i32 [[MUL]] to i64 // CHECK: [[MUL:%.+]] = mul nsw i64 [[DIV]], [[CAST]] // CHECK: [[SUB:%.+]] = sub nsw i64 [[IV_VAL]], [[MUL]] // CHECK: [[MUL:%.+]] = mul nsw i64 [[SUB:%.+]], 1 diff --git a/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp b/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp --- a/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp +++ b/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp @@ -158,9 +158,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*)) diff --git a/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp b/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp --- a/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp +++ b/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp @@ -154,9 +154,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @{{.+}} to i32 (i32, i8*)*)) diff --git a/clang/test/OpenMP/ordered_doacross_codegen.cpp b/clang/test/OpenMP/ordered_doacross_codegen.cpp --- a/clang/test/OpenMP/ordered_doacross_codegen.cpp +++ b/clang/test/OpenMP/ordered_doacross_codegen.cpp @@ -114,9 +114,9 @@ // CHECK: invoke void [[FOO:.+]]( // CHECK: [[UB_VAL:%.+]] = load i32, i32* [[UB:%.+]], // CHECK-NEXT: [[I_VAL:%.+]] = load i32, i32* [[I:%.+]], -// CHECK-NEXT: sub nsw i32 [[UB_VAL]], [[I_VAL]] -// CHECK-NEXT: sdiv i32 %{{.+}}, 1 -// CHECK-NEXT: sext i32 %{{.+}} to i64 +// CHECK-NEXT: sub i32 [[UB_VAL]], [[I_VAL]] +// CHECK-NEXT: udiv i32 %{{.+}}, 1 +// CHECK-NEXT: zext i32 %{{.+}} to i64 // CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT:%.+]], i64 0, i64 0 // CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP]], // CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT]], i64 0, i64 0 @@ -128,9 +128,9 @@ // CHECK: [[UB_VAL:%.+]] = load i32, i32* [[UB]], // CHECK-NEXT: [[I_VAL:%.+]] = load i32, i32* [[I]], // CHECK-NEXT: [[SUB:%.+]] = sub nsw i32 [[I_VAL]], 2 -// CHECK-NEXT: sub nsw i32 [[UB_VAL]], [[SUB]] -// CHECK-NEXT: sdiv i32 %{{.+}}, 1 -// CHECK-NEXT: sext i32 %{{.+}} to i64 +// CHECK-NEXT: sub i32 [[UB_VAL]], [[SUB]] +// CHECK-NEXT: udiv i32 %{{.+}}, 1 +// CHECK-NEXT: zext i32 %{{.+}} to i64 // CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT:%.+]], i64 0, i64 0 // CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP]], // CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT]], i64 0, i64 0 diff --git a/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp b/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp --- a/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp +++ b/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp @@ -158,9 +158,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*)) diff --git a/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp b/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp --- a/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp +++ b/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp @@ -158,9 +158,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*)) diff --git a/clang/test/OpenMP/taskloop_reduction_codegen.cpp b/clang/test/OpenMP/taskloop_reduction_codegen.cpp --- a/clang/test/OpenMP/taskloop_reduction_codegen.cpp +++ b/clang/test/OpenMP/taskloop_reduction_codegen.cpp @@ -157,9 +157,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*)) diff --git a/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp b/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp --- a/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp +++ b/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp @@ -154,9 +154,7 @@ // CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]], // CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0 -// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1 -// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1 -// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1 +// CHECK: [[DIV:%.*]] = sdiv i32 [[SUB]], 1 // CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1 // CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]], // CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @{{.+}} to i32 (i32, i8*)*)) diff --git a/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c b/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c --- a/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c +++ b/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c @@ -2,8 +2,8 @@ // RUN: %libomp-compile -DMY_SCHEDULE=dynamic && %libomp-run // RUN: %libomp-compile -DMY_SCHEDULE=guided && %libomp-run -// Only works with Intel Compiler since at least version 15.0 -// XFAIL: gcc, clang +// Only works with Intel Compiler since at least version 15.0 and clang since version 11. +// XFAIL: gcc, clang-3, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 /* * Test that large bounds are handled properly and calculations of