diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -7917,6 +7917,12 @@ /// Start location of the kind in source code. SourceLocation KindKwLoc; + /// A modifier for order clause + OpenMPOrderClauseModifier Modifier = OMPC_ORDER_MODIFIER_unknown; + + /// Start location of the modifier in source code. + SourceLocation ModifierKwLoc; + /// Set kind of the clause. /// /// \param K Argument of clause. @@ -7927,6 +7933,16 @@ /// \param KLoc Argument location. void setKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; } + /// Set modifier of the clause. + /// + /// \param M Argument of clause. + void setModifier(OpenMPOrderClauseModifier M) { Modifier = M; } + + /// Set modifier location. + /// + /// \param MLoc Modifier keyword location. + void setModifierKwLoc(SourceLocation MLoc) { ModifierKwLoc = MLoc; } + public: /// Build 'order' clause with argument \p A ('concurrent'). /// @@ -7935,11 +7951,15 @@ /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param EndLoc Ending location of the clause. + /// \param Modifier The modifier applied to 'order' clause. + /// \param MLoc Location of the modifier OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc) + SourceLocation EndLoc, OpenMPOrderClauseModifier M, + SourceLocation MLoc) : OMPClause(llvm::omp::OMPC_order, StartLoc, EndLoc), - LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc) {} + LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(M), + ModifierKwLoc(MLoc) {} /// Build an empty clause. OMPOrderClause() @@ -7957,6 +7977,12 @@ /// Returns location of clause kind. SourceLocation getKindKwLoc() const { return KindKwLoc; } + /// Returns Modifier of the clause. + OpenMPOrderClauseModifier getModifier() const { return Modifier; } + + /// Returns location of clause modifier. + SourceLocation getModifierKwLoc() const { return ModifierKwLoc; } + child_range children() { return child_range(child_iterator(), child_iterator()); } diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10443,6 +10443,10 @@ "a reduction list item with incomplete type %0">; def err_omp_unexpected_clause_value : Error< "expected %0 in OpenMP clause '%1'">; +def err_omp_unexpected_call_to_omp_runtime_api + : Error<"calls to OpenMP runtime API are not allowed within a region that " + "corresponds to a construct with an order clause that specifies " + "concurrent">; def err_omp_expected_var_name_member_expr : Error< "expected variable name%select{| or data member of current class}0">; def err_omp_expected_var_name_member_expr_with_type : Error< @@ -10637,6 +10641,9 @@ "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd, scan, or atomic directive}0">; def err_omp_prohibited_region_atomic : Error< "OpenMP constructs may not be nested inside an atomic region">; +def err_omp_prohibited_region_order + : Error<"construct '%0' not allowed in a region associated with a " + "directive with 'order' clause">; def err_omp_prohibited_region_critical_same_name : Error< "cannot nest 'critical' regions having the same name %0">; def note_omp_previous_critical_region : Note< diff --git a/clang/include/clang/Basic/OpenMPKinds.h b/clang/include/clang/Basic/OpenMPKinds.h --- a/clang/include/clang/Basic/OpenMPKinds.h +++ b/clang/include/clang/Basic/OpenMPKinds.h @@ -167,6 +167,14 @@ OMPC_ORDER_unknown, }; +/// OpenMP modifiers for 'order' clause. +enum OpenMPOrderClauseModifier { + OMPC_ORDER_MODIFIER_unknown = OMPC_ORDER_unknown, +#define OPENMP_ORDER_MODIFIER(Name) OMPC_ORDER_MODIFIER_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_ORDER_MODIFIER_last +}; + /// Scheduling data for loop-based OpenMP directives. struct OpenMPScheduleTy final { OpenMPScheduleClauseKind Schedule = OMPC_SCHEDULE_unknown; @@ -334,6 +342,13 @@ void getOpenMPCaptureRegions( llvm::SmallVectorImpl &CaptureRegions, OpenMPDirectiveKind DKind); + +/// Checks if the specified directive is a combined construct for which +/// the first construct is a parallel construct. +/// \param DKind Specified directive. +/// \return true - if the above condition is met for this directive +/// otherwise - false. +bool isOpenMPCombinedParallelADirective(OpenMPDirectiveKind DKind); } #endif diff --git a/clang/include/clang/Basic/OpenMPKinds.def b/clang/include/clang/Basic/OpenMPKinds.def --- a/clang/include/clang/Basic/OpenMPKinds.def +++ b/clang/include/clang/Basic/OpenMPKinds.def @@ -59,6 +59,9 @@ #ifndef OPENMP_ORDER_KIND #define OPENMP_ORDER_KIND(Name) #endif +#ifndef OPENMP_ORDER_MODIFIER +#define OPENMP_ORDER_MODIFIER(Name) +#endif #ifndef OPENMP_DEVICE_MODIFIER #define OPENMP_DEVICE_MODIFIER(Name) #endif @@ -173,6 +176,10 @@ // Type of the 'order' clause. OPENMP_ORDER_KIND(concurrent) +// Modifiers for the 'order' clause. +OPENMP_ORDER_MODIFIER(reproducible) +OPENMP_ORDER_MODIFIER(unconstrained) + // Modifiers for 'reduction' clause. OPENMP_REDUCTION_MODIFIER(default) OPENMP_REDUCTION_MODIFIER(inscan) @@ -200,6 +207,7 @@ #undef OPENMP_REDUCTION_MODIFIER #undef OPENMP_DEVICE_MODIFIER #undef OPENMP_ORDER_KIND +#undef OPENMP_ORDER_MODIFIER #undef OPENMP_LASTPRIVATE_KIND #undef OPENMP_DEVICE_TYPE_KIND #undef OPENMP_LINEAR_KIND diff --git a/clang/include/clang/Sema/Scope.h b/clang/include/clang/Sema/Scope.h --- a/clang/include/clang/Sema/Scope.h +++ b/clang/include/clang/Sema/Scope.h @@ -140,6 +140,10 @@ /// parsed. If such a scope is a ContinueScope, it's invalid to jump to the /// continue block from here. ConditionVarScope = 0x2000000, + + /// This is a scope of some OpenMP directive with + /// order clause which specifies concurrent + OpenMPOrderClauseScope = 0x4000000, }; private: @@ -488,6 +492,12 @@ return P && P->isOpenMPLoopDirectiveScope(); } + /// Determine whether this scope is some OpenMP directive with + /// order clause which specifies concurrent scope. + bool isOpenMPOrderClauseScope() const { + return getFlags() & Scope::OpenMPOrderClauseScope; + } + /// Determine whether this scope is a while/do/for statement, which can have /// continue statements embedded into it. bool isContinueScope() const { diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -11724,10 +11724,11 @@ SourceLocation LParenLoc, SourceLocation EndLoc); /// Called on well-formed 'order' clause. - OMPClause *ActOnOpenMPOrderClause(OpenMPOrderClauseKind Kind, - SourceLocation KindLoc, + OMPClause *ActOnOpenMPOrderClause(OpenMPOrderClauseModifier Modifier, + OpenMPOrderClauseKind Kind, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation MLoc, SourceLocation KindLoc, SourceLocation EndLoc); /// Called on well-formed 'update' clause. OMPClause *ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind, diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -2370,8 +2370,12 @@ } void OMPClausePrinter::VisitOMPOrderClause(OMPOrderClause *Node) { - OS << "order(" << getOpenMPSimpleClauseTypeName(OMPC_order, Node->getKind()) - << ")"; + OS << "order("; + if (Node->getModifier() != OMPC_ORDER_MODIFIER_unknown) { + OS << getOpenMPSimpleClauseTypeName(OMPC_order, Node->getModifier()); + OS << ": "; + } + OS << getOpenMPSimpleClauseTypeName(OMPC_order, Node->getKind()) << ")"; } void OMPClausePrinter::VisitOMPInclusiveClause(OMPInclusiveClause *Node) { diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp --- a/clang/lib/Basic/OpenMPKinds.cpp +++ b/clang/lib/Basic/OpenMPKinds.cpp @@ -120,8 +120,11 @@ #include "clang/Basic/OpenMPKinds.def" .Default(OMPC_LASTPRIVATE_unknown); case OMPC_order: - return llvm::StringSwitch(Str) -#define OPENMP_ORDER_KIND(Name) .Case(#Name, OMPC_ORDER_##Name) + return llvm::StringSwitch(Str) +#define OPENMP_ORDER_KIND(Name) \ + .Case(#Name, static_cast(OMPC_ORDER_##Name)) +#define OPENMP_ORDER_MODIFIER(Name) \ + .Case(#Name, static_cast(OMPC_ORDER_MODIFIER_##Name)) #include "clang/Basic/OpenMPKinds.def" .Default(OMPC_ORDER_unknown); case OMPC_update: @@ -395,10 +398,14 @@ case OMPC_order: switch (Type) { case OMPC_ORDER_unknown: + case OMPC_ORDER_MODIFIER_last: return "unknown"; #define OPENMP_ORDER_KIND(Name) \ - case OMPC_ORDER_##Name: \ - return #Name; + case OMPC_ORDER_##Name: \ + return #Name; +#define OPENMP_ORDER_MODIFIER(Name) \ + case OMPC_ORDER_MODIFIER_##Name: \ + return #Name; #include "clang/Basic/OpenMPKinds.def" } llvm_unreachable("Invalid OpenMP 'order' clause type"); @@ -714,6 +721,14 @@ return DKind == OMPD_tile || DKind == OMPD_unroll; } +bool clang::isOpenMPCombinedParallelADirective(OpenMPDirectiveKind DKind) { + return DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd || + DKind == OMPD_parallel_master || + DKind == OMPD_parallel_master_taskloop || + DKind == OMPD_parallel_master_taskloop_simd || + DKind == OMPD_parallel_sections; +} + void clang::getOpenMPCaptureRegions( SmallVectorImpl &CaptureRegions, OpenMPDirectiveKind DKind) { diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -3240,7 +3240,6 @@ case OMPC_atomic_default_mem_order: case OMPC_at: case OMPC_severity: - case OMPC_order: case OMPC_bind: // OpenMP [2.14.3.1, Restrictions] // Only a single default clause may be specified on a parallel, task or @@ -3255,7 +3254,7 @@ // At most one severity clause can appear on the directive // OpenMP 5.1, 2.11.7 loop Construct, Restrictions. // At most one bind clause can appear on a loop directive. - if (!FirstClause && CKind != OMPC_order) { + if (!FirstClause) { Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind) << getOpenMPClauseName(CKind) << 0; ErrorFound = true; @@ -3267,14 +3266,17 @@ case OMPC_schedule: case OMPC_dist_schedule: case OMPC_defaultmap: + case OMPC_order: // OpenMP [2.7.1, Restrictions, p. 3] // Only one schedule clause can appear on a loop directive. // OpenMP 4.5 [2.10.4, Restrictions, p. 106] // At most one defaultmap clause can appear on the directive. // OpenMP 5.0 [2.12.5, target construct, Restrictions] // At most one device clause can appear on the directive. + // OpenMP 5.1 [2.11.3, order clause, Restrictions] + // At most one order clause may appear on a construct. if ((getLangOpts().OpenMP < 50 || CKind != OMPC_defaultmap) && - !FirstClause) { + (CKind != OMPC_order || getLangOpts().OpenMP >= 51) && !FirstClause) { Diag(Tok, diag::err_omp_more_one_clause) << getOpenMPDirectiveName(DKind) << getOpenMPClauseName(CKind) << 0; ErrorFound = true; @@ -3862,6 +3864,34 @@ Arg.push_back(OMPC_DEFAULTMAP_unknown); KLoc.push_back(SourceLocation()); } + } else if (Kind == OMPC_order) { + enum { Modifier, OrderKind, NumberOfElements }; + Arg.resize(NumberOfElements); + KLoc.resize(NumberOfElements); + Arg[Modifier] = OMPC_ORDER_MODIFIER_unknown; + Arg[OrderKind] = OMPC_ORDER_unknown; + unsigned KindModifier = getOpenMPSimpleClauseType( + Kind, Tok.isAnnotation() ? "" : PP.getSpelling(Tok), getLangOpts()); + if (KindModifier > OMPC_ORDER_unknown) { + // Parse 'modifier' + Arg[Modifier] = KindModifier; + KLoc[Modifier] = Tok.getLocation(); + if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::comma) && + Tok.isNot(tok::annot_pragma_openmp_end)) + ConsumeAnyToken(); + // Parse ':' + if (Tok.is(tok::colon)) + ConsumeAnyToken(); + else + Diag(Tok, diag::warn_pragma_expected_colon) << "order modifier"; + KindModifier = getOpenMPSimpleClauseType( + Kind, Tok.isAnnotation() ? "" : PP.getSpelling(Tok), getLangOpts()); + } + Arg[OrderKind] = KindModifier; + KLoc[OrderKind] = Tok.getLocation(); + if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::comma) && + Tok.isNot(tok::annot_pragma_openmp_end)) + ConsumeAnyToken(); } else if (Kind == OMPC_device) { // Only target executable directives support extended device construct. if (isOpenMPTargetExecutionDirective(DKind) && getLangOpts().OpenMP >= 50 && diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp --- a/clang/lib/Sema/Scope.cpp +++ b/clang/lib/Sema/Scope.cpp @@ -43,6 +43,9 @@ FunctionPrototypeScope | AtCatchScope | ObjCMethodScope)) == 0) Flags |= parent->getFlags() & OpenMPSimdDirectiveScope; + // transmit the parent's 'order' flag, if exists + if (parent->getFlags() & OpenMPOrderClauseScope) + Flags |= OpenMPOrderClauseScope; } else { Depth = 0; PrototypeDepth = 0; 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 @@ -173,6 +173,7 @@ /// 'ordered' clause, the second one is true if the regions has 'ordered' /// clause, false otherwise. llvm::Optional> OrderedRegion; + bool RegionHasOrderConcurrent = false; unsigned AssociatedLoops = 1; bool HasMutipleLoops = false; const Decl *PossiblyLoopCounter = nullptr; @@ -865,6 +866,17 @@ return Parent->OrderedRegion.value(); return std::make_pair(nullptr, nullptr); } + /// Marks current region as having an 'order' clause. + void setRegionHasOrderConcurrent(bool HasOrderConcurrent) { + getTopOfStack().RegionHasOrderConcurrent = HasOrderConcurrent; + } + /// Returns true, if parent region is order (has associated + /// 'order' clause), false - otherwise. + bool isParentOrderConcurrent() const { + if (const SharingMapTy *Parent = getSecondOnStackOrNull()) + return Parent->RegionHasOrderConcurrent; + return false; + } /// Marks current region as nowait (it has a 'nowait' clause). void setNowaitRegion(bool IsNowait = true) { getTopOfStack().NowaitRegion = IsNowait; @@ -4943,6 +4955,14 @@ ShouldBeInTeamsRegion, ShouldBeInLoopSimdRegion, } Recommend = NoRecommend; + if (SemaRef.LangOpts.OpenMP >= 51 && Stack->isParentOrderConcurrent() && + CurrentRegion != OMPD_simd && CurrentRegion != OMPD_loop && + CurrentRegion != OMPD_parallel && + !isOpenMPCombinedParallelADirective(CurrentRegion)) { + SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region_order) + << getOpenMPDirectiveName(CurrentRegion); + return true; + } if (isOpenMPSimdDirective(ParentRegion) && ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) || (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered && @@ -7195,6 +7215,13 @@ if (!CalleeFnDecl) return Call; + if (LangOpts.OpenMP >= 51 && CalleeFnDecl->getIdentifier() && + CalleeFnDecl->getName().startswith_insensitive("omp_")) { + // checking for any calls inside an Order region + if (Scope->isOpenMPOrderClauseScope()) + Diag(LParenLoc, diag::err_omp_unexpected_call_to_omp_runtime_api); + } + if (!CalleeFnDecl->hasAttr()) return Call; @@ -16518,10 +16545,6 @@ static_cast(Argument), ArgumentLoc, StartLoc, LParenLoc, EndLoc); break; - case OMPC_order: - Res = ActOnOpenMPOrderClause(static_cast(Argument), - ArgumentLoc, StartLoc, LParenLoc, EndLoc); - break; case OMPC_update: Res = ActOnOpenMPUpdateClause(static_cast(Argument), ArgumentLoc, StartLoc, LParenLoc, EndLoc); @@ -16762,22 +16785,43 @@ return new (Context) OMPMessageClause(ME, StartLoc, LParenLoc, EndLoc); } -OMPClause *Sema::ActOnOpenMPOrderClause(OpenMPOrderClauseKind Kind, - SourceLocation KindKwLoc, - SourceLocation StartLoc, - SourceLocation LParenLoc, - SourceLocation EndLoc) { - if (Kind == OMPC_ORDER_unknown) { +OMPClause *Sema::ActOnOpenMPOrderClause( + OpenMPOrderClauseModifier Modifier, OpenMPOrderClauseKind Kind, + SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation MLoc, + SourceLocation KindLoc, SourceLocation EndLoc) { + if (Kind != OMPC_ORDER_concurrent || + (LangOpts.OpenMP < 51 && MLoc.isValid())) { + // Kind should be concurrent, + // Modifiers introduced in OpenMP 5.1 static_assert(OMPC_ORDER_unknown > 0, "OMPC_ORDER_unknown not greater than 0"); - Diag(KindKwLoc, diag::err_omp_unexpected_clause_value) - << getListOfPossibleValues(OMPC_order, /*First=*/0, + + Diag(KindLoc, diag::err_omp_unexpected_clause_value) + << getListOfPossibleValues(OMPC_order, + /*First=*/0, /*Last=*/OMPC_ORDER_unknown) << getOpenMPClauseName(OMPC_order); return nullptr; } - return new (Context) - OMPOrderClause(Kind, KindKwLoc, StartLoc, LParenLoc, EndLoc); + if (LangOpts.OpenMP >= 51) { + if (Modifier == OMPC_ORDER_MODIFIER_unknown && MLoc.isValid()) { + Diag(MLoc, diag::err_omp_unexpected_clause_value) + << getListOfPossibleValues(OMPC_order, + /*First=*/OMPC_ORDER_MODIFIER_unknown + 1, + /*Last=*/OMPC_ORDER_MODIFIER_last) + << getOpenMPClauseName(OMPC_order); + } else { + DSAStack->setRegionHasOrderConcurrent(/*HasOrderConcurrent=*/true); + if (DSAStack->getCurScope()) { + // mark the current scope with 'order' flag + unsigned existingFlags = DSAStack->getCurScope()->getFlags(); + DSAStack->getCurScope()->setFlags(existingFlags | + Scope::OpenMPOrderClauseScope); + } + } + } + return new (Context) OMPOrderClause(Kind, KindLoc, StartLoc, LParenLoc, + EndLoc, Modifier, MLoc); } OMPClause *Sema::ActOnOpenMPUpdateClause(OpenMPDependClauseKind Kind, @@ -16889,6 +16933,13 @@ StartLoc, LParenLoc, ArgumentLoc[Modifier], ArgumentLoc[DefaultmapKind], EndLoc); break; + case OMPC_order: + enum { OrderModifier, OrderKind }; + Res = ActOnOpenMPOrderClause( + static_cast(Argument[OrderModifier]), + static_cast(Argument[OrderKind]), StartLoc, + LParenLoc, ArgumentLoc[OrderModifier], ArgumentLoc[OrderKind], EndLoc); + break; case OMPC_device: assert(Argument.size() == 1 && ArgumentLoc.size() == 1); Res = ActOnOpenMPDeviceClause( @@ -16972,7 +17023,6 @@ case OMPC_device_type: case OMPC_match: case OMPC_nontemporal: - case OMPC_order: case OMPC_at: case OMPC_severity: case OMPC_message: diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -2253,13 +2253,12 @@ /// /// By default, performs semantic analysis to build the new OpenMP clause. /// Subclasses may override this routine to provide different behavior. - OMPClause *RebuildOMPOrderClause(OpenMPOrderClauseKind Kind, - SourceLocation KindKwLoc, - SourceLocation StartLoc, - SourceLocation LParenLoc, - SourceLocation EndLoc) { - return getSema().ActOnOpenMPOrderClause(Kind, KindKwLoc, StartLoc, - LParenLoc, EndLoc); + OMPClause *RebuildOMPOrderClause( + OpenMPOrderClauseKind Kind, SourceLocation KindKwLoc, + SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, + OpenMPOrderClauseModifier Modifier, SourceLocation ModifierKwLoc) { + return getSema().ActOnOpenMPOrderClause(Modifier, Kind, StartLoc, LParenLoc, + ModifierKwLoc, KindKwLoc, EndLoc); } /// Build a new OpenMP 'init' clause. @@ -10611,9 +10610,9 @@ template OMPClause *TreeTransform::TransformOMPOrderClause(OMPOrderClause *C) { - return getDerived().RebuildOMPOrderClause(C->getKind(), C->getKindKwLoc(), - C->getBeginLoc(), C->getLParenLoc(), - C->getEndLoc()); + return getDerived().RebuildOMPOrderClause( + C->getKind(), C->getKindKwLoc(), C->getBeginLoc(), C->getLParenLoc(), + C->getEndLoc(), C->getModifier(), C->getModifierKwLoc()); } template diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -11251,8 +11251,10 @@ void OMPClauseReader::VisitOMPOrderClause(OMPOrderClause *C) { C->setKind(Record.readEnum()); + C->setModifier(Record.readEnum()); C->setLParenLoc(Record.readSourceLocation()); C->setKindKwLoc(Record.readSourceLocation()); + C->setModifierKwLoc(Record.readSourceLocation()); } void OMPClauseReader::VisitOMPFilterClause(OMPFilterClause *C) { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -7082,8 +7082,10 @@ void OMPClauseWriter::VisitOMPOrderClause(OMPOrderClause *C) { Record.writeEnum(C->getKind()); + Record.writeEnum(C->getModifier()); Record.AddSourceLocation(C->getLParenLoc()); Record.AddSourceLocation(C->getKindKwLoc()); + Record.AddSourceLocation(C->getModifierKwLoc()); } void OMPClauseWriter::VisitOMPUsesAllocatorsClause(OMPUsesAllocatorsClause *C) { diff --git a/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp b/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp --- a/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -std=c++11 -fopenmp -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -std=c++11 -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -std=c++11 -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -std=c++11 -fopenmp-simd -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -std=c++11 -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -162,13 +168,16 @@ #pragma omp threadprivate(g) #pragma omp target #pragma omp teams -#ifdef OMP5 +#ifdef OMP51 +#pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) order(reproducible:concurrent) reduction(task,+:c) +#elif OMP5 #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) order(concurrent) reduction(task,+:c) #else #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) #endif // OMP5 - // OMP45: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) + // OMP51: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) order(reproducible: concurrent) reduction(task, +: c) // OMP50: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) order(concurrent) reduction(task, +: c) + // OMP45: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/clang/test/OpenMP/distribute_parallel_for_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_messages.cpp --- a/clang/test/OpenMP/distribute_parallel_for_messages.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -ferror-limit 100 -std=c++11 -o - %s -fopenmp-version=45 -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -fopenmp-version=45 -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized void foo() { } @@ -20,10 +22,10 @@ #pragma omp distribute parallel for order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < argc; ++i) foo(); -#pragma omp distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < argc; ++i) foo(); -#pragma omp distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < argc; ++i) foo(); #pragma omp distribute parallel for order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -32,6 +34,21 @@ #pragma omp distribute parallel for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} for (int i = 0; i < argc; ++i) foo(); +#pragma omp distribute parallel for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < argc; ++i) + foo(); +#pragma omp distribute parallel for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < argc; ++i) + foo(); +#pragma omp distribute parallel for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < argc; ++i) + foo(); +#pragma omp distribute parallel for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < argc; ++i) + foo(); +#pragma omp distribute parallel for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for'}} omp51-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'order' clause}} + for (int i = 0; i < argc; ++i) + foo(); #pragma omp target #pragma omp teams #pragma omp distribute parallel for { // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}} diff --git a/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp --- a/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // expected-no-diagnostics #ifndef HEADER @@ -149,16 +155,19 @@ int i; #pragma omp target #pragma omp teams -#ifdef OMP5 +#ifdef OMP51 +#pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc, c, d) order(unconstrained:concurrent) +#elif OMP5 #pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc, c, d) order(concurrent) #else #pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) -#endif // OMP5 +#endif // OMP51 for (i = 0; i < 100; i++) for (int j = 0; j < 200; j++) a += h + x[j]; // OMP45: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) // OMP50: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc,c,d) order(concurrent) + // OMP51: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc,c,d) order(unconstrained: concurrent) // CHECK-NEXT: for (i = 0; i < 100; i++) // CHECK-NEXT: for (int j = 0; j < 200; j++) // CHECK-NEXT: a += h + x[j]; diff --git a/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c b/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c --- a/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c +++ b/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -922,7 +924,7 @@ #pragma omp distribute parallel for simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp distribute parallel for simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -952,8 +954,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp distribute parallel for simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -985,10 +988,10 @@ #pragma omp distribute parallel for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp distribute parallel for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -997,5 +1000,20 @@ #pragma omp distribute parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp distribute parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute parallel for simd'}} omp51-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/distribute_simd_ast_print.cpp b/clang/test/OpenMP/distribute_simd_ast_print.cpp --- a/clang/test/OpenMP/distribute_simd_ast_print.cpp +++ b/clang/test/OpenMP/distribute_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -140,6 +146,7 @@ a++; // OMP45: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b) // OMP50: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b) if(simd: argc) +// OMP51: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: a++; @@ -147,16 +154,19 @@ int i; #pragma omp target #pragma omp teams -#ifdef OMP5 +#ifdef OMP51 +#pragma omp distribute simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(argc) nontemporal(argc, c, d) order(reproducible:concurrent) +#elif OMP5 #pragma omp distribute simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(argc) nontemporal(argc, c, d) order(concurrent) #else #pragma omp distribute simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) -#endif // OMP5 +#endif // OMP51 for (i = 0; i < 100; i++) for (int j = 0; j < 200; j++) a += h + x[j]; // OMP45: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) // OMP50: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(argc) nontemporal(argc,c,d) order(concurrent) +// OMP51: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(argc) nontemporal(argc,c,d) order(reproducible: concurrent) // CHECK-NEXT: for (i = 0; i < 100; i++) // CHECK-NEXT: for (int j = 0; j < 200; j++) // CHECK-NEXT: a += h + x[j]; diff --git a/clang/test/OpenMP/distribute_simd_misc_messages.c b/clang/test/OpenMP/distribute_simd_misc_messages.c --- a/clang/test/OpenMP/distribute_simd_misc_messages.c +++ b/clang/test/OpenMP/distribute_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -1056,7 +1058,7 @@ #pragma omp distribute simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp distribute simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -1086,8 +1088,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp distribute simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -1119,10 +1122,10 @@ #pragma omp distribute simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp distribute simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -1131,5 +1134,20 @@ #pragma omp distribute simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp distribute simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp distribute simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp distribute simd'}} omp51-error {{directive '#pragma omp distribute simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/for_ast_print.cpp b/clang/test/OpenMP/for_ast_print.cpp --- a/clang/test/OpenMP/for_ast_print.cpp +++ b/clang/test/OpenMP/for_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wsign-conversion | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wsign-conversion -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wsign-conversion | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wsign-conversion -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -221,8 +227,13 @@ float arr[20]; static int a; // CHECK: static int a; +#ifdef OMP51 +#pragma omp for schedule(guided, argc) reduction(+:argv[0][:1]) order(unconstrained:concurrent) +#else #pragma omp for schedule(guided, argc) reduction(+:argv[0][:1]) order(concurrent) - // CHECK-NEXT: #pragma omp for schedule(guided, argc) reduction(+: argv[0][:1]) order(concurrent) +#endif // OMP51 + // OMP50: #pragma omp for schedule(guided, argc) reduction(+: argv[0][:1]) order(concurrent) + // OMP51: #pragma omp for schedule(guided, argc) reduction(+: argv[0][:1]) order(unconstrained: concurrent) for (int i = argc; i < c; ++i) a = 2; // CHECK-NEXT: for (int i = argc; i < c; ++i) diff --git a/clang/test/OpenMP/for_misc_messages.c b/clang/test/OpenMP/for_misc_messages.c --- a/clang/test/OpenMP/for_misc_messages.c +++ b/clang/test/OpenMP/for_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -triple x86_64-unknown-unknown -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -triple x86_64-unknown-unknown -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -402,16 +404,34 @@ #pragma omp for order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp for order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 0; i < 10; ++i) ; -#pragma omp for ordered order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp50-error {{'order' clause with 'concurrent' modifier cannot be specified if an 'ordered' clause is specified}} omp50-note {{'ordered' clause}} +#pragma omp for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for ordered order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp50-error {{'order' clause with 'concurrent' modifier cannot be specified if an 'ordered' clause is specified}} omp50-note {{'ordered' clause}} omp51-error {{'order' clause with 'concurrent' modifier cannot be specified if an 'ordered' clause is specified}} omp51-note {{'ordered' clause}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for'}} omp51-error {{directive '#pragma omp for' cannot contain more than one 'order' clause}} for (int i = 0; i < 10; ++i) ; } diff --git a/clang/test/OpenMP/for_order_messages.cpp b/clang/test/OpenMP/for_order_messages.cpp new file mode 100644 --- /dev/null +++ b/clang/test/OpenMP/for_order_messages.cpp @@ -0,0 +1,47 @@ +// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized + +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized + +extern int omp_get_num_threads (void); + +int main(int argc, char **argv) { + int A = 0; +#pragma omp parallel for order(concurrent) + for (int i = 0; i < 10; ++i) + omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}} + +#pragma omp parallel for order(reproducible:concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}} + +#pragma omp parallel for order(unconstrained:concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}} + +#pragma omp parallel for order(concurrent) + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 10; ++j) { + omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}} + } + } + +#pragma omp parallel for order(concurrent) + for (int i = 0; i < 10; ++i) { +#pragma omp atomic //omp51-error {{construct 'atomic' not allowed in a region associated with a directive with 'order' clause}} + A++; + } + +#pragma omp parallel for order(reproducible: concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) { +#pragma omp target //omp51-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}} + A++; + } + +#pragma omp parallel for order(unconstrained: concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) { +#pragma omp target //omp51-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}} + A++; + } +} diff --git a/clang/test/OpenMP/for_simd_ast_print.cpp b/clang/test/OpenMP/for_simd_ast_print.cpp --- a/clang/test/OpenMP/for_simd_ast_print.cpp +++ b/clang/test/OpenMP/for_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -96,11 +102,14 @@ // CHECK: T res; // CHECK: T val; // CHECK: T lin = 0; -#ifdef OMP5 +#ifdef OMP51 + #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res, val, lin) order(reproducible:concurrent) +#elif OMP5 #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res, val, lin) order(concurrent) #else #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res) -#endif +#endif // OMP51 +// OMP51-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res,val,lin) order(reproducible: concurrent) // OMP50-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res,val,lin) order(concurrent) // OMP45-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) allocate(res) for (T i = 7; i < m_a; ++i) { @@ -185,6 +194,7 @@ #else #pragma omp for simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN) #endif +// OMP51-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) // OMP50-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) if(simd: a) // OMP45-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) for (int i = 0; i < 10; ++i)foo(); diff --git a/clang/test/OpenMP/for_simd_misc_messages.c b/clang/test/OpenMP/for_simd_misc_messages.c --- a/clang/test/OpenMP/for_simd_misc_messages.c +++ b/clang/test/OpenMP/for_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -verify %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp50 -verify %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 -verify %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -787,7 +789,7 @@ #pragma omp for simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp for simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -817,8 +819,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp for simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -852,10 +855,10 @@ #pragma omp for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -864,5 +867,20 @@ #pragma omp for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp for simd'}} omp51-error {{directive '#pragma omp for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp b/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp --- a/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp +++ b/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // expected-no-diagnostics #ifndef HEADER @@ -75,16 +81,19 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#ifdef OMP5 +#ifdef OMP51 +#pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(unconstrained:concurrent) +#elif OMP5 #pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(concurrent) #else #pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK-NEXT: #pragma omp parallel // OMP50-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(concurrent) + // OMP51-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(unconstrained: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/parallel_for_ast_print.cpp b/clang/test/OpenMP/parallel_for_ast_print.cpp --- a/clang/test/OpenMP/parallel_for_ast_print.cpp +++ b/clang/test/OpenMP/parallel_for_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -70,8 +76,13 @@ // CHECK: static T a; static T g; #pragma omp threadprivate(g) +#ifdef OMP51 +#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d, e,f) order(reproducible:concurrent) +#else #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d, e,f) order(concurrent) - // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d,e,f) order(concurrent) +#endif // OMP51 + // OMP50: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d,e,f) order(concurrent) + // OMP51: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d,e,f) order(reproducible: concurrent) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/clang/test/OpenMP/parallel_for_messages.cpp b/clang/test/OpenMP/parallel_for_messages.cpp --- a/clang/test/OpenMP/parallel_for_messages.cpp +++ b/clang/test/OpenMP/parallel_for_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -96,10 +98,10 @@ #pragma omp parallel for order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp parallel for order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -108,5 +110,20 @@ #pragma omp parallel for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} for (int i = 0; i < 10; ++i) ; +#pragma omp parallel for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for'}} omp51-error {{directive '#pragma omp parallel for' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/parallel_for_simd_ast_print.cpp --- a/clang/test/OpenMP/parallel_for_simd_ast_print.cpp +++ b/clang/test/OpenMP/parallel_for_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -DOMP5 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -DOMP5 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -154,11 +160,14 @@ int k1=0,k2=0; static int *a; // CHECK: static int *a; -#ifdef OMP5 +#ifdef OMP51 +#pragma omp parallel for simd if(parallel :b) if(simd: b) nontemporal(argc, c) lastprivate(conditional:d,f) order(unconstrained:concurrent) +#elif OMP5 #pragma omp parallel for simd if(parallel :b) if(simd: b) nontemporal(argc, c) lastprivate(conditional:d,f) order(concurrent) #else #pragma omp parallel for simd if(parallel :b) ordered -#endif // OMP5 +#endif // OMP51 +// OMP51-NEXT: #pragma omp parallel for simd if(parallel: b) if(simd: b) nontemporal(argc,c) lastprivate(conditional: d,f) order(unconstrained: concurrent) // OMP50-NEXT: #pragma omp parallel for simd if(parallel: b) if(simd: b) nontemporal(argc,c) lastprivate(conditional: d,f) order(concurrent) // OMP45-NEXT: #pragma omp parallel for simd if(parallel: b) ordered for (int i=0; i < 2; ++i)*a=2; diff --git a/clang/test/OpenMP/parallel_for_simd_misc_messages.c b/clang/test/OpenMP/parallel_for_simd_misc_messages.c --- a/clang/test/OpenMP/parallel_for_simd_misc_messages.c +++ b/clang/test/OpenMP/parallel_for_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for simd'}} #pragma omp parallel for simd @@ -778,7 +780,7 @@ #pragma omp parallel for simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp parallel for simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -808,8 +810,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp parallel for simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -841,10 +844,10 @@ #pragma omp parallel for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp parallel for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -853,5 +856,20 @@ #pragma omp parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp parallel for simd'}} omp51-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp b/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp --- a/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp +++ b/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp @@ -1,16 +1,16 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // expected-no-diagnostics #ifndef HEADER @@ -74,16 +74,19 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#ifdef OMP5 +#ifdef OMP51 +#pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(reproducible:concurrent) +#elif OMP5 #pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(concurrent) #else #pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK-NEXT: #pragma omp parallel // OMP50-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(concurrent) + // OMP51-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(reproducible: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/simd_ast_print.cpp b/clang/test/OpenMP/simd_ast_print.cpp --- a/clang/test/OpenMP/simd_ast_print.cpp +++ b/clang/test/OpenMP/simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -163,13 +169,16 @@ for (int i=0; i < 2; ++i)*a=2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: *a = 2; -#ifdef OMP5 +#ifdef OMP51 +#pragma omp simd private(argc, b),lastprivate(d,f) collapse(2) aligned(a : 4) if(simd:a) nontemporal(argc, c, d) lastprivate(conditional: e, f) order(unconstrained:concurrent) +// OMP51-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4) if(simd: a) nontemporal(argc,c,d) lastprivate(conditional: e,f) order(unconstrained: concurrent) +#elif OMP5 #pragma omp simd private(argc, b),lastprivate(d,f) collapse(2) aligned(a : 4) if(simd:a) nontemporal(argc, c, d) lastprivate(conditional: e, f) order(concurrent) // OMP50-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4) if(simd: a) nontemporal(argc,c,d) lastprivate(conditional: e,f) order(concurrent) #else #pragma omp simd private(argc, b),lastprivate(d,f) collapse(2) aligned(a : 4) // OMP45-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) {foo(); k1 += 8; k2 += 8;} // CHECK-NEXT: for (int i = 0; i < 10; ++i) @@ -189,6 +198,7 @@ #else #pragma omp simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN) linear(val(ref): CLEN) // OMP45-NEXT: #pragma omp simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) linear(val(ref): CLEN) +// OMP51-NEXT: #pragma omp simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) linear(val(ref): CLEN) #endif // OMP5 for (int i = 0; i < 10; ++i)foo(); // CHECK-NEXT: for (int i = 0; i < 10; ++i) diff --git a/clang/test/OpenMP/simd_misc_messages.c b/clang/test/OpenMP/simd_misc_messages.c --- a/clang/test/OpenMP/simd_misc_messages.c +++ b/clang/test/OpenMP/simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -828,7 +830,7 @@ #pragma omp simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -858,8 +860,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -891,10 +894,10 @@ #pragma omp simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -903,5 +906,20 @@ #pragma omp simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp simd'}} omp51-error {{directive '#pragma omp simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_parallel_for_ast_print.cpp b/clang/test/OpenMP/target_parallel_for_ast_print.cpp --- a/clang/test/OpenMP/target_parallel_for_ast_print.cpp +++ b/clang/test/OpenMP/target_parallel_for_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -84,8 +90,13 @@ // CHECK: static T a; static T g; #pragma omp threadprivate(g) +#ifdef OMP51 +#pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) order(reproducible:concurrent) +#else #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) order(concurrent) - // CHECK: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) order(concurrent) +#endif // OMP51 + // OMP51: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) order(reproducible: concurrent) + // OMP50: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) order(concurrent) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/clang/test/OpenMP/target_parallel_for_messages.cpp b/clang/test/OpenMP/target_parallel_for_messages.cpp --- a/clang/test/OpenMP/target_parallel_for_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -fopenmp-version=51 -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -102,10 +104,10 @@ #pragma omp target parallel for order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target parallel for order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -114,5 +116,20 @@ #pragma omp target parallel for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target parallel for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for'}} omp51-error {{directive '#pragma omp target parallel for' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp --- a/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP5 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP5 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -125,14 +131,17 @@ // CHECK-NEXT: for (T i = 0; i < 2; ++i) { // CHECK-NEXT: } -#ifdef OMP5 +#ifdef OMP51 +#pragma omp target parallel for simd if(target:argc > 0) if (simd: argc) nontemporal(argc, c, d) order(unconstrained:concurrent) allocate(omp_high_bw_mem_alloc:f) private(f) uses_allocators(omp_high_bw_mem_alloc) +#elif OMP5 #pragma omp target parallel for simd if(target:argc > 0) if (simd: argc) nontemporal(argc, c, d) order(concurrent) allocate(omp_high_bw_mem_alloc:f) private(f) uses_allocators(omp_high_bw_mem_alloc) #else #pragma omp target parallel for simd if(target:argc > 0) -#endif // OMP5 +#endif // OMP51 for (T i = 0; i < 2; ++i) {} // OMP45: #pragma omp target parallel for simd if(target: argc > 0) // OMP50: #pragma omp target parallel for simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d) order(concurrent) allocate(omp_high_bw_mem_alloc: f) private(f) uses_allocators(omp_high_bw_mem_alloc) + // OMP51: #pragma omp target parallel for simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d) order(unconstrained: concurrent) allocate(omp_high_bw_mem_alloc: f) private(f) uses_allocators(omp_high_bw_mem_alloc) // CHECK-NEXT: for (T i = 0; i < 2; ++i) { // CHECK-NEXT: } @@ -256,14 +265,17 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) { // CHECK-NEXT: } -#ifdef OMP5 +#ifdef OMP51 +#pragma omp target parallel for simd if (parallel:argc > 0) +#elif OMP5 #pragma omp target parallel for simd if (parallel:argc > 0) if(simd: argc) #else #pragma omp target parallel for simd if (parallel:argc > 0) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 2; ++i) {} // OMP45: #pragma omp target parallel for simd if(parallel: argc > 0) // OMP50: #pragma omp target parallel for simd if(parallel: argc > 0) if(simd: argc) + // OMP51: #pragma omp target parallel for simd if(parallel: argc > 0) // CHECK-NEXT: for (int i = 0; i < 2; ++i) { // CHECK-NEXT: } diff --git a/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp --- a/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized class S { int a; @@ -94,28 +96,28 @@ for (((ii)) = 0; ii < 10; ++ii) c[ii] = a[ii]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target parallel for simd for (int i = 0; i; i++) c[i] = a[i]; -// omp45-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}} #pragma omp target parallel for simd for (int i = 0; jj < kk; ii++) c[i] = a[i]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target parallel for simd for (int i = 0; !!i; i++) c[i] = a[i]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} #pragma omp target parallel for simd for (int i = 0; i != 1; i++) c[i] = a[i]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target parallel for simd for (int i = 0;; i++) c[i] = a[i]; @@ -420,15 +422,15 @@ #pragma omp target parallel for simd for (begin = end; begin < end; ++begin) ++begin; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target parallel for simd for (GoodIter I = begin; I - I; ++I) ++I; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target parallel for simd for (GoodIter I = begin; begin < end; ++I) ++I; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target parallel for simd for (GoodIter I = begin; !I; ++I) ++I; @@ -633,10 +635,10 @@ #pragma omp target parallel for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target parallel for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -645,4 +647,19 @@ #pragma omp target parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target parallel for simd'}} omp51-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_simd_ast_print.cpp b/clang/test/OpenMP/target_simd_ast_print.cpp --- a/clang/test/OpenMP/target_simd_ast_print.cpp +++ b/clang/test/OpenMP/target_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -134,6 +140,7 @@ for (T i = 0; i < 2; ++i) {} // OMP45: #pragma omp target simd if(target: argc > 0) // OMP50: #pragma omp target simd if(target: argc > 0) if(simd: argc) allocate(omp_default_mem_alloc: f) private(f) uses_allocators(omp_default_mem_alloc) + // OMP51: #pragma omp target simd if(target: argc > 0) // CHECK-NEXT: for (T i = 0; i < 2; ++i) { // CHECK-NEXT: } @@ -252,14 +259,17 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) { // CHECK-NEXT: } -#ifdef OMP5 +#ifdef OMP51 +#pragma omp target simd if (target:argc > 0) if(simd:argc) nontemporal(argc, c, d) lastprivate(conditional: d, f) order(reproducible:concurrent) +#elif OMP5 #pragma omp target simd if (target:argc > 0) if(simd:argc) nontemporal(argc, c, d) lastprivate(conditional: d, f) order(concurrent) #else #pragma omp target simd if (target:argc > 0) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 2; ++i) {} // OMP45: #pragma omp target simd if(target: argc > 0) // OMP50: #pragma omp target simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d) lastprivate(conditional: d,f) order(concurrent) + // OMP51: #pragma omp target simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d) lastprivate(conditional: d,f) order(reproducible: concurrent) // CHECK-NEXT: for (int i = 0; i < 2; ++i) { // CHECK-NEXT: } diff --git a/clang/test/OpenMP/target_simd_loop_messages.cpp b/clang/test/OpenMP/target_simd_loop_messages.cpp --- a/clang/test/OpenMP/target_simd_loop_messages.cpp +++ b/clang/test/OpenMP/target_simd_loop_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized class S { int a; @@ -94,18 +96,18 @@ for (((ii)) = 0; ii < 10; ++ii) c[ii] = a[ii]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target simd for (int i = 0; i; i++) c[i] = a[i]; -// omp45-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} // expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}} #pragma omp target simd for (int i = 0; jj < kk; ii++) c[i] = a[i]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target simd for (int i = 0; !!i; i++) c[i] = a[i]; @@ -115,7 +117,7 @@ for (int i = 0; i != 1; i++) c[i] = a[i]; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} #pragma omp target simd for (int i = 0;; i++) c[i] = a[i]; @@ -420,15 +422,15 @@ #pragma omp target simd for (begin = end; begin < end; ++begin) ++begin; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target simd for (GoodIter I = begin; I - I; ++I) ++I; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target simd for (GoodIter I = begin; begin < end; ++I) ++I; -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} #pragma omp target simd for (GoodIter I = begin; !I; ++I) ++I; @@ -633,10 +635,10 @@ #pragma omp target simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -645,4 +647,19 @@ #pragma omp target simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target simd'}} omp51-error {{directive '#pragma omp target simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -Wsign-conversion | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -Wsign-conversion -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -Wsign-conversion | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -Wsign-conversion | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -Wsign-conversion -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -107,11 +113,16 @@ // CHECK: #pragma omp target teams distribute parallel for{{$}} // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; +#ifdef OMP51 +#pragma omp target teams distribute parallel for private(argc, b), firstprivate(c, d), collapse(2) order(unconstrained:concurrent) +#else #pragma omp target teams distribute parallel for private(argc, b), firstprivate(c, d), collapse(2) order(concurrent) +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); -// CHECK: #pragma omp target teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(concurrent) +// OMP51: #pragma omp target teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(unconstrained: concurrent) +// OMP50: #pragma omp target teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -fopenmp-version=51 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -fopenmp-version=51 -std=c++11 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -102,10 +104,10 @@ #pragma omp target teams distribute parallel for order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target teams distribute parallel for order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -114,5 +116,20 @@ #pragma omp target teams distribute parallel for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target teams distribute parallel for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for'}} omp51-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -179,11 +185,16 @@ // CHECK: #pragma omp target teams distribute parallel for simd // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; +#ifdef OMP51 +#pragma omp target teams distribute parallel for simd private(argc,b),firstprivate(argv, c), collapse(2) order(reproducible:concurrent) +#else #pragma omp target teams distribute parallel for simd private(argc,b),firstprivate(argv, c), collapse(2) order(concurrent) +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); -// CHECK: #pragma omp target teams distribute parallel for simd private(argc,b) firstprivate(argv,c) collapse(2) order(concurrent) +// OMP50: #pragma omp target teams distribute parallel for simd private(argc,b) firstprivate(argv,c) collapse(2) order(concurrent) +// OMP51: #pragma omp target teams distribute parallel for simd private(argc,b) firstprivate(argv,c) collapse(2) order(reproducible: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp45 %s -Wno-openmp-mapping -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp50 %s -Wno-openmp-mapping -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp51 %s -Wno-openmp-mapping -Wuninitialized class S { int a; @@ -95,18 +97,18 @@ c[ii] = a[ii]; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} for (int i = 0; i; i++) c[i] = a[i]; #pragma omp target teams distribute parallel for simd -// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} // expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}} for (int i = 0; jj < kk; ii++) c[i] = a[i]; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} for (int i = 0; !!i; i++) c[i] = a[i]; @@ -116,7 +118,7 @@ c[i] = a[i]; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}} for (int i = 0;; i++) c[i] = a[i]; @@ -406,15 +408,15 @@ for (begin = end; begin < end; ++begin) ++begin; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} for (GoodIter I = begin; I - I; ++I) ++I; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} for (GoodIter I = begin; begin < end; ++I) ++I; #pragma omp target teams distribute parallel for simd -// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} +// omp45-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp50-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} omp51-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}} for (GoodIter I = begin; !I; ++I) ++I; #pragma omp target teams distribute parallel for simd @@ -631,10 +633,10 @@ #pragma omp target teams distribute parallel for simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target teams distribute parallel for simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -643,5 +645,20 @@ #pragma omp target teams distribute parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target teams distribute parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute parallel for simd'}} omp51-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp b/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp --- a/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -208,15 +214,18 @@ // CHECK: #pragma omp target teams distribute simd simdlen(clen - 1) // CHECK-NEXT: for (int k = 0; k < 10; ++k) // CHECK-NEXT: e += d + argc; -#ifdef OMP5 +#ifdef OMP51 +#pragma omp target teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:argc) nontemporal(argc, c, d) order(unconstrained:concurrent) allocate(omp_low_lat_mem_alloc:e) firstprivate(e) uses_allocators(omp_low_lat_mem_alloc) +#elif OMP5 #pragma omp target teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:argc) nontemporal(argc, c, d) order(concurrent) allocate(omp_low_lat_mem_alloc:e) firstprivate(e) uses_allocators(omp_low_lat_mem_alloc) #else #pragma omp target teams distribute simd safelen(clen-1) aligned(arr:N+6) -#endif // OMP5 +#endif // OMP51 for (int k = 0; k < 10; ++k) e += d + argc + arr[k]; // OMP45: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6) // OMP50: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: argc) nontemporal(argc,c,d) order(concurrent) allocate(omp_low_lat_mem_alloc: e) firstprivate(e) uses_allocators(omp_low_lat_mem_alloc) +// OMP51: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: argc) nontemporal(argc,c,d) order(unconstrained: concurrent) allocate(omp_low_lat_mem_alloc: e) firstprivate(e) uses_allocators(omp_low_lat_mem_alloc) // CHECK-NEXT: for (int k = 0; k < 10; ++k) // CHECK-NEXT: e += d + argc + arr[k]; return (0); diff --git a/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c b/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c --- a/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c +++ b/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute simd'}} #pragma omp target teams distribute simd @@ -343,7 +345,7 @@ #pragma omp target teams distribute simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp target teams distribute simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -373,8 +375,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp target teams distribute simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -406,10 +409,10 @@ #pragma omp target teams distribute simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp target teams distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp target teams distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target teams distribute simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -418,5 +421,20 @@ #pragma omp target teams distribute simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target teams distribute simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target teams distribute simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp target teams distribute simd'}} omp51-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/taskloop_simd_ast_print.cpp b/clang/test/OpenMP/taskloop_simd_ast_print.cpp --- a/clang/test/OpenMP/taskloop_simd_ast_print.cpp +++ b/clang/test/OpenMP/taskloop_simd_ast_print.cpp @@ -1,16 +1,16 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5 -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // expected-no-diagnostics #ifndef HEADER @@ -75,16 +75,19 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#ifdef OMP5 +#ifdef OMP51 +#pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(reproducible:concurrent) +#elif OMP5 #pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d) order(concurrent) #else #pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK-NEXT: #pragma omp parallel // OMP50-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(concurrent) + // OMP51-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d) order(reproducible: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/taskloop_simd_misc_messages.c b/clang/test/OpenMP/taskloop_simd_misc_messages.c --- a/clang/test/OpenMP/taskloop_simd_misc_messages.c +++ b/clang/test/OpenMP/taskloop_simd_misc_messages.c @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized +// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -fopenmp-version=51 -verify=expected,omp51 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -407,7 +409,7 @@ #pragma omp taskloop simd nontemporal(int) for (i = 0; i < 16; ++i) ; -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp taskloop simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -437,8 +439,9 @@ for (i = 0; i < 16; ++i) ; +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp taskloop simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -470,10 +473,10 @@ #pragma omp taskloop simd order // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected '(' after 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp taskloop simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp taskloop simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; -#pragma omp taskloop simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp taskloop simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp taskloop simd order(concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -482,5 +485,20 @@ #pragma omp taskloop simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp taskloop simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp taskloop simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp taskloop simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp taskloop simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp taskloop simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp taskloop simd'}} omp51-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp --- a/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp +++ b/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp @@ -1,10 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP51 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -112,12 +118,17 @@ // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp target +#ifdef OMP51 +#pragma omp teams distribute parallel for private(argc, b), firstprivate(c, d), collapse(2) order(unconstrained:concurrent) +#else #pragma omp teams distribute parallel for private(argc, b), firstprivate(c, d), collapse(2) order(concurrent) +#endif // OMP51 for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(concurrent) +// OMP50: #pragma omp teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(concurrent) +// OMP51: #pragma omp teams distribute parallel for private(argc,b) firstprivate(c,d) collapse(2) order(unconstrained: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/clang/test/OpenMP/teams_distribute_parallel_for_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_messages.cpp --- a/clang/test/OpenMP/teams_distribute_parallel_for_messages.cpp +++ b/clang/test/OpenMP/teams_distribute_parallel_for_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -fopenmp-version=51 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -fopenmp-version=51 -std=c++11 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -125,11 +127,11 @@ for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute parallel for order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute parallel for order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target @@ -140,6 +142,26 @@ #pragma omp teams distribute parallel for order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target +#pragma omp teams distribute parallel for order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for'}} omp51-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } void test_cancel() { diff --git a/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp --- a/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp +++ b/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP51 // expected-no-diagnostics #ifndef HEADER @@ -156,16 +162,19 @@ // CHECK: for (int i = 0; i < 10; ++i) // CHECK-NEXT: foo(); #pragma omp target -#ifdef OMP5 +#ifdef OMP51 +#pragma omp teams distribute parallel for simd if(simd:argc) nontemporal(argc, c, d) order(reproducible:concurrent) +#elif OMP5 #pragma omp teams distribute parallel for simd if(simd:argc) nontemporal(argc, c, d) order(concurrent) #else #pragma omp teams distribute parallel for simd -#endif // OMP5 +#endif // OMP51 for (int i = 0; i < 10; ++i) foo(); // CHECK: #pragma omp target // OMP45-NEXT: #pragma omp teams distribute parallel for simd // OMP50-NEXT: #pragma omp teams distribute parallel for simd if(simd: argc) nontemporal(argc,c,d) order(concurrent) +// OMP51-NEXT: #pragma omp teams distribute parallel for simd if(simd: argc) nontemporal(argc,c,d) order(reproducible: concurrent) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: foo(); #pragma omp target diff --git a/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp --- a/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp +++ b/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -verify=expected,omp51 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 -std=c++11 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -150,7 +152,7 @@ for (i = 0; i < 16; ++i) ; #pragma omp target -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp teams distribute parallel for simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -186,8 +188,9 @@ ; #pragma omp target +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp teams distribute parallel for simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -226,11 +229,11 @@ for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute parallel for simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute parallel for simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target @@ -241,5 +244,25 @@ #pragma omp teams distribute parallel for simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target +#pragma omp teams distribute parallel for simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute parallel for simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute parallel for simd'}} omp51-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; } diff --git a/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp b/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp --- a/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp +++ b/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp @@ -4,6 +4,9 @@ // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s @@ -11,6 +14,9 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -DOMP51 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -DOMP51 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP51 // expected-no-diagnostics #ifndef HEADER @@ -242,16 +248,19 @@ // CHECK-NEXT: for (int k = 0; k < 10; ++k) // CHECK-NEXT: e += d + argc; #pragma omp target -#ifdef OMP5 +#ifdef OMP51 +#pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:b) nontemporal(argc, c, d) order(unconstrained:concurrent) +#elif OMP5 #pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:b) nontemporal(argc, c, d) order(concurrent) #else #pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6) -#endif +#endif // OMP51 for (int k = 0; k < 10; ++k) e += d + argc + arr[k]; // CHECK: #pragma omp target // OMP45-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6) // OMP50-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: b) nontemporal(argc,c,d) order(concurrent) +// OMP51-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: b) nontemporal(argc,c,d) order(unconstrained: concurrent) // CHECK-NEXT: for (int k = 0; k < 10; ++k) // CHECK-NEXT: e += d + argc + arr[k]; return (0); diff --git a/clang/test/OpenMP/teams_distribute_simd_messages.cpp b/clang/test/OpenMP/teams_distribute_simd_messages.cpp --- a/clang/test/OpenMP/teams_distribute_simd_messages.cpp +++ b/clang/test/OpenMP/teams_distribute_simd_messages.cpp @@ -1,8 +1,10 @@ // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -verify=expected,omp51 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp51 -std=c++11 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -150,7 +152,7 @@ for (i = 0; i < 16; ++i) ; #pragma omp target -// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{expected variable name}} +// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{expected variable name}} omp51-error@+1 {{expected variable name}} #pragma omp teams distribute simd nontemporal(0) for (i = 0; i < 16; ++i) ; @@ -186,8 +188,9 @@ ; #pragma omp target +// omp51-note@+3 {{defined as nontemporal}} // omp50-note@+2 {{defined as nontemporal}} -// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} +// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}} omp51-error@+1 {{a variable cannot appear in more than one nontemporal clause}} #pragma omp teams distribute simd nontemporal(x) nontemporal(x) for (i = 0; i < 16; ++i) ; @@ -226,11 +229,11 @@ for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute simd order( // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target -#pragma omp teams distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} +#pragma omp teams distribute simd order(none // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} for (int i = 0; i < 10; ++i) ; #pragma omp target @@ -241,5 +244,25 @@ #pragma omp teams distribute simd order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} for (int i = 0; i < 10; ++i) ; +#pragma omp target +#pragma omp teams distribute simd order(unconstrained:) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} omp51-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute simd order(reproducible:concurrent // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute simd order(reproducible:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute simd order(unconstrained:concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} omp50-error {{expected 'concurrent' in OpenMP clause 'order'}} + for (int i = 0; i < 10; ++i) + ; +#pragma omp target +#pragma omp teams distribute simd order(concurrent) order(concurrent) // omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} omp45-error {{unexpected OpenMP clause 'order' in directive '#pragma omp teams distribute simd'}} omp51-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'order' clause}} + for (int i = 0; i < 10; ++i) + ; }