]> granicus.if.org Git - clang/commitdiff
Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"
authorDiana Picus <diana.picus@linaro.org>
Thu, 18 Aug 2016 09:25:07 +0000 (09:25 +0000)
committerDiana Picus <diana.picus@linaro.org>
Thu, 18 Aug 2016 09:25:07 +0000 (09:25 +0000)
This reverts commit r279003 as it breaks some of our buildbots (e.g.
clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules).

The error is in OpenMP/teams_distribute_simd_ast_print.cpp:
clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527:
bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const
[with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>;
      KeyT = clang::Stmt*; ValueT = long unsigned int;
      KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>;
      BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]:
Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) &&
"Empty/Tombstone value shouldn't be inserted into map!"' failed.

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

40 files changed:
include/clang-c/Index.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/AST/StmtOpenMP.h
include/clang/Basic/OpenMPKinds.def
include/clang/Basic/StmtNodes.td
include/clang/Sema/Sema.h
include/clang/Serialization/ASTBitCodes.h
lib/AST/StmtOpenMP.cpp
lib/AST/StmtPrinter.cpp
lib/AST/StmtProfile.cpp
lib/Basic/OpenMPKinds.cpp
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CGStmtOpenMP.cpp
lib/CodeGen/CodeGenFunction.h
lib/Parse/ParseOpenMP.cpp
lib/Sema/SemaOpenMP.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/OpenMP/nesting_of_regions.cpp
test/OpenMP/teams_distribute_simd_aligned_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_ast_print.cpp [deleted file]
test/OpenMP/teams_distribute_simd_collapse_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_default_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_dist_schedule_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_linear_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_loop_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_num_teams_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_private_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_reduction_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_safelen_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_shared_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_simdlen_messages.cpp [deleted file]
test/OpenMP/teams_distribute_simd_thread_limit_messages.cpp [deleted file]
tools/libclang/CIndex.cpp
tools/libclang/CXCursor.cpp

index b00df33683ba7bb80d2abefeb2846d1777ca7527..170e4e7fad5f70ac31114f228e4d87878c484f12 100644 (file)
@@ -2333,11 +2333,7 @@ enum CXCursorKind {
    */
   CXCursor_OMPTeamsDistributeDirective = 271,
 
-  /** \brief OpenMP teams distribute simd directive.
-   */
-  CXCursor_OMPTeamsDistributeSimdDirective = 272,
-
-  CXCursor_LastStmt = CXCursor_OMPTeamsDistributeSimdDirective,
+  CXCursor_LastStmt = CXCursor_OMPTeamsDistributeDirective,
 
   /**
    * \brief Cursor that represents the translation unit itself.
index cd6a8114ad37d17c14750d9a24f7eded6bbb4ca5..84abbb762d64407ad111b7b6d3a5fbe9e991d2ed 100644 (file)
@@ -2598,9 +2598,6 @@ DEF_TRAVERSE_STMT(OMPTargetSimdDirective,
 DEF_TRAVERSE_STMT(OMPTeamsDistributeDirective,
                   { TRY_TO(TraverseOMPExecutableDirective(S)); })
 
-DEF_TRAVERSE_STMT(OMPTeamsDistributeSimdDirective,
-                  { TRY_TO(TraverseOMPExecutableDirective(S)); })
-
 // OpenMP clauses.
 template <typename Derived>
 bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) {
index bf97430f677d2a09ca127b7b98c3c580aa26270e..de603f489fbb81d69085b7496655c01106ce4b9d 100644 (file)
@@ -3226,76 +3226,6 @@ public:
   }
 };
 
-/// This represents '#pragma omp teams distribute simd'
-/// combined directive.
-///
-/// \code
-/// #pragma omp teams distribute simd private(a,b)
-/// \endcode
-/// In this example directive '#pragma omp teams distribute simd'
-/// has clause 'private' with the variables 'a' and 'b'
-///
-class OMPTeamsDistributeSimdDirective final : public OMPLoopDirective {
-  friend class ASTStmtReader;
-
-  /// Build directive with the given start and end location.
-  ///
-  /// \param StartLoc Starting location of the directive kind.
-  /// \param EndLoc Ending location of the directive.
-  /// \param CollapsedNum Number of collapsed nested loops.
-  /// \param NumClauses Number of clauses.
-  ///
-  OMPTeamsDistributeSimdDirective(SourceLocation StartLoc,
-                                  SourceLocation EndLoc, unsigned CollapsedNum,
-                                  unsigned NumClauses)
-      : OMPLoopDirective(this, OMPTeamsDistributeSimdDirectiveClass,
-                         OMPD_teams_distribute_simd, StartLoc, EndLoc,
-                         CollapsedNum, NumClauses) {}
-
-  /// Build an empty directive.
-  ///
-  /// \param CollapsedNum Number of collapsed nested loops.
-  /// \param NumClauses Number of clauses.
-  ///
-  explicit OMPTeamsDistributeSimdDirective(unsigned CollapsedNum,
-                                           unsigned NumClauses)
-      : OMPLoopDirective(this, OMPTeamsDistributeSimdDirectiveClass,
-                         OMPD_teams_distribute_simd, SourceLocation(),
-                         SourceLocation(), CollapsedNum, NumClauses) {}
-
-public:
-  /// Creates directive with a list of \a Clauses.
-  ///
-  /// \param C AST context.
-  /// \param StartLoc Starting location of the directive kind.
-  /// \param EndLoc Ending Location of the directive.
-  /// \param CollapsedNum Number of collapsed loops.
-  /// \param Clauses List of clauses.
-  /// \param AssociatedStmt Statement, associated with the directive.
-  /// \param Exprs Helper expressions for CodeGen.
-  ///
-  static OMPTeamsDistributeSimdDirective *
-  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
-         unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
-         Stmt *AssociatedStmt, const HelperExprs &Exprs);
-
-  /// Creates an empty directive with the place
-  /// for \a NumClauses clauses.
-  ///
-  /// \param C AST context.
-  /// \param CollapsedNum Number of collapsed nested loops.
-  /// \param NumClauses Number of clauses.
-  ///
-  static OMPTeamsDistributeSimdDirective *CreateEmpty(const ASTContext &C,
-                                                      unsigned NumClauses,
-                                                      unsigned CollapsedNum,
-                                                      EmptyShell);
-
-  static bool classof(const Stmt *T) {
-    return T->getStmtClass() == OMPTeamsDistributeSimdDirectiveClass;
-  }
-};
-
 } // end namespace clang
 
 #endif
index c95062d9ef90b7e7cbd4b9e01d63ad9ece4c64ac..0d0cc1c07ebd86061af396a959048017b8067ed0 100644 (file)
 #ifndef OPENMP_TEAMS_DISTRIBUTE_CLAUSE
 #define OPENMP_TEAMS_DISTRIBUTE_CLAUSE(Name)
 #endif
-#ifndef OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE
-#define OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(Name)
-#endif
 
 // OpenMP directives.
 OPENMP_DIRECTIVE(threadprivate)
@@ -193,7 +190,6 @@ OPENMP_DIRECTIVE_EXT(distribute_simd, "distribute simd")
 OPENMP_DIRECTIVE_EXT(target_parallel_for_simd, "target parallel for simd")
 OPENMP_DIRECTIVE_EXT(target_simd, "target simd")
 OPENMP_DIRECTIVE_EXT(teams_distribute, "teams distribute")
-OPENMP_DIRECTIVE_EXT(teams_distribute_simd, "teams distribute simd")
 
 // OpenMP clauses.
 OPENMP_CLAUSE(if, OMPIfClause)
@@ -662,22 +658,6 @@ OPENMP_TEAMS_DISTRIBUTE_CLAUSE(lastprivate)
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(collapse)
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(dist_schedule)
 
-// Clauses allowed for OpenMP directive 'teams distribute simd'
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(default)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(private)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(firstprivate)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(shared)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(reduction)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(num_teams)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(thread_limit)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(lastprivate)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(collapse)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(dist_schedule)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(linear)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(aligned)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(safelen)
-OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(simdlen)
-
 #undef OPENMP_TASKLOOP_SIMD_CLAUSE
 #undef OPENMP_TASKLOOP_CLAUSE
 #undef OPENMP_LINEAR_KIND
@@ -722,4 +702,3 @@ OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(simdlen)
 #undef OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE
 #undef OPENMP_TARGET_SIMD_CLAUSE
 #undef OPENMP_TEAMS_DISTRIBUTE_CLAUSE
-#undef OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE
index 9686ff68ea0760e7d14ca5a90d42f9f54caeeb3f..554f19ff08f5de535d352824a9ebed8d4b8972f5 100644 (file)
@@ -235,4 +235,3 @@ def OMPDistributeSimdDirective : DStmt<OMPLoopDirective>;
 def OMPTargetParallelForSimdDirective : DStmt<OMPLoopDirective>;
 def OMPTargetSimdDirective : DStmt<OMPLoopDirective>;
 def OMPTeamsDistributeDirective : DStmt<OMPLoopDirective>;
-def OMPTeamsDistributeSimdDirective : DStmt<OMPLoopDirective>;
index cf4b26503cf8c66ee6171357f5d953376298bc4a..7cf84c3995270024ffc98fcfd17a9956c863a6d2 100644 (file)
@@ -8281,12 +8281,6 @@ public:
       ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
       SourceLocation EndLoc,
       llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
-  /// Called on well-formed '\#pragma omp teams distribute simd' after parsing
-  /// of the associated statement.
-  StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
-      ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
-      SourceLocation EndLoc,
-      llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
 
   /// Checks correctness of linear modifiers.
   bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind,
index c84aa2d6f874d0c13848234f575c7740b0995934..47678a1637f72a77b11b59cb86385d7177e7bbd1 100644 (file)
@@ -1490,7 +1490,6 @@ namespace clang {
       STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE,
       STMT_OMP_TARGET_SIMD_DIRECTIVE,
       STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE,
-      STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE,
       EXPR_OMP_ARRAY_SECTION,
 
       // ARC
index 0c21d6ae8b683f8c205e6196d7edb3edef6e8efa..7197586e39de3013c3081b38d776e8194c978402 100644 (file)
@@ -1362,55 +1362,3 @@ OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
   return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
 }
-
-OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
-    const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
-    unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
-    const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
-                                llvm::alignOf<OMPClause *>());
-  void *Mem =
-      C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
-                 sizeof(Stmt *) *
-                     numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
-  OMPTeamsDistributeSimdDirective *Dir =
-      new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
-                                                Clauses.size());
-  Dir->setClauses(Clauses);
-  Dir->setAssociatedStmt(AssociatedStmt);
-  Dir->setIterationVariable(Exprs.IterationVarRef);
-  Dir->setLastIteration(Exprs.LastIteration);
-  Dir->setCalcLastIteration(Exprs.CalcLastIteration);
-  Dir->setPreCond(Exprs.PreCond);
-  Dir->setCond(Exprs.Cond);
-  Dir->setInit(Exprs.Init);
-  Dir->setInc(Exprs.Inc);
-  Dir->setIsLastIterVariable(Exprs.IL);
-  Dir->setLowerBoundVariable(Exprs.LB);
-  Dir->setUpperBoundVariable(Exprs.UB);
-  Dir->setStrideVariable(Exprs.ST);
-  Dir->setNextLowerBound(Exprs.NLB);
-  Dir->setNextUpperBound(Exprs.NUB);
-  Dir->setNumIterations(Exprs.NumIterations);
-  Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
-  Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
-  Dir->setCounters(Exprs.Counters);
-  Dir->setPrivateCounters(Exprs.PrivateCounters);
-  Dir->setInits(Exprs.Inits);
-  Dir->setUpdates(Exprs.Updates);
-  Dir->setFinals(Exprs.Finals);
-  Dir->setPreInits(Exprs.PreInits);
-  return Dir;
-}
-
-OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
-    const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
-    EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
-                                llvm::alignOf<OMPClause *>());
-  void *Mem =
-      C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
-                 sizeof(Stmt *) *
-                     numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
-  return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
-}
index e80598469dac2c1afdec1fc01d42f57afabf36e8..0b103f96a5c3876c9c7ba7897d462ac023033045 100644 (file)
@@ -1209,12 +1209,6 @@ void StmtPrinter::VisitOMPTeamsDistributeDirective(
   PrintOMPExecutableDirective(Node);
 }
 
-void StmtPrinter::VisitOMPTeamsDistributeSimdDirective(
-    OMPTeamsDistributeSimdDirective *Node) {
-  Indent() << "#pragma omp teams distribute simd ";
-  PrintOMPExecutableDirective(Node);
-}
-
 //===----------------------------------------------------------------------===//
 //  Expr printing methods.
 //===----------------------------------------------------------------------===//
index 9496d3620ee536ed92633c801ba89dbcc91abf44..cff836959d0ac72270259cc1093942303395ff4c 100644 (file)
@@ -737,11 +737,6 @@ void StmtProfiler::VisitOMPTeamsDistributeDirective(
   VisitOMPLoopDirective(S);
 }
 
-void StmtProfiler::VisitOMPTeamsDistributeSimdDirective(
-    const OMPTeamsDistributeSimdDirective *S) {
-  VisitOMPLoopDirective(S);
-}
-
 void StmtProfiler::VisitExpr(const Expr *S) {
   VisitStmt(S);
 }
index fa4b75cce4713c97b81db69ffbc0fd3d0d010998..4b41ab186d46583230d3aee8d6f2f76f48b7235a 100644 (file)
@@ -625,16 +625,6 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind,
 #define OPENMP_TEAMS_DISTRIBUTE_CLAUSE(Name)                                   \
   case OMPC_##Name:                                                            \
     return true;
-#include "clang/Basic/OpenMPKinds.def"
-    default:
-      break;
-    }
-    break;
-  case OMPD_teams_distribute_simd:
-    switch (CKind) {
-#define OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(Name)                              \
-  case OMPC_##Name:                                                            \
-    return true;
 #include "clang/Basic/OpenMPKinds.def"
     default:
       break;
@@ -666,7 +656,7 @@ bool clang::isOpenMPLoopDirective(OpenMPDirectiveKind DKind) {
          DKind == OMPD_distribute_parallel_for_simd ||
          DKind == OMPD_distribute_simd ||
          DKind == OMPD_target_parallel_for_simd || DKind == OMPD_target_simd ||
-         DKind == OMPD_teams_distribute || DKind == OMPD_teams_distribute_simd;
+         DKind == OMPD_teams_distribute;
   // TODO add next directives.
 }
 
@@ -709,8 +699,7 @@ bool clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) {
 }
 
 bool clang::isOpenMPTeamsDirective(OpenMPDirectiveKind DKind) {
-  return DKind == OMPD_teams || DKind == OMPD_teams_distribute ||
-         DKind == OMPD_teams_distribute_simd;
+  return DKind == OMPD_teams || DKind == OMPD_teams_distribute;
   // TODO add next directives.
 }
 
@@ -718,8 +707,7 @@ bool clang::isOpenMPSimdDirective(OpenMPDirectiveKind DKind) {
   return DKind == OMPD_simd || DKind == OMPD_for_simd ||
          DKind == OMPD_parallel_for_simd || DKind == OMPD_taskloop_simd ||
          DKind == OMPD_distribute_parallel_for_simd ||
-         DKind == OMPD_distribute_simd || DKind == OMPD_target_simd ||
-         DKind == OMPD_teams_distribute_simd;
+         DKind == OMPD_distribute_simd || DKind == OMPD_target_simd;
   // TODO add next directives.
 }
 
@@ -732,7 +720,7 @@ bool clang::isOpenMPNestingDistributeDirective(OpenMPDirectiveKind Kind) {
 
 bool clang::isOpenMPDistributeDirective(OpenMPDirectiveKind Kind) {
   return isOpenMPNestingDistributeDirective(Kind) ||
-         Kind == OMPD_teams_distribute || Kind == OMPD_teams_distribute_simd;
+         Kind == OMPD_teams_distribute;
   // TODO add next directives.
 }
 
@@ -753,6 +741,5 @@ bool clang::isOpenMPTaskingDirective(OpenMPDirectiveKind Kind) {
 bool clang::isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind) {
   return Kind == OMPD_distribute_parallel_for ||
          Kind == OMPD_distribute_parallel_for_simd ||
-         Kind == OMPD_distribute_simd || Kind == OMPD_teams_distribute ||
-         Kind == OMPD_teams_distribute_simd;
+         Kind == OMPD_distribute_simd || Kind == OMPD_teams_distribute;
 }
index 5ac3af678d7e79412065fefe9b481a48357c3548..aa457ad5f3ffc909e182eba25b6adb3c249ab7bf 100644 (file)
@@ -301,10 +301,6 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
   case Stmt::OMPTeamsDistributeDirectiveClass:
     EmitOMPTeamsDistributeDirective(cast<OMPTeamsDistributeDirective>(*S));
     break;
-  case Stmt::OMPTeamsDistributeSimdDirectiveClass:
-    EmitOMPTeamsDistributeSimdDirective(
-        cast<OMPTeamsDistributeSimdDirective>(*S));
-    break;
   }
 }
 
index f8c3af867ed7c2e5a897ccef37ff00697a1cfb54..f2b99428588bf1eddf210d0989e56adff415c076 100644 (file)
@@ -1946,19 +1946,6 @@ void CodeGenFunction::EmitOMPTeamsDistributeDirective(
       });
 }
 
-void CodeGenFunction::EmitOMPTeamsDistributeSimdDirective(
-    const OMPTeamsDistributeSimdDirective &S) {
-  OMPLexicalScope Scope(*this, S, /*AsInlined=*/true);
-  CGM.getOpenMPRuntime().emitInlinedDirective(
-      *this, OMPD_teams_distribute_simd,
-      [&S](CodeGenFunction &CGF, PrePostActionTy &) {
-        OMPLoopScope PreInitScope(CGF, S);
-        CGF.EmitStmt(
-            cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());
-      });
-}
-
-
 /// \brief Emit a helper variable and return corresponding lvalue.
 static LValue EmitOMPHelperVar(CodeGenFunction &CGF,
                                const DeclRefExpr *Helper) {
index 5047660ea724c5d818cc741cfc8b5ade76dddcf0..bb0437157e560d3eb01fa57fdfc9467f959ab84c 100644 (file)
@@ -2513,8 +2513,6 @@ public:
       const OMPTargetParallelForSimdDirective &S);
   void EmitOMPTargetSimdDirective(const OMPTargetSimdDirective &S);
   void EmitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &S);
-  void
-  EmitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &S);
 
   /// Emit outlined function for the target directive.
   static std::pair<llvm::Function * /*OutlinedFn*/,
index bda71724f919948e25654533b81e8af6b97bfc65..d4cdc8e8596d1db1b75f6f586cc28aaadf205fa2 100644 (file)
@@ -109,8 +109,7 @@ static OpenMPDirectiveKind ParseOpenMPDirectiveKind(Parser &P) {
     { OMPD_target, OMPD_simd, OMPD_target_simd },
     { OMPD_target_parallel, OMPD_for, OMPD_target_parallel_for },
     { OMPD_target_parallel_for, OMPD_simd, OMPD_target_parallel_for_simd },
-    { OMPD_teams, OMPD_distribute, OMPD_teams_distribute },
-    { OMPD_teams_distribute, OMPD_simd, OMPD_teams_distribute_simd }
+    { OMPD_teams, OMPD_distribute, OMPD_teams_distribute }
   };
   enum { CancellationPoint = 0, DeclareReduction = 1, TargetData = 2 };
   auto Tok = P.getCurToken();
@@ -745,7 +744,6 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl(
   case OMPD_target_parallel_for_simd:
   case OMPD_target_simd:
   case OMPD_teams_distribute:
-  case OMPD_teams_distribute_simd:
     Diag(Tok, diag::err_omp_unexpected_directive)
         << getOpenMPDirectiveName(DKind);
     break;
@@ -780,7 +778,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl(
 ///         'target update' | 'distribute parallel for' |
 ///         'distribute paralle for simd' | 'distribute simd' |
 ///         'target parallel for simd' | 'target simd' |
-///         'teams distribute' | 'teams distribute simd' {clause}
+///         'teams distribute' {clause}
 ///         annot_pragma_openmp_end
 ///
 StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
@@ -890,8 +888,7 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
   case OMPD_distribute_simd:
   case OMPD_target_parallel_for_simd:
   case OMPD_target_simd:
-  case OMPD_teams_distribute:
-  case OMPD_teams_distribute_simd: {
+  case OMPD_teams_distribute: {
     ConsumeToken();
     // Parse directive name of the 'critical' directive if any.
     if (DKind == OMPD_critical) {
index 25096e615fe4f7f1e124538b685fe0410419b337..5cbcea4cce31bf3b9b0ec13a9a47e9a4527e2af9 100644 (file)
@@ -1693,8 +1693,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
   case OMPD_distribute_parallel_for_simd:
   case OMPD_distribute_simd:
   case OMPD_distribute_parallel_for:
-  case OMPD_teams_distribute:
-  case OMPD_teams_distribute_simd: {
+  case OMPD_teams_distribute: {
     QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
     QualType KmpInt32PtrTy =
         Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
@@ -1923,8 +1922,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | parallel         | distribute simd | +                                  |
   // | parallel         | target simd     | *                                  |
   // | parallel         | teams distribute| +                                  |
-  // | parallel         | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | for              | parallel        | *                                  |
   // | for              | for             | +                                  |
@@ -1970,8 +1967,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | for              | target simd     | *                                  |
   // | for              | teams distribute| +                                  |
-  // | for              | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | master           | parallel        | *                                  |
   // | master           | for             | +                                  |
@@ -2017,8 +2012,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | master           | target simd     | *                                  |
   // | master           | teams distribute| +                                  |
-  // | master           | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | critical         | parallel        | *                                  |
   // | critical         | for             | +                                  |
@@ -2063,8 +2056,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | critical         | target simd     | *                                  |
   // | critical         | teams distribute| +                                  |
-  // | critical         | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | simd             | parallel        |                                    |
   // | simd             | for             |                                    |
@@ -2110,8 +2101,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | simd             | target simd     |                                    |
   // | simd             | teams distribute|                                    |
-  // | simd             | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | for simd         | parallel        |                                    |
   // | for simd         | for             |                                    |
@@ -2157,8 +2146,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | for simd         | target simd     |                                    |
   // | for simd         | teams distribute|                                    |
-  // | for simd         | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | parallel for simd| parallel        |                                    |
   // | parallel for simd| for             |                                    |
@@ -2203,8 +2190,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | parallel for simd| target simd     |                                    |
   // | parallel for simd| teams distribute|                                    |
-  // | parallel for simd| teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | sections         | parallel        | *                                  |
   // | sections         | for             | +                                  |
@@ -2249,8 +2234,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | sections         | target parallel | +                                  |
   // |                  | for simd        |                                    |
   // | sections         | target simd     | *                                  |
-  // | sections         | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | section          | parallel        | *                                  |
   // | section          | for             | +                                  |
@@ -2296,8 +2279,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | section          | target simd     | *                                  |
   // | section          | teams distrubte | +                                  |
-  // | section          | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | single           | parallel        | *                                  |
   // | single           | for             | +                                  |
@@ -2343,8 +2324,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | single           | target simd     | *                                  |
   // | single           | teams distrubte | +                                  |
-  // | single           | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | parallel for     | parallel        | *                                  |
   // | parallel for     | for             | +                                  |
@@ -2390,8 +2369,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | parallel for     | target simd     | *                                  |
   // | parallel for     | teams distribute| +                                  |
-  // | parallel for     | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | parallel sections| parallel        | *                                  |
   // | parallel sections| for             | +                                  |
@@ -2437,8 +2414,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | parallel sections| target simd     | *                                  |
   // | parallel sections| teams distribute| +                                  |
-  // | parallel sections| teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | task             | parallel        | *                                  |
   // | task             | for             | +                                  |
@@ -2484,8 +2459,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | task             | target simd     | *                                  |
   // | task             | teams distribute| +                                  |
-  // | task             | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | ordered          | parallel        | *                                  |
   // | ordered          | for             | +                                  |
@@ -2531,8 +2504,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | ordered          | target simd     | *                                  |
   // | ordered          | teams distribute| +                                  |
-  // | ordered          | teams distribute|                                    |
-  // |                  | simd            | +                                  |
   // +------------------+-----------------+------------------------------------+
   // | atomic           | parallel        |                                    |
   // | atomic           | for             |                                    |
@@ -2578,8 +2549,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | atomic           | target simd     |                                    |
   // | atomic           | teams distribute|                                    |
-  // | atomic           | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | target           | parallel        | *                                  |
   // | target           | for             | *                                  |
@@ -2625,8 +2594,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | target           | target simd     |                                    |
   // | target           | teams distribute|                                    |
-  // | target           | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | target parallel  | parallel        | *                                  |
   // | target parallel  | for             | *                                  |
@@ -2672,8 +2639,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | target parallel  | target simd     |                                    |
   // | target parallel  | teams distribute| +                                  |
-  // | target parallel  | teams distribute| +                                  |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | target parallel  | parallel        | *                                  |
   // | for              |                 |                                    |
@@ -2749,8 +2714,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | for              |                 |                                    |
   // | target parallel  | teams distribute|                                    |
   // | for              |                 |                                    |
-  // | target parallel  | teams distribute|                                    |
-  // | for              | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | teams            | parallel        | *                                  |
   // | teams            | for             | +                                  |
@@ -2796,8 +2759,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | teams            | target simd     | +                                  |
   // | teams            | teams distribute| +                                  |
-  // | teams            | teams distribute| +                                  |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | taskloop         | parallel        | *                                  |
   // | taskloop         | for             | +                                  |
@@ -2842,8 +2803,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | taskloop         | target simd     | *                                  |
   // | taskloop         | teams distribute| +                                  |
-  // | taskloop         | teams distribute| +                                  |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | taskloop simd    | parallel        |                                    |
   // | taskloop simd    | for             |                                    |
@@ -2889,8 +2848,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | taskloop simd    | target simd     |                                    |
   // | taskloop simd    | teams distribute|                                    |
-  // | taskloop simd    | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | distribute       | parallel        | *                                  |
   // | distribute       | for             | *                                  |
@@ -2936,8 +2893,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | distribute       | target simd     |                                    |
   // | distribute       | teams distribute|                                    |
-  // | distribute       | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | distribute       | parallel        | *                                  |
   // | parallel for     |                 |                                    |
@@ -3014,8 +2969,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | parallel for     |                 |                                    |
   // | distribute       | teams distribute|                                    |
   // | parallel for     |                 |                                    |
-  // | distribute       | teams distribute|                                    |
-  // | parallel for     | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | distribute       | parallel        | *                                  |
   // | parallel for simd|                 |                                    |
@@ -3091,8 +3044,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | parallel for simd|                 |                                    |
   // | distribute       | teams distribute|                                    |
   // | parallel for simd|                 |                                    |
-  // | distribute       | teams distribute|                                    |
-  // | parallel for simd| simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | distribute simd  | parallel        | *                                  |
   // | distribute simd  | for             | *                                  |
@@ -3138,8 +3089,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | distribute simd  | target simd     | *                                  |
   // | distribute simd  | teams distribute| *                                  |
-  // | distribute simd  | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | target parallel  | parallel        | *                                  |
   // | for simd         |                 |                                    |
@@ -3215,8 +3164,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | for simd         |                 |                                    |
   // | target parallel  | teams distribute| *                                  |
   // | for simd         |                 |                                    |
-  // | target parallel  | teams distribute|                                    |
-  // | for simd         | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | target simd      | parallel        |                                    |
   // | target simd      | for             |                                    |
@@ -3262,8 +3209,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // |                  | for simd        |                                    |
   // | target simd      | target simd     |                                    |
   // | target simd      | teams distribute|                                    |
-  // | target simd      | teams distribute|                                    |
-  // |                  | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   // | teams distribute | parallel        |                                    |
   // | teams distribute | for             |                                    |
@@ -3308,83 +3253,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack,
   // | teams distribute | target parallel |                                    |
   // |                  | for simd        |                                    |
   // | teams distribute | teams distribute|                                    |
-  // | teams distribute | teams distribute|                                    |
-  // |                  | simd            |                                    |
-  // +------------------+-----------------+------------------------------------+
-  // | teams distribute | parallel        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | for             |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | for simd        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | master          |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | critical        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | simd            |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | sections        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | section         |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | single          |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | parallel for    |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute |parallel for simd|                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute |parallel sections|                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | task            |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | taskyield       |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | barrier         |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | taskwait        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | taskgroup       |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | flush           |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | ordered         | + (with simd clause)               |
-  // | simd             |                 |                                    |
-  // | teams distribute | atomic          |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | target          |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | target parallel |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | target parallel |                                    |
-  // | simd             | for             |                                    |
-  // | teams distribute | target enter    |                                    |
-  // | simd             | data            |                                    |
-  // | teams distribute | target exit     |                                    |
-  // | simd             | data            |                                    |
-  // | teams distribute | teams           |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | cancellation    |                                    |
-  // | simd             | point           |                                    |
-  // | teams distribute | cancel          |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | taskloop        |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | taskloop simd   |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | distribute      |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | distribute      |                                    |
-  // | simd             | parallel for    |                                    |
-  // | teams distribute | distribute      |                                    |
-  // | simd             |parallel for simd|                                    |
-  // | teams distribute | distribute simd |                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | target parallel |                                    |
-  // | simd             | for simd        |                                    |
-  // | teams distribute | teams distribute|                                    |
-  // | simd             |                 |                                    |
-  // | teams distribute | teams distribute|                                    |
-  // | simd             | simd            |                                    |
   // +------------------+-----------------+------------------------------------+
   if (Stack->getCurScope()) {
     auto ParentRegion = Stack->getParentDirective();
@@ -3905,10 +3773,6 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
     Res = ActOnOpenMPTeamsDistributeDirective(
         ClausesWithImplicit, AStmt, StartLoc, EndLoc, VarsWithInheritedDSA);
     break;
-  case OMPD_teams_distribute_simd:
-    Res = ActOnOpenMPTeamsDistributeSimdDirective(
-        ClausesWithImplicit, AStmt, StartLoc, EndLoc, VarsWithInheritedDSA);
-    break;
   case OMPD_declare_target:
   case OMPD_end_declare_target:
   case OMPD_threadprivate:
@@ -7601,55 +7465,6 @@ StmtResult Sema::ActOnOpenMPTeamsDistributeDirective(
       Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
 }
 
-StmtResult Sema::ActOnOpenMPTeamsDistributeSimdDirective(
-    ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc,
-    SourceLocation EndLoc,
-    llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA) {
-  if (!AStmt)
-    return StmtError();
-
-  CapturedStmt *CS = cast<CapturedStmt>(AStmt);
-  // 1.2.2 OpenMP Language Terminology
-  // Structured block - An executable statement with a single entry at the
-  // top and a single exit at the bottom.
-  // The point of exit cannot be a branch out of the structured block.
-  // longjmp() and throw() must not violate the entry/exit criteria.
-  CS->getCapturedDecl()->setNothrow();
-
-  OMPLoopDirective::HelperExprs B;
-  // In presence of clause 'collapse' with number of loops, it will
-  // define the nested loops number.
-  unsigned NestedLoopCount =
-      CheckOpenMPLoop(OMPD_teams_distribute_simd,
-                      getCollapseNumberExpr(Clauses),
-                      nullptr /*ordered not a clause on distribute*/, AStmt,
-                      *this, *DSAStack, VarsWithImplicitDSA, B);
-
-  if (NestedLoopCount == 0)
-    return StmtError();
-
-  assert((CurContext->isDependentContext() || B.builtAll()) &&
-         "omp teams distribute simd loop exprs were not built");
-
-  if (!CurContext->isDependentContext()) {
-    // Finalize the clauses that need pre-built expressions for CodeGen.
-    for (auto C : Clauses) {
-      if (auto *LC = dyn_cast<OMPLinearClause>(C))
-        if (FinishOpenMPLinearClause(*LC, cast<DeclRefExpr>(B.IterationVarRef),
-                                     B.NumIterations, *this, CurScope,
-                                     DSAStack))
-          return StmtError();
-    }
-  }
-
-  if (checkSimdlenSafelenSpecified(*this, Clauses))
-    return StmtError();
-
-  getCurFunction()->setHasBranchProtectedScope();
-  return OMPTeamsDistributeSimdDirective::Create(
-      Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
-}
-
 OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr,
                                              SourceLocation StartLoc,
                                              SourceLocation LParenLoc,
index 7868c90646cea27bdaf3688c9debfe4f8aa97e95..8ea0b015e5fbf057d51179ae6187c35e24742512 100644 (file)
@@ -7646,17 +7646,6 @@ StmtResult TreeTransform<Derived>::TransformOMPTeamsDistributeDirective(
   return Res;
 }
 
-template <typename Derived>
-StmtResult TreeTransform<Derived>::TransformOMPTeamsDistributeSimdDirective(
-    OMPTeamsDistributeSimdDirective *D) {
-  DeclarationNameInfo DirName;
-  getDerived().getSema().StartOpenMPDSABlock(
-      OMPD_teams_distribute_simd, DirName, nullptr, D->getLocStart());
-  StmtResult Res = getDerived().TransformOMPExecutableDirective(D);
-  getDerived().getSema().EndOpenMPDSABlock(Res.get());
-  return Res;
-}
-
 //===----------------------------------------------------------------------===//
 // OpenMP clause transformation
 //===----------------------------------------------------------------------===//
index c2ccc9c6734f9bf17ce9cdeca572f2e9d33c7517..331932e0155d7110212c6fbb02b63b52f6efe4ae 100644 (file)
@@ -2869,11 +2869,6 @@ void ASTStmtReader::VisitOMPTeamsDistributeDirective(
   VisitOMPLoopDirective(D);
 }
 
-void ASTStmtReader::VisitOMPTeamsDistributeSimdDirective(
-    OMPTeamsDistributeSimdDirective *D) {
-  VisitOMPLoopDirective(D);
-}
-
 //===----------------------------------------------------------------------===//
 // ASTReader Implementation
 //===----------------------------------------------------------------------===//
@@ -3601,14 +3596,6 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
       break;
     }
 
-    case STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE: {
-      unsigned NumClauses = Record[ASTStmtReader::NumStmtFields];
-      unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1];
-      S = OMPTeamsDistributeSimdDirective::CreateEmpty(Context, NumClauses,
-                                                       CollapsedNum, Empty);
-      break;
-    }
-
     case EXPR_CXX_OPERATOR_CALL:
       S = new (Context) CXXOperatorCallExpr(Context, Empty);
       break;
index 6e21d540a47a00fab57d8d50e11ccac21944b6af..19b1e20d369708dd475f03eb2fd10ec0ae3001f9 100644 (file)
@@ -2518,12 +2518,6 @@ void ASTStmtWriter::VisitOMPTeamsDistributeDirective(
   Code = serialization::STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE;
 }
 
-void ASTStmtWriter::VisitOMPTeamsDistributeSimdDirective(
-    OMPTeamsDistributeSimdDirective *D) {
-  VisitOMPLoopDirective(D);
-  Code = serialization::STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE;
-}
-
 //===----------------------------------------------------------------------===//
 // ASTWriter Implementation
 //===----------------------------------------------------------------------===//
index ed240072f9bd53699ac2925bebd4572518de3964..6ca24c78a12b074ad54eec08477b90ea6ca0c2d1 100644 (file)
@@ -848,7 +848,6 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
     case Stmt::OMPTargetParallelForSimdDirectiveClass:
     case Stmt::OMPTargetSimdDirectiveClass:
     case Stmt::OMPTeamsDistributeDirectiveClass:
-    case Stmt::OMPTeamsDistributeSimdDirectiveClass:
       llvm_unreachable("Stmt should not be in analyzer evaluation loop");
 
     case Stmt::ObjCSubscriptRefExprClass:
index b495bd4b1780032c3e401cec169458edcdae43a5..8f6fb35bd3d3ade989af62aa8de59e5869bc290d 100644 (file)
@@ -167,13 +167,7 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp parallel
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-
+  
 // SIMD DIRECTIVE
 #pragma omp simd
   for (int i = 0; i < 10; ++i) {
@@ -377,12 +371,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // FOR DIRECTIVE
 #pragma omp for
@@ -600,12 +588,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // FOR SIMD DIRECTIVE
 #pragma omp for simd
@@ -811,12 +793,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // SECTIONS DIRECTIVE
 #pragma omp sections
@@ -1039,12 +1015,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp sections
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'sections' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // SECTION DIRECTIVE
 #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}}
@@ -1326,13 +1296,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp sections
-  {
-#pragma omp section
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // SINGLE DIRECTIVE
 #pragma omp single
@@ -1541,12 +1504,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp single
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'single' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // MASTER DIRECTIVE
 #pragma omp master
@@ -1755,12 +1712,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp master
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'master' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // CRITICAL DIRECTIVE
 #pragma omp critical
@@ -1983,12 +1934,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp critical
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'critical' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // PARALLEL FOR DIRECTIVE
 #pragma omp parallel for
@@ -2211,12 +2156,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // PARALLEL FOR SIMD DIRECTIVE
 #pragma omp parallel for simd
@@ -2440,12 +2379,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp parallel for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // PARALLEL SECTIONS DIRECTIVE
 #pragma omp parallel sections
@@ -2657,12 +2590,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp parallel sections
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel sections' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TASK DIRECTIVE
 #pragma omp task
@@ -2821,12 +2748,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp task
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'task' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // ORDERED DIRECTIVE
 #pragma omp ordered
@@ -3056,12 +2977,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp ordered
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'ordered' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // ATOMIC DIRECTIVE
 #pragma omp atomic
@@ -3323,12 +3238,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp ordered
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'ordered' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET DIRECTIVE
 #pragma omp target
@@ -3503,12 +3412,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target
-  { 
-#pragma omp teams distribute simd // OK
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET PARALLEL DIRECTIVE
 #pragma omp target parallel
@@ -3677,12 +3580,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target parallel
-  { 
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET PARALLEL FOR DIRECTIVE
 #pragma omp target parallel for
@@ -3905,12 +3802,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }    
-#pragma omp target parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }    
 
 // TEAMS DIRECTIVE
 #pragma omp teams // expected-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
@@ -4125,13 +4016,6 @@ void foo() {
   for (int i = 0; i < 10; ++i)
     ;
   }
-#pragma omp target
-#pragma omp teams
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-  for (int i = 0; i < 10; ++i)
-    ;
-  }
 
 // TASKLOOP DIRECTIVE
 #pragma omp taskloop
@@ -4345,12 +4229,6 @@ void foo() {
   for (int j = 0; j < 10; ++j)
     ++a;
   }
-#pragma omp taskloop
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'taskloop' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-  for (int j = 0; j < 10; ++j)
-    ++a;
-  }
 
 // DISTRIBUTE DIRECTIVE
 #pragma omp target
@@ -4592,14 +4470,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'distribute' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // DISTRIBUTE PARALLEL FOR DIRECTIVE
 #pragma omp target
@@ -4849,14 +4719,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'distribute parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
 #pragma omp target
@@ -5114,14 +4976,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ++a;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute parallel for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
 
 // TARGET SIMD DIRECTIVE
 #pragma omp target simd
@@ -5315,14 +5169,8 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ++a;
   }
-#pragma omp target simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
 
- // TEAMS DISTRIBUTE DIRECTIVE
+// TEAMS DISTRIBUTE DIRECTIVE
 #pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
   for (int i = 0; i < 10; ++i)
     ;
@@ -5549,556 +5397,79 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ++a;
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
+}
 
- // TEAMS DISTRIBUTE DIRECTIVE
-#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+void foo() {
+  int a = 0;
+// PARALLEL DIRECTIVE
+#pragma omp parallel
+#pragma omp for
   for (int i = 0; i < 10; ++i)
     ;
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+#pragma omp simd
+  for (int i = 0; i < 10; ++i)
+    ;
+#pragma omp parallel
+#pragma omp for simd
+  for (int i = 0; i < 10; ++i)
+    ;
+#pragma omp parallel
+#pragma omp sections
+  {
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+#pragma omp section // expected-error {{'omp section' directive must be closely nested to a sections region, not a parallel region}}
+  {
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for // OK
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+#pragma omp sections
+  {
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp simd // OK
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+#pragma omp single
+  bar();
+#pragma omp parallel
+#pragma omp master
+  bar();
+#pragma omp parallel
+#pragma omp critical
+  bar();
+#pragma omp parallel
+#pragma omp parallel for
+  for (int i = 0; i < 10; ++i)
+    ;
+#pragma omp parallel
+#pragma omp parallel for simd
+  for (int i = 0; i < 10; ++i)
+    ;
+#pragma omp parallel
+#pragma omp parallel sections
+  {
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for simd // OK
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+#pragma omp task
+  {
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // OK
-    for (int i = 0; i < 10; ++i)
-      ;
+#pragma omp parallel
+  {
+#pragma omp taskyield
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp sections // OK
-    {
-      bar();
-    }
+#pragma omp parallel
+  {
+#pragma omp barrier
+    bar();
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp section // expected-error {{'omp section' directive must be closely nested to a sections region, not a teams distribute region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp single // OK
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp master // OK
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp critical // OK
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // OK
-    {
-#pragma omp single
-      {
-       bar();
-      }
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for // OK
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for simd // OK
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel sections // OK
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp task // OK
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskyield // OK
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp barrier // OK
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskwait // OK
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp flush // OK
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp ordered // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp ordered' directive into a for or a parallel for region with 'ordered' clause?}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // OK
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target // expected-error {{region cannot be nested inside 'target' region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel  // expected-error {{region cannot be nested inside 'target' region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel for // expected-error {{region cannot be nested inside 'target' region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target enter data map(to: a) // expected-error {{region cannot be nested inside 'target' region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target exit data map(from: a) // expected-error {{region cannot be nested inside 'target' region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp teams' directive into a target region?}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target update to(a) // expected-error {{region cannot be nested inside 'target' region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target simd // expected-error {{region cannot be nested inside 'target' region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp teams distribute' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-
-// TEAMS DISTRIBUTE SIMD DIRECTIVE
-#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp section // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp single // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp master // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-#pragma omp single
-      {
-       bar();
-      }
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp task // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel  // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target enter data map(to: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target exit data map(from: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target update to(a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-}
-
-void foo() {
-  int a = 0;
-// PARALLEL DIRECTIVE
-#pragma omp parallel
-#pragma omp for
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp parallel
-#pragma omp simd
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp parallel
-#pragma omp for simd
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp parallel
-#pragma omp sections
-  {
-    bar();
-  }
-#pragma omp parallel
-#pragma omp section // expected-error {{'omp section' directive must be closely nested to a sections region, not a parallel region}}
-  {
-    bar();
-  }
-#pragma omp parallel
-#pragma omp sections
-  {
-    bar();
-  }
-#pragma omp parallel
-#pragma omp single
-  bar();
-#pragma omp parallel
-#pragma omp master
-  bar();
-#pragma omp parallel
-#pragma omp critical
-  bar();
-#pragma omp parallel
-#pragma omp parallel for
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp parallel
-#pragma omp parallel for simd
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp parallel
-#pragma omp parallel sections
-  {
-    bar();
-  }
-#pragma omp parallel
-#pragma omp task
-  {
-    bar();
-  }
-#pragma omp parallel
-  {
-#pragma omp taskyield
-    bar();
-  }
-#pragma omp parallel
-  {
-#pragma omp barrier
-    bar();
-  }
-#pragma omp parallel
-  {
-#pragma omp taskwait
-    bar();
+#pragma omp parallel
+  {
+#pragma omp taskwait
+    bar();
   }
 #pragma omp parallel
   {
@@ -6191,12 +5562,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp parallel
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // SIMD DIRECTIVE
 #pragma omp simd
@@ -6385,12 +5750,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // FOR DIRECTIVE
 #pragma omp for
@@ -6599,12 +5958,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // FOR SIMD DIRECTIVE
 #pragma omp for simd
@@ -6793,12 +6146,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // SECTIONS DIRECTIVE
 #pragma omp sections
@@ -6996,12 +6343,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp sections
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'sections' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // SECTION DIRECTIVE
 #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}}
@@ -7293,13 +6634,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp sections
-  {
-#pragma omp section
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // SINGLE DIRECTIVE
 #pragma omp single
@@ -7498,12 +6832,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp single
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'single' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // MASTER DIRECTIVE
 #pragma omp master
@@ -7712,12 +7040,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp master
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'master' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // CRITICAL DIRECTIVE
 #pragma omp critical
@@ -7945,12 +7267,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp critical
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'critical' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // PARALLEL FOR DIRECTIVE
 #pragma omp parallel for
@@ -8174,12 +7490,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // PARALLEL FOR SIMD DIRECTIVE
 #pragma omp parallel for simd
@@ -8403,12 +7713,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp parallel for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // PARALLEL SECTIONS DIRECTIVE
 #pragma omp parallel sections
@@ -8616,12 +7920,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp parallel sections
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel sections' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TASK DIRECTIVE
 #pragma omp task
@@ -8779,12 +8077,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp task
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'task' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // ATOMIC DIRECTIVE
 #pragma omp atomic
@@ -9045,14 +8337,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp atomic
-  // expected-error@+2 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
-  // expected-note@+1 {{expected an expression statement}}
-  {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET DIRECTIVE
 #pragma omp target
@@ -9208,25 +8492,19 @@ void foo() {
   }
 #pragma omp target
   { 
-#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-  { 
-#pragma omp target simd // expected-error {{region cannot be nested inside 'target' region}}
+#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
     for (int i = 0; i < 10; ++i)
       ;
   }
 #pragma omp target
   { 
-#pragma omp teams distribute // OK
+#pragma omp target simd // expected-error {{region cannot be nested inside 'target' region}}
     for (int i = 0; i < 10; ++i)
       ;
   }
 #pragma omp target
   { 
-#pragma omp teams distribute simd // OK
+#pragma omp teams distribute // OK
     for (int i = 0; i < 10; ++i)
       ;
   }
@@ -9398,12 +8676,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target parallel
-  { 
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET PARALLEL FOR DIRECTIVE
 #pragma omp target parallel for
@@ -9627,12 +8899,6 @@ void foo() {
     for (int j = 0; j < 10; ++j)
       ;
   }
-#pragma omp target parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int j = 0; j < 10; ++j)
-      ;
-  }
 
 // TEAMS DIRECTIVE
 #pragma omp target
@@ -9849,13 +9115,6 @@ void foo() {
   for (int i = 0; i < 10; ++i)
     ;
   }
-#pragma omp target
-#pragma omp teams
-  {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-  for (int i = 0; i < 10; ++i)
-    ;
-  }
 
 // TASKLOOP DIRECTIVE
 #pragma omp taskloop
@@ -10069,12 +9328,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp taskloop
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'taskloop' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // DISTRIBUTE DIRECTIVE
 #pragma omp target
@@ -10592,14 +9845,6 @@ void foo() {
   for (int i = 0; i < 10; ++i)
     ++a;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute parallel for
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'distribute parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-  for (int i = 0; i < 10; ++i)
-    ++a;
-  }
 
 // DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
 #pragma omp target
@@ -10850,14 +10095,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute parallel for simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // DISTRIBUTE SIMD DIRECTIVE
 #pragma omp target
@@ -11108,14 +10345,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TARGET SIMD DIRECTIVE
 #pragma omp target simd
@@ -11303,12 +10532,6 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ;
   }
-#pragma omp target simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
 
 // TEAMS DISTRIBUTE DIRECTIVE
 #pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
@@ -11537,247 +10760,5 @@ void foo() {
     for (int i = 0; i < 10; ++i)
       ++a;
   }
-#pragma omp target
-#pragma omp teams distribute
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'teams distribute' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-
-// TEAMS DISTRIBUTE SIMD DIRECTIVE
-#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
-  for (int i = 0; i < 10; ++i)
-    ;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp sections // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp section // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp single // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp master // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-#pragma omp single
-      {
-       bar();
-      }
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel for simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp task // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    {
-      bar();
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskyield // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp barrier // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp taskwait // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp flush // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    bar();
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel  // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target parallel for // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target enter data map(to: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target exit data map(from: a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target update to(a) // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp target simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-#pragma omp teams distribute simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
-    for (int i = 0; i < 10; ++i)
-      ++a;
-  }
   return foo<int>();
 }
diff --git a/test/OpenMP/teams_distribute_simd_aligned_messages.cpp b/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
deleted file mode 100644 (file)
index 3a73904..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
-
-struct B {
-  static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-  static constexpr int bfoo() { return 8; }
-};
-namespace X {
-  B x; // expected-note {{'x' defined here}}
-};
-constexpr int bfoo() { return 4; }
-
-int **z;
-const int C1 = 1;
-const int C2 = 2;
-void test_aligned_colons(int *&rp)
-{
-  int *B = 0;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B:bfoo())
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B::ib:B:bfoo()) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B:B::bfoo())
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(z:B:bfoo()) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B:B::bfoo())
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(X::x : ::z) // expected-error {{integral constant expression must have integral or unscoped enumeration type, not 'int **'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'B'}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B,rp,::z: X::x) // expected-error {{integral constant expression must have integral or unscoped enumeration type, not 'B'}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(::z)
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B::bfoo()) // expected-error {{expected variable name}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(B::ib,B:C1+C2) // expected-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
-  for (int i = 0; i < 10; ++i) ;
-}
-
-// expected-note@+1 {{'num' defined here}}
-template<int L, class T, class N> T test_template(T* arr, N num) {
-  N i;
-  T sum = (T)0;
-  T ind2 = - num * L;
-  // Negative number is passed as L.
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(arr:L) // expected-error {{argument to 'aligned' clause must be a strictly positive integer value}}
-  for (i = 0; i < num; ++i) {
-    T cur = arr[(int)ind2];
-    ind2 += L;
-    sum += cur;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(num:4) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
-  for (i = 0; i < num; ++i);
-
-  return T();
-}
-
-template<int LEN> int test_warn() {
-  int *ind2 = 0;
-#pragma omp target
-#pragma omp teams distribute simd aligned(ind2:LEN) // expected-error {{argument to 'aligned' clause must be a strictly positive integer value}}
-  for (int i = 0; i < 100; i++) {
-    ind2 += LEN;
-  }
-  return 0;
-}
-
-struct S1; // expected-note 2 {{declared here}}
-extern S1 a; // expected-note {{'a' declared here}}
-class S2 {
-  mutable int a;
-public:
-  S2():a(0) { }
-};
-const S2 b; // expected-note 1 {{'b' defined here}}
-const S2 ba[5];
-class S3 {
-  int a;
-public:
-  S3():a(0) { }
-};
-const S3 ca[5];
-class S4 {
-  int a;
-  S4();
-public:
-  S4(int v):a(v) { }
-};
-class S5 {
-  int a;
-  S5():a(0) {}
-public:
-  S5(int v):a(v) { }
-};
-
-S3 h; // expected-note 2 {{'h' defined here}}
-#pragma omp threadprivate(h)
-
-template<class I, class C> int foomain(I argc, C **argv) {
-  I e(argc);
-  I g(argc);
-  int i; // expected-note {{declared here}} expected-note {{'i' defined here}}
-  // expected-note@+2 {{declared here}}
-  // expected-note@+1 {{reference to 'i' is not a constant expression}}
-  int &j = i;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned // expected-error {{expected '(' after 'aligned'}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned () // expected-error {{expected expression}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argc : 5) // expected-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argv[1]) // expected-error {{expected variable name}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(e, g)
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(h) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(i) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
-  for (I k = 0; k < argc; ++k) ++k;
-
-  #pragma omp parallel
-  {
-    int *v = 0;
-    I i;
-    #pragma omp target
-    #pragma omp teams distribute simd aligned(v:16)
-      for (I k = 0; k < argc; ++k) { i = k; v += 2; }
-  }
-  float *f;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(f)
-  for (I k = 0; k < argc; ++k) ++k;
-
-  int v = 0;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(f:j) // expected-note {{initializer of 'j' is not a constant expression}} expected-error {{expression is not an integral constant expression}}
-
-  for (I k = 0; k < argc; ++k) { ++k; v += j; }
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(f)
-  for (I k = 0; k < argc; ++k) ++k;
-
-  return 0;
-}
-
-// expected-note@+1 2 {{'argc' defined here}}
-int main(int argc, char **argv) {
-  double darr[100];
-  // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
-  test_template<-4>(darr, 4);
-  test_warn<4>(); // ok
-  // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
-  test_warn<0>();
-
-  int i;
-  int &j = i;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned // expected-error {{expected '(' after 'aligned'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned () // expected-error {{expected expression}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argv // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute simd aligned (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams
-#pragma omp distribute simd aligned (argc) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned (argv[1]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd aligned(h)  // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  int *pargc = &argc;
-  // expected-note@+1 {{in instantiation of function template specialization 'foomain<int *, char>' requested here}}
-  foomain<int*,char>(pargc,argv);
-  return 0;
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_ast_print.cpp b/test/OpenMP/teams_distribute_simd_ast_print.cpp
deleted file mode 100644 (file)
index 5b988ee..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
-// 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
-// expected-no-diagnostics
-
-#ifndef HEADER
-#define HEADER
-
-void foo() {}
-
-struct S {
-  S(): a(0) {}
-  S(int v) : a(v) {}
-  int a;
-  typedef int type;
-};
-
-template <typename T>
-class S7 : public T {
-protected:
-  T a;
-  S7() : a(0) {}
-
-public:
-  S7(typename T::type v) : a(v) {
-#pragma omp target
-#pragma omp teams distribute simd private(a) private(this->a) private(T::a)
-    for (int k = 0; k < a.a; ++k)
-      ++this->a.a;
-  }
-  S7 &operator=(S7 &s) {
-#pragma omp target
-#pragma omp teams distribute simd private(a) private(this->a)
-    for (int k = 0; k < s.a.a; ++k)
-      ++s.a.a;
-    return *this;
-  }
-  void foo() {
-    int b, argv, d, c, e, f;
-#pragma omp target
-#pragma omp teams distribute simd default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
-    for (int k = 0; k < a.a; ++k)
-      ++a.a;
-  }
-  void bar() {
-    int arr[10];
-    const int alen = 16;
-    const int slen1 = 8;
-    const int slen2 = 8;
-#pragma omp target
-#pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr:alen)
-    for (int k = 0; k < a.a; ++k)
-      ++a.a;
-  }
-};
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(this->S::a)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(T::a)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
-
-class S8 : public S7<S> {
-  S8() {}
-
-public:
-  S8(int v) : S7<S>(v){
-#pragma omp target
-#pragma omp teams distribute simd private(a) private(this->a) private(S7<S>::a) 
-    for (int k = 0; k < a.a; ++k)
-      ++this->a.a;
-  }
-  S8 &operator=(S8 &s) {
-#pragma omp target
-#pragma omp teams distribute simd private(a) private(this->a)
-    for (int k = 0; k < s.a.a; ++k)
-      ++s.a.a;
-    return *this;
-  }
-  void bar() {
-    int b, argv, d, c, e, f;
-#pragma omp target
-#pragma omp teams distribute simd default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
-    for (int k = 0; k < a.a; ++k)
-      ++a.a;
-  }
-  void foo() {
-    const int alen = 16;
-    const int slen1 = 8;
-    const int slen2 = 8;
-    int arr[10];
-#pragma omp target
-#pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr:alen)
-    for (int k = 0; k < a.a; ++k)
-      ++a.a;
-  }
-};
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(this->S7<S>::a)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
-
-template <class T, int N>
-T tmain(T argc) {
-  T b = argc, c, d, e, f, g;
-  static T a;
-// CHECK: static T a;
-  const T clen = 5;
-  const T alen = 16;
-  int arr[10];
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i=0; i < 2; ++i)
-    a = 2;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd
-// CHECK-NEXT: for (int i = 0; i < 2; ++i)
-// CHECK-NEXT: a = 2;
-#pragma omp target
-#pragma omp teams distribute simd private(argc, b), firstprivate(c, d), collapse(2)
-  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 simd private(argc,b) firstprivate(c,d) collapse(2)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: for (int j = 0; j < 10; ++j)
-// CHECK-NEXT: foo();
-  for (int i = 0; i < 10; ++i)
-    foo();
-// CHECK: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i)
-    foo();
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();  
-#pragma omp target
-#pragma omp teams distribute simd default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
-    for (int k = 0; k < 10; ++k)
-      e += d + argc;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argc) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc;
-#pragma omp target
-#pragma omp teams distribute simd simdlen(clen-1) linear(d)
-  for (int k = 0; k < 10; ++k)
-    e += d + argc;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd simdlen(clen - 1) linear(d)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc;
-#pragma omp target
-#pragma omp teams distribute simd safelen(clen-1) aligned(arr:alen)
-  for (int k = 0; k < 10; ++k)
-    e += d + argc + arr[k];
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: alen)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc + arr[k];
-  return T();
-}
-
-int main (int argc, char **argv) {
-  int b = argc, c, d, e, f, g;
-  static int a;
-// CHECK: static int a;
-  const int clen = 5;
-  const int N = 10;
-  int arr[10];
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i=0; i < 2; ++i)
-    a = 2;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd
-// CHECK-NEXT: for (int i = 0; i < 2; ++i)
-// CHECK-NEXT: a = 2;
-#pragma omp target
-#pragma omp teams distribute simd private(argc,b),firstprivate(argv, c), collapse(2)
-  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 simd private(argc,b) firstprivate(argv,c) collapse(2)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: for (int j = 0; j < 10; ++j)
-// CHECK-NEXT: foo();
-  for (int i = 0; i < 10; ++i)
-    foo();
-// CHECK: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i)foo();
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();
-#pragma omp target
-#pragma omp teams distribute simd default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
-  for (int k = 0; k < 10; ++k)
-    e += d + argc;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argc) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc;
-#pragma omp target
-#pragma omp teams distribute simd simdlen(clen-1) linear(d)
-  for (int k = 0; k < 10; ++k)
-    e += d + argc;
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd simdlen(clen - 1) linear(d)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc;
-#pragma omp target
-#pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6)
-  for (int k = 0; k < 10; ++k)
-    e += d + argc + arr[k];
-// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6)
-// CHECK-NEXT: for (int k = 0; k < 10; ++k)
-// CHECK-NEXT: e += d + argc + arr[k];
-  return (0);
-}
-
-#endif
diff --git a/test/OpenMP/teams_distribute_simd_collapse_messages.cpp b/test/OpenMP/teams_distribute_simd_collapse_messages.cpp
deleted file mode 100644 (file)
index f3983b3..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}}
-
-template <class T, typename S, int N, int ST> // expected-note {{declared here}}
-T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
-#pragma omp target
-#pragma omp teams distribute simd collapse // expected-error {{expected '(' after 'collapse'}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-#pragma omp target
-#pragma omp teams distribute simd collapse () // expected-error {{expected expression}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-// expected-error@+4 {{expected ')'}} expected-note@+4 {{to match this '('}}
-// expected-error@+3 2 {{expression is not an integral constant expression}}
-// expected-note@+2 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (argc 
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute simd', but found only 1}}
-
-// expected-error@+4 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}}
-// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
-// expected-error@+2 2 {{expression is not an integral constant expression}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (foobool(argc)), collapse (true), collapse (-5)
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp distribute collapse (S) // expected-error {{'S' does not refer to a value}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-// expected-error@+2 2 {{expression is not an integral constant expression}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (1)
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
-  for (T i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
-  foo(); // expected-error {{expected 2 for loops after '#pragma omp teams distribute simd'}}
-  return argc;
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd collapse // expected-error {{expected '(' after 'collapse'}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse () // expected-error {{expected expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute simd', but found only 1}}
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}  expected-note {{as specified in 'collapse' clause}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute simd', but found only 1}}
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-// expected-error@+4 {{expression is not an integral constant expression}}
-// expected-error@+3 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}}
-// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (foobool(argc)), collapse (true), collapse (-5) 
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-// expected-error@+2 {{expression is not an integral constant expression}}
-#pragma omp target
-#pragma omp teams distribute simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-// expected-error@+4 {{statement after '#pragma omp teams distribute simd' must be a for loop}}
-// expected-note@+2 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
-#pragma omp target
-#pragma omp teams distribute simd collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
-  foo();
-
-#pragma omp target
-#pragma omp teams distribute simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
-  foo(); // expected-error {{expected 2 for loops after '#pragma omp teams distribute simd'}}
-
-// expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
-  return tmain<int, char, 1, 0>(argc, argv);
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_default_messages.cpp b/test/OpenMP/teams_distribute_simd_default_messages.cpp
deleted file mode 100644 (file)
index a6685b9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo();
-
-int main(int argc, char **argv) {
-  #pragma omp target
-  #pragma omp teams distribute simd default // expected-error {{expected '(' after 'default'}}
-  for (int i=0; i<200; i++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<200; i++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
-  for (int i=0; i<200; i++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<200; i++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd default (shared), default(shared) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'default' clause}}
-  for (int i=0; i<200; i++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
-  for (int i=0; i<200; i++) foo();
-
-  #pragma omp target
-  #pragma omp teams distribute simd default(none)
-  for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
-
-  return 0;
-}
diff --git a/test/OpenMP/teams_distribute_simd_dist_schedule_messages.cpp b/test/OpenMP/teams_distribute_simd_dist_schedule_messages.cpp
deleted file mode 100644 (file)
index 5274204..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}} expected-note {{declared here}}
-
-template <class T, int N>
-T tmain(T argc) {
-  T b = argc, c, d, e, f, g;
-  char ** argv;
-  static T a;
-// CHECK: static T a;
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule () // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (argc)) // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error3 {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-  return T();
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule () // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (argc)) // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i = 0; i < 10; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static, argv[1]=2) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 0; i < 10; ++i) foo();
-
-  return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0])); // expected-note {{in instantiation of function template specialization 'tmain<int, 5>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<char, 1>' requested here}}
-}
diff --git a/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
deleted file mode 100644 (file)
index 324672c..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
-extern S1 a;
-class S2 {
-  mutable int a;
-  
-public:
-  S2() : a(0) {}
-  S2(const S2 &s2) : a(s2.a) {}
-  static float S2s;
-  static const float S2sc;
-};
-const float S2::S2sc = 0;
-const S2 b;
-const S2 ba[5];
-class S3 {
-  int a;
-  S3 &operator=(const S3 &s3);
-  
-public:
-  S3() : a(0) {} // expected-note {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
-  S3(S3 &s3) : a(s3.a) {} // expected-note {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
-};
-const S3 c;
-const S3 ca[5];
-extern const int f;
-class S4 {
-  int a;
-  S4();
-  S4(const S4 &s4);
-public:
-  S4(int v):a(v) { }
-};
-class S5 {
-  int a;
-  S5():a(0) {}
-  S5(const S5 &s5):a(s5.a) { }
-public:
-  S5(int v):a(v) { }
-};
-class S6 {
-  int a;
-public:
-  S6() : a(0) { }
-};
-
-S3 h;
-#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
-
-int main(int argc, char **argv) {
-  const int d = 5;
-  const int da[5] = { 0 };
-  S4 e(4);
-  S5 g(5);
-  S6 p;
-  int i;
-  int &j = i;
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate () // expected-error {{expected expression}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (argc)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (S1) // expected-error {{'S1' does not refer to a value}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate (argv[1]) // expected-error {{expected variable name}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(ba)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(da)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(S2::S2s)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(S2::S2sc)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note 2 {{defined as private}}
-  for (i = 0; i < argc; ++i) foo(); // expected-error {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be private, predetermined as linear}}
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(i)
-  for (j = 0; j < argc; ++j) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(i) // expected-note {{defined as firstprivate}}
-  for (i = 0; i < argc; ++i) foo(); // expected-error {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be firstprivate, predetermined as linear}}
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(j)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc), firstprivate(argc) // OK
-  for (i = 0; i < argc; ++i) foo();
-
-  return 0;
-}
diff --git a/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
deleted file mode 100644 (file)
index 4c715bf..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
-extern S1 a;
-class S2 {
-  mutable int a;
-
-public:
-  S2() : a(0) {}
-  S2(S2 &s2) : a(s2.a) {}
-  const S2 &operator =(const S2&) const;
-  S2 &operator =(const S2&);
-  static float S2s; // expected-note {{static data member is predetermined as shared}}
-  static const float S2sc;
-};
-const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
-const S2 b;
-const S2 ba[5];
-class S3 {
-  int a;
-  S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}}
-
-public:
-  S3() : a(0) {}
-  S3(S3 &s3) : a(s3.a) {}
-};
-const S3 c;         // expected-note {{global variable is predetermined as shared}}
-const S3 ca[5];     // expected-note {{global variable is predetermined as shared}}
-extern const int f; // expected-note {{global variable is predetermined as shared}}
-class S4 {
-  int a;
-  S4();             // expected-note 3 {{implicitly declared private here}}
-  S4(const S4 &s4);
-
-public:
-  S4(int v) : a(v) {}
-};
-class S5 {
-  int a;
-  S5() : a(0) {} // expected-note {{implicitly declared private here}}
-
-public:
-  S5(const S5 &s5) : a(s5.a) {}
-  S5(int v) : a(v) {}
-};
-class S6 {
-  int a;
-  S6() : a(0) {}
-
-public:
-  S6(const S6 &s6) : a(s6.a) {}
-  S6(int v) : a(v) {}
-};
-
-S3 h;
-#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
-
-template <class I, class C>
-int foomain(int argc, char **argv) {
-  I e(4);
-  I g(5);
-  int i;
-  int &j = i;
-#pragma omp target
-#pragma omp teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate() // expected-error {{expected expression}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argv[1]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  int v = 0;
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(i)
-  for (int k = 0; k < argc; ++k) {
-    i = k;
-    v += i;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(j) private(i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  return 0;
-}
-
-void bar(S4 a[2]) {
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(a)
-  for (int i = 0; i < 2; ++i) foo();
-}
-
-namespace A {
-double x;
-#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
-}
-namespace B {
-using A::x;
-}
-
-int main(int argc, char **argv) {
-  const int d = 5;       // expected-note {{constant variable is predetermined as shared}}
-  const int da[5] = {0}; // expected-note {{constant variable is predetermined as shared}}
-  S4 e(4);
-  S5 g(5);
-  S3 m;
-  S6 n(2);
-  int i;
-  int &j = i;
-#pragma omp target
-#pragma omp teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate() // expected-error {{expected expression}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argc)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(argv[1]) // expected-error {{expected variable name}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(2 * 2) // expected-error {{expected variable name}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(ba)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(ca) // expected-error {{shared variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(da) // expected-error {{shared variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-  int xa;
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(xa) // OK
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(S2::S2sc) // expected-error {{shared variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(xa)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(j)
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
-  for (i = 0; i < argc; ++i) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(n) firstprivate(n) // OK
-  for (i = 0; i < argc; ++i) foo();
-
-  static int si;
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(si) // OK
-  for (i = 0; i < argc; ++i) si = i + 1;
-
-  return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
-}
diff --git a/test/OpenMP/teams_distribute_simd_linear_messages.cpp b/test/OpenMP/teams_distribute_simd_linear_messages.cpp
deleted file mode 100644 (file)
index 6bfdb16..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-namespace X {
-  int x;
-};
-
-struct B {
-  static int ib; // expected-note {{'B::ib' declared here}}
-  static int bfoo() { return 8; }
-};
-
-int bfoo() { return 4; }
-
-int z;
-const int C1 = 1;
-const int C2 = 2;
-void test_linear_colons()
-{
-  int B = 0;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B:bfoo())
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B::ib:B:bfoo()) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B:ib) // expected-error {{use of undeclared identifier 'ib'; did you mean 'B::ib'}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(z:B:ib) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B:B::bfoo())
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(X::x : ::z)
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B,::z, X::x)
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(::z)
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B::bfoo()) // expected-error {{expected variable name}}
-  for (int i = 0; i < 10; ++i) ;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(B::ib,B:C1+C2)
-  for (int i = 0; i < 10; ++i) ;
-}
-
-template<int L, class T, class N> T test_template(T* arr, N num) {
-  N i;
-  T sum = (T)0;
-  T ind2 = - num * L; // expected-note {{'ind2' defined here}}
-
-#pragma omp target
-#pragma omp teams distribute simd linear(ind2:L) // expected-error {{argument of a linear clause should be of integral or pointer type}}
-  for (i = 0; i < num; ++i) {
-    T cur = arr[(int)ind2];
-    ind2 += L;
-    sum += cur;
-  }
-  return T();
-}
-
-template<int LEN> int test_warn() {
-  int ind2 = 0;
-  #pragma omp target
-  #pragma omp teams distribute simd linear(ind2:LEN) // expected-warning {{zero linear step (ind2 should probably be const)}}
-  for (int i = 0; i < 100; i++) {
-    ind2 += LEN;
-  }
-  return ind2;
-}
-
-struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
-extern S1 a;
-class S2 {
-  mutable int a;
-public:
-  S2():a(0) { }
-};
-const S2 b; // expected-note 2 {{'b' defined here}}
-const S2 ba[5];
-class S3 {
-  int a;
-public:
-  S3():a(0) { }
-};
-const S3 ca[5];
-class S4 {
-  int a;
-  S4();
-public:
-  S4(int v):a(v) { }
-};
-class S5 {
-  int a;
-  S5():a(0) {}
-public:
-  S5(int v):a(v) { }
-};
-
-S3 h;
-#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
-
-template<class I, class C> int foomain(I argc, C **argv) {
-  I e(4);
-  I g(5);
-  int i;
-  int &j = i;
-
-#pragma omp target
-#pragma omp teams distribute simd linear // expected-error {{expected '(' after 'linear'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear () // expected-error {{expected expression}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc : 5)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argv[1]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(e, g)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp parallel
-  {
-    int v = 0;
-    int i;
-    #pragma omp target
-    #pragma omp teams distribute simd linear(v:i)
-    for (int k = 0; k < argc; ++k) { i = k; v += i; }
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd linear(j)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  int v = 0;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(v:j)
-  for (int k = 0; k < argc; ++k) { ++k; v += j; }
-
-#pragma omp target
-#pragma omp teams distribute simd linear(i)
-  for (int k = 0; k < argc; ++k) ++k;
-  return 0;
-}
-
-namespace A {
-double x;
-#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
-}
-namespace C {
-using A::x;
-}
-
-int main(int argc, char **argv) {
-  double darr[100];
-  // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
-  test_template<-4>(darr, 4);
-  // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
-  test_warn<0>();
-
-  S4 e(4); // expected-note {{'e' defined here}}
-  S5 g(5); // expected-note {{'g' defined here}}
-  int i;
-  int &j = i;
-
-#pragma omp target
-#pragma omp teams distribute simd linear // expected-error {{expected '(' after 'linear'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear () // expected-error {{expected expression}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argc)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-
-#pragma omp target
-#pragma omp teams distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear (argv[1]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(h, C::x) // expected-error 2 {{threadprivate or thread local variable cannot be linear}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp parallel
-  {
-    int i;
-    #pragma omp target
-    #pragma omp teams distribute simd linear(i)
-      for (int k = 0; k < argc; ++k) ++k;
-
-    #pragma omp target
-    #pragma omp teams distribute simd linear(i : 4)
-      for (int k = 0; k < argc; ++k) { ++k; i += 4; }
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd linear(j)
-  for (int k = 0; k < argc; ++k) ++k;
-
-#pragma omp target
-#pragma omp teams distribute simd linear(i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  foomain<int,char>(argc,argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
-  return 0;
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_loop_messages.cpp b/test/OpenMP/teams_distribute_simd_loop_messages.cpp
deleted file mode 100644 (file)
index 742bc74..0000000
+++ /dev/null
@@ -1,716 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
-
-class S {
-  int a;
-  S() : a(0) {}
-
-public:
-  S(int v) : a(v) {}
-  S(const S &s) : a(s.a) {}
-};
-
-static int sii;
-// expected-note@+1 {{defined as threadprivate or thread local}}
-#pragma omp threadprivate(sii)
-static int globalii;
-
-int test_iteration_spaces() {
-  const int N = 100;
-  float a[N], b[N], c[N];
-  int ii, jj, kk;
-  float fii;
-  double dii;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; i += 1) {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (char i = 0; i < 10; i++) {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (char i = 0; i < 10; i += '\1') {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (long long i = 0; i < 10; i++) {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{expression must have integral or unscoped enumeration type, not 'double'}}
-  for (long long i = 0; i < 10; i += 1.5) {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-  for (long long i = 0; i < 'z'; i += 1u) {
-    c[i] = a[i] + b[i];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{variable must be of integer or random access iterator type}}
-  for (float fi = 0; fi < 10.0; fi++) {
-    c[(int)fi] = a[(int)fi] + b[(int)fi];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{variable must be of integer or random access iterator type}}
-  for (double fi = 0; fi < 10.0; fi++) {
-    c[(int)fi] = a[(int)fi] + b[(int)fi];
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (int &ref = ii; ref < 10; ref++) {
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (int i; i < 10; i++)
-    c[i] = a[i];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (int i = 0, j = 0; i < 10; ++i)
-    c[i] = a[i];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (; ii < 10; ++ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+2 {{expression result unused}}
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (ii + 1; ii < 10; ++ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (c[ii] = 0; ii < 10; ++ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// Ok to skip parenthesises.
-  for (((ii)) = 0; ii < 10; ++ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
-  for (int i = 0; i; i++)
-    c[i] = a[i];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-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
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
-  for (int i = 0; !!i; i++)
-    c[i] = a[i];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
-  for (int i = 0; i != 1; i++)
-    c[i] = a[i];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
-  for (int i = 0;; i++)
-    c[i] = a[i];
-
-// Ok.
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 11; i > 10; i--)
-    c[i] = a[i];
-
-// Ok.
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i)
-    c[i] = a[i];
-
-// Ok.
-#pragma omp target
-#pragma omp teams distribute simd
-  for (ii = 0; ii < 10; ++ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; ++jj)
-    c[ii] = a[jj];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; ++++ii)
-    c[ii] = a[ii];
-
-// Ok but undefined behavior (in general, cannot check that incr
-// is really loop-invariant).
-#pragma omp target
-#pragma omp teams distribute simd
-  for (ii = 0; ii < 10; ii = ii + ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{expression must have integral or unscoped enumeration type, not 'float'}}
-  for (ii = 0; ii < 10; ii = ii + 1.0f)
-    c[ii] = a[ii];
-
-// Ok - step was converted to integer type.
-#pragma omp target
-#pragma omp teams distribute simd
-  for (ii = 0; ii < 10; ii = ii + (int)1.1f)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; jj = ii + 2)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+2 {{relational comparison result unused}}
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii<10; jj> kk + 2)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10;)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+2 {{expression result unused}}
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; !ii)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; ii ? ++ii : ++jj)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
-  for (ii = 0; ii < 10; ii = ii < 10)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; ii < 10; ii = ii + 0)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; (ii) < 10; ii -= 25)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; (ii < 10); ii -= 0)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
-  for (ii = 0; ii > 10; (ii += 0))
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
-  for ((ii = 0); ii > 10; (ii -= 0))
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
-  for (ii = 0; (ii < 10); (ii -= 0))
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd firstprivate(ii) // expected-note {{defined as firstprivate}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be firstprivate, predetermined as linear}}
-  for (ii = 0; ii < 10; ii++)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd private(ii) // expected-note {{defined as private}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be private, predetermined as linear}}
-  for (ii = 0; ii < 10; ii++)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(ii) // expected-note {{defined as lastprivate}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be lastprivate, predetermined as linear}}
-  for (ii = 0; ii < 10; ii++)
-    c[ii] = a[ii];
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be threadprivate or thread local, predetermined as linear}}
-  for (sii = 0; sii < 10; sii++)
-    c[sii] = a[sii];
-
-  {
-#pragma omp target
-#pragma omp teams distribute simd collapse(2)
-  for (ii = 0; ii < 10; ii += 1)
-    for (globalii = 0; globalii < 10; globalii += 1)
-      c[globalii] += a[globalii] + ii;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{statement after '#pragma omp teams distribute simd' must be a for loop}}
-  for (auto &item : a) {
-    item = item + 1;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
-  for (unsigned i = 9; i < 10; i--) {
-    c[i] = a[i] + b[i];
-  }
-
-  int(*lb)[4] = nullptr;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int(*p)[4] = lb; p < lb + 8; ++p) {
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (int a{0}; a < 10; ++a) {
-  }
-
-  return 0;
-}
-
-// Iterators allowed in openmp for-loops.
-namespace std {
-struct random_access_iterator_tag {};
-template <class Iter>
-struct iterator_traits {
-  typedef typename Iter::difference_type difference_type;
-  typedef typename Iter::iterator_category iterator_category;
-};
-template <class Iter>
-typename iterator_traits<Iter>::difference_type
-distance(Iter first, Iter last) { return first - last; }
-}
-class Iter0 {
-public:
-  Iter0() {}
-  Iter0(const Iter0 &) {}
-  Iter0 operator++() { return *this; }
-  Iter0 operator--() { return *this; }
-  bool operator<(Iter0 a) { return true; }
-};
-// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
-int operator-(Iter0 a, Iter0 b) { return 0; }
-class Iter1 {
-public:
-  Iter1(float f = 0.0f, double d = 0.0) {}
-  Iter1(const Iter1 &) {}
-  Iter1 operator++() { return *this; }
-  Iter1 operator--() { return *this; }
-  bool operator<(Iter1 a) { return true; }
-  bool operator>=(Iter1 a) { return false; }
-};
-class GoodIter {
-public:
-  GoodIter() {}
-  GoodIter(const GoodIter &) {}
-  GoodIter(int fst, int snd) {}
-  GoodIter &operator=(const GoodIter &that) { return *this; }
-  GoodIter &operator=(const Iter0 &that) { return *this; }
-  GoodIter &operator+=(int x) { return *this; }
-  explicit GoodIter(void *) {}
-  GoodIter operator++() { return *this; }
-  GoodIter operator--() { return *this; }
-  bool operator!() { return true; }
-  bool operator<(GoodIter a) { return true; }
-  bool operator<=(GoodIter a) { return true; }
-  bool operator>=(GoodIter a) { return false; }
-  typedef int difference_type;
-  typedef std::random_access_iterator_tag iterator_category;
-};
-// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
-int operator-(GoodIter a, GoodIter b) { return 0; }
-// expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
-GoodIter operator-(GoodIter a) { return a; }
-// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
-GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
-GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
-// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
-GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
-// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
-GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
-
-int test_with_random_access_iterator() {
-  GoodIter begin, end;
-  Iter0 begin0, end0;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (GoodIter I = begin; I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (GoodIter &I = begin; I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (GoodIter I = begin; I >= end; --I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (GoodIter I(begin); I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (GoodIter I(nullptr); I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (GoodIter I(0); I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (GoodIter I(1, 2); I < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (begin = GoodIter(0); begin < end; ++begin)
-    ++begin;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+2 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
-// expected-error@+1 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
-  for (begin = begin0; begin < end; ++begin)
-    ++begin;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (++begin; begin < end; ++begin)
-    ++begin;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (begin = end; begin < end; ++begin)
-    ++begin;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
-  for (GoodIter I = begin; I - I; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
-  for (GoodIter I = begin; begin < end; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
-  for (GoodIter I = begin; !I; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (GoodIter I = begin; I >= end; I = I + 1)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-  for (GoodIter I = begin; I >= end; I = I - 1)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
-  for (GoodIter I = begin; I >= end; I = -I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (GoodIter I = begin; I >= end; I = 2 + I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
-  for (GoodIter I = begin; I >= end; I = 2 - I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+1 {{invalid operands to binary expression ('Iter0' and 'int')}}
-  for (Iter0 I = begin0; I < end0; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// Initializer is constructor without params.
-// expected-error@+2 {{invalid operands to binary expression ('Iter0' and 'int')}}
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (Iter0 I; I < end0; ++I)
-    ++I;
-  Iter1 begin1, end1;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+2 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
-// expected-error@+1 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
-  for (Iter1 I = begin1; I < end1; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (Iter1 I = begin1; I >= end1; ++I)
-    ++I;
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'float')}}
-// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
-// Initializer is constructor with all default params.
-// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
-  for (Iter1 I; I < end1; ++I) {
-  }
-  return 0;
-}
-
-template <typename IT, int ST>
-class TC {
-public:
-  int dotest_lt(IT begin, IT end) {
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
-    for (IT I = begin; I < end; I = I + ST) {
-      ++I;
-    }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be positive due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
-    for (IT I = begin; I <= end; I += ST) {
-      ++I;
-    }
-#pragma omp target
-#pragma omp teams distribute simd
-    for (IT I = begin; I < end; ++I) {
-      ++I;
-    }
-  }
-
-  static IT step() {
-    return IT(ST);
-  }
-};
-template <typename IT, int ST = 0>
-int dotest_gt(IT begin, IT end) {
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (IT I = begin; I >= end; I = I + ST) {
-    ++I;
-  }
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (IT I = begin; I >= end; I += ST) {
-    ++I;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-// expected-note@+2 {{loop step is expected to be negative due to this condition}}
-// expected-error@+1 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
-  for (IT I = begin; I >= end; ++I) {
-    ++I;
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-  for (IT I = begin; I < end; I += TC<int, ST>::step()) {
-    ++I;
-  }
-}
-
-void test_with_template() {
-  GoodIter begin, end;
-  TC<GoodIter, 100> t1;
-  TC<GoodIter, -100> t2;
-  t1.dotest_lt(begin, end);
-  t2.dotest_lt(begin, end);         // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
-  dotest_gt(begin, end);            // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
-  dotest_gt<unsigned, -10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, -10>' requested here}}
-}
-
-void test_loop_break() {
-  const int N = 100;
-  float a[N], b[N], c[N];
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; i++) {
-    c[i] = a[i] + b[i];
-    for (int j = 0; j < 10; ++j) {
-      if (a[i] > b[j])
-        break; // OK in nested loop
-    }
-    switch (i) {
-    case 1:
-      b[i]++;
-      break;
-    default:
-      break;
-    }
-    if (c[i] > 10)
-      break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
-
-    if (c[i] > 11)
-      break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; i++) {
-    for (int j = 0; j < 10; j++) {
-      c[i] = a[i] + b[i];
-      if (c[i] > 10) {
-        if (c[i] < 20) {
-          break; // OK
-        }
-      }
-    }
-  }
-}
-
-void test_loop_eh() {
-  const int N = 100;
-  float a[N], b[N], c[N];
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; i++) {
-    c[i] = a[i] + b[i];
-    try { // expected-error {{'try' statement cannot be used in OpenMP simd region}}
-      for (int j = 0; j < 10; ++j) {
-        if (a[i] > b[j])
-          throw a[i]; // expected-error {{throw' statement cannot be used in OpenMP simd region}}
-      }
-      throw a[i]; // expected-error {{throw' statement cannot be used in OpenMP simd region}}
-    } catch (float f) {
-      if (f > 0.1)
-        throw a[i]; // expected-error {{throw' statement cannot be used in OpenMP simd region}}
-      return; // expected-error {{cannot return from OpenMP region}}
-    }
-    switch (i) {
-    case 1:
-      b[i]++;
-      break;
-    default:
-      break;
-    }
-    for (int j = 0; j < 10; j++) {
-      if (c[i] > 10)
-        throw c[i]; // expected-error {{throw' statement cannot be used in OpenMP simd region}}
-    }
-  }
-  if (c[9] > 10)
-    throw c[9]; // OK
-
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < 10; ++i) {
-    struct S {
-      void g() { throw 0; }
-    };
-  }
-}
-
-void test_loop_firstprivate_lastprivate() {
-  S s(4);
-#pragma omp target
-#pragma omp teams distribute simd lastprivate(s) firstprivate(s)
-  for (int i = 0; i < 16; ++i)
-    ;
-}
-
-void test_ordered() {
-#pragma omp target
-#pragma omp teams distribute simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute simd'}}
-  for (int i = 0; i < 16; ++i)
-    ;
-}
-
-void test_nowait() {
-#pragma omp target
-// expected-error@+1 2 {{unexpected OpenMP clause 'nowait' in directive '#pragma omp teams distribute simd'}}
-#pragma omp teams distribute simd nowait nowait // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'nowait' clause}}
-  for (int i = 0; i < 16; ++i)
-    ;
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_messages.cpp b/test/OpenMP/teams_distribute_simd_messages.cpp
deleted file mode 100644 (file)
index 9095caf..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
-
-void foo() {
-}
-
-static int pvt;
-#pragma omp threadprivate(pvt)
-
-#pragma omp teams distribute simd // expected-error {{unexpected OpenMP directive '#pragma omp teams distribute simd'}}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd { // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd ( // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd[ // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd] // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd } // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < argc; ++i)
-    foo();
-// expected-warning@+2 {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-#pragma omp target
-#pragma omp teams distribute simd unknown()
-  for (int i = 0; i < argc; ++i)
-    foo();
-L1:
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < argc; ++i)
-    foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < argc; ++i) {
-    goto L1; // expected-error {{use of undeclared label 'L1'}}
-    argc++;
-  }
-
-  for (int i = 0; i < 10; ++i) {
-    switch (argc) {
-    case (0):
-#pragma omp target
-#pragma omp teams distribute simd
-      for (int i = 0; i < argc; ++i) {
-        foo();
-        break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
-        continue;
-      }
-    default:
-      break;
-    }
-  }
-#pragma omp target
-#pragma omp teams distribute simd default(none)
-  for (int i = 0; i < 10; ++i)
-    ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
-
-  goto L2; // expected-error {{use of undeclared label 'L2'}}
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < argc; ++i)
-  L2:
-  foo();
-#pragma omp target
-#pragma omp teams distribute simd
-  for (int i = 0; i < argc; ++i) {
-    return 1; // expected-error {{cannot return from OpenMP region}}
-  }
-
-  [[]] // expected-error {{an attribute list cannot appear here}}
-#pragma omp target
-#pragma omp teams distribute simd
-      for (int n = 0; n < 100; ++n) {
-  }
-
-#pragma omp target
-#pragma omp teams distribute simd copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp teams distribute simd'}}
-  for (int n = 0; n < 100; ++n) {}
-
-  return 0;
-}
-
-void test_ordered() {
-#pragma omp target
-#pragma omp teams distribute simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute simd'}}
-  for (int i = 0; i < 16; ++i)
-    ;
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_num_teams_messages.cpp b/test/OpenMP/teams_distribute_simd_num_teams_messages.cpp
deleted file mode 100644 (file)
index e65025a..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note 2 {{declared here}}
-
-template <typename T, int C> // expected-note {{declared here}}
-T tmain(T argc) {
-  char **a;
-#pragma omp target
-#pragma omp teams distribute simd num_teams(C)
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(T) // expected-error {{'T' does not refer to a value}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams() // expected-error {{expected expression}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(argc + argc)
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'num_teams' clause}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(-2) // expected-error {{argument to 'num_teams' clause must be a strictly positive integer value}}
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(-10u)
-  for (int i=0; i<100; i++) foo();
-#pragma omp target
-#pragma omp teams distribute simd num_teams(3.14) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'double'}}
-  for (int i=0; i<100; i++) foo();
-
-  return 0;
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams () // expected-error {{expected expression}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (argc + argc)
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'num_teams' clause}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (-2) // expected-error {{argument to 'num_teams' clause must be a strictly positive integer value}}
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (-10u)
-  for (int i=0; i<100; i++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd num_teams (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
-  for (int i=0; i<100; i++) foo();
-
-  return tmain<int, 10>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 10>' requested here}}
-}
diff --git a/test/OpenMP/teams_distribute_simd_private_messages.cpp b/test/OpenMP/teams_distribute_simd_private_messages.cpp
deleted file mode 100644 (file)
index 9044213..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}} expected-note {{forward declaration of 'S1'}}
-extern S1 a;
-class S2 {
-  mutable int a;
-public:
-  S2():a(0) { }
-  static float S2s; // expected-note {{predetermined as shared}}
-};
-const S2 b;
-const S2 ba[5];
-class S3 {
-  int a;
-public:
-  S3():a(0) { }
-};
-const S3 c; // expected-note {{predetermined as shared}}
-const S3 ca[5]; // expected-note {{predetermined as shared}}
-extern const int f;  // expected-note {{predetermined as shared}}
-class S4 {
-  int a;
-  S4(); // expected-note {{implicitly declared private here}}
-public:
-  S4(int v):a(v) { }
-};
-class S5 { 
-  int a;
-  S5():a(0) {} // expected-note {{implicitly declared private here}}
-public:
-  S5(int v):a(v) { }
-};
-
-S3 h;
-#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
-
-
-int main(int argc, char **argv) {
-  const int d = 5;  // expected-note {{predetermined as shared}}
-  const int da[5] = { 0 }; // expected-note {{predetermined as shared}}
-  S4 e(4);
-  S5 g(5);
-  int i;
-  int &j = i;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private // expected-error {{expected '(' after 'private'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private () // expected-error {{expected expression}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (argc)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (a, b, c, d, f) // expected-error {{private variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be private}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private (argv[1]) // expected-error {{expected variable name}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(ba)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(ca) // expected-error {{shared variable cannot be private}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(da) // expected-error {{shared variable cannot be private}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(S2::S2s) // expected-error {{shared variable cannot be private}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd shared(i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd firstprivate(i), private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}}
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd private(j)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp target
-  #pragma omp teams distribute simd reduction(+:i)
-  for (int k = 0; k < argc; ++k) ++k;
-
-  #pragma omp distribute private(i)
-  for (int k = 0; k < 10; ++k) {
-    #pragma omp target
-    #pragma omp teams distribute simd private(i)
-    for (int x = 0; x < 10; ++x) foo();
-  }
-
-  #pragma omp target
-  #pragma omp teams distribute simd firstprivate(i)
-  for (int k = 0; k < 10; ++k) {
-  }
-
-  return 0;
-}
diff --git a/test/OpenMP/teams_distribute_simd_reduction_messages.cpp b/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
deleted file mode 100644 (file)
index 879ec68..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
-extern S1 a;
-class S2 {
-  mutable int a;
-  S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
-
-public:
-  S2() : a(0) {}
-  S2(S2 &s2) : a(s2.a) {}
-  static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
-  static const float S2sc;
-};
-const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
-S2 b;                     // expected-note 3 {{'b' defined here}}
-const S2 ba[5];           // expected-note 2 {{'ba' defined here}}
-class S3 {
-  int a;
-
-public:
-  int b;
-  S3() : a(0) {}
-  S3(const S3 &s3) : a(s3.a) {}
-  S3 operator+(const S3 &arg1) { return arg1; }
-};
-int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
-S3 c;               // expected-note 3 {{'c' defined here}}
-const S3 ca[5];     // expected-note 2 {{'ca' defined here}}
-extern const int f; // expected-note 4 {{'f' declared here}}
-class S4 {
-  int a;
-  S4(); // expected-note {{implicitly declared private here}}
-  S4(const S4 &s4);
-  S4 &operator+(const S4 &arg) { return (*this); }
-
-public:
-  S4(int v) : a(v) {}
-};
-S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
-class S5 {
-  int a;
-  S5() : a(0) {} // expected-note {{implicitly declared private here}}
-  S5(const S5 &s5) : a(s5.a) {}
-  S5 &operator+(const S5 &arg);
-
-public:
-  S5(int v) : a(v) {}
-};
-class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
-#if __cplusplus >= 201103L // C++11 or later
-// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
-#endif
-  int a;
-
-public:
-  S6() : a(6) {}
-  operator int() { return 6; }
-} o;
-
-S3 h, k;
-#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
-
-template <class T>       // expected-note {{declared here}}
-T tmain(T argc) {
-  const T d = T();       // expected-note 4 {{'d' defined here}}
-  const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
-  T qa[5] = {T()};
-  T i;
-  T &j = i;                    // expected-note 4 {{'j' defined here}}
-  S3 &p = k;                   // expected-note 2 {{'p' defined here}}
-  const T &r = da[(int)i];     // expected-note 2 {{'r' defined here}}
-  T &q = qa[(int)i];           // expected-note 2 {{'q' defined here}}
-  T fl;
-#pragma omp target
-#pragma omp teams distribute simd reduction // expected-error {{expected '(' after 'reduction'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : argc)
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified list item cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : ba) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(* : ca) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(- : da) // expected-error {{const-qualified list item cannot be reduction}} expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : S2::S2sc) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp parallel private(k)
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : r) // expected-error 2 {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp parallel shared(i)
-#pragma omp parallel reduction(min : i)
-#pragma omp target
-#pragma omp teams distribute simd reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : fl)
-    for (int j=0; j<100; j++) foo();
-
-  return T();
-}
-
-namespace A {
-double x;
-#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
-}
-namespace B {
-using A::x;
-}
-
-int main(int argc, char **argv) {
-  const int d = 5;       // expected-note 2 {{'d' defined here}}
-  const int da[5] = {0}; // expected-note {{'da' defined here}}
-  int qa[5] = {0};
-  S4 e(4);
-  S5 g(5);
-  int i;
-  int &j = i;                  // expected-note 2 {{'j' defined here}}
-  S3 &p = k;                   // expected-note 2 {{'p' defined here}}
-  const int &r = da[i];        // expected-note {{'r' defined here}}
-  int &q = qa[i];              // expected-note {{'q' defined here}}
-  float fl;
-#pragma omp target
-#pragma omp teams distribute simd reduction // expected-error {{expected '(' after 'reduction'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : argc)
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified list item cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : ba) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(* : ca) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(- : da) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(&& : S2::S2sc) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp parallel private(k)
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : r) // expected-error {{const-qualified list item cannot be reduction}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp parallel shared(i)
-#pragma omp parallel reduction(min : i)
-#pragma omp target
-#pragma omp teams distribute simd reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : fl)
-    for (int j=0; j<100; j++) foo();
-  static int m;
-#pragma omp target
-#pragma omp teams distribute simd reduction(+ : m) // OK
-  for (int j=0; j<100; j++) foo();
-
-  return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
-}
diff --git a/test/OpenMP/teams_distribute_simd_safelen_messages.cpp b/test/OpenMP/teams_distribute_simd_safelen_messages.cpp
deleted file mode 100644 (file)
index a323c08..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
-
-void foo() {
-}
-
-#if __cplusplus >= 201103L
-// expected-note@+2 4 {{declared here}}
-#endif
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}}
-
-template <class T, typename S, int N, int ST> // expected-note {{declared here}}
-T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
-
-#pragma omp target
-#pragma omp teams distribute simd safelen // expected-error {{expected '(' after 'safelen'}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen () // expected-error {{expected expression}}
-  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (argc  // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
-  for (int i = ST; i < N; i++) 
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-  
-#pragma omp target
-#pragma omp teams distribute simd safelen (ST // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (1)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = ST; i < N; i++)
-     argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ((ST > 0) ? 1 + ST : 2)
-  for (int i = ST; i < N; i++) 
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#if __cplusplus >= 201103L
-  // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (S) // expected-error {{'S' does not refer to a value}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#if __cplusplus <= 199711L
-  // expected-error@+5 2 {{expression is not an integral constant expression}}
-#else
-  // expected-error@+3 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (4)
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (N) // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}}
-  for (T i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-  return argc;
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd safelen // expected-error {{expected '(' after 'safelen'}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen () // expected-error {{expected expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-  
-#if __cplusplus >= 201103L
-  // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#if __cplusplus >= 201103L
-  // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#if __cplusplus <= 199711L
-  // expected-error@+5 {{expression is not an integral constant expression}}
-#else
-  // expected-error@+3 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-  // expected-note@+2 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
-#pragma omp target
-#pragma omp teams distribute simd safelen(safelen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
-  foo(); // expected-error {{statement after '#pragma omp teams distribute simd' must be a for loop}}
-
-  // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
-  return tmain<int, char, 12, 4>(argc, argv);
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_shared_messages.cpp b/test/OpenMP/teams_distribute_simd_shared_messages.cpp
deleted file mode 100644 (file)
index cd963e8..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}}
-extern S1 a;
-class S2 {
-  mutable int a;
-public:
-  S2():a(0) { }
-  S2(S2 &s2):a(s2.a) { }
-};
-const S2 b;
-const S2 ba[5];
-class S3 {
-  int a;
-public:
-  S3():a(0) { }
-  S3(S3 &s3):a(s3.a) { }
-};
-const S3 c;
-const S3 ca[5];
-extern const int f;
-class S4 {
-  int a;
-  S4();
-  S4(const S4 &s4);
-public:
-  S4(int v):a(v) { }
-};
-class S5 {
-  int a;
-  S5():a(0) {}
-  S5(const S5 &s5):a(s5.a) { }
-public:
-  S5(int v):a(v) { }
-};
-
-S3 h;
-#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
-
-namespace A {
-double x;
-#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
-}
-namespace B {
-using A::x;
-}
-
-int main(int argc, char **argv) {
-  const int d = 5;
-  const int da[5] = { 0 };
-  S4 e(4);
-  S5 g(5);
-  int i;
-  int &j = i;
-  #pragma omp target
-  #pragma omp teams distribute simd shared // expected-error {{expected '(' after 'shared'}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared () // expected-error {{expected expression}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (argc)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (a, b, c, d, f)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared (argv[1]) // expected-error {{expected variable name}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(ba)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(ca)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(da)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(e, g)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd private(i)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(i)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd shared(j)
-  for (int j=0; j<100; j++) foo();
-  #pragma omp target
-  #pragma omp teams distribute simd firstprivate(i)
-  for (int j=0; j<100; j++) foo();
-
-  return 0;
-}
diff --git a/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp b/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp
deleted file mode 100644 (file)
index a323c08..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
-
-void foo() {
-}
-
-#if __cplusplus >= 201103L
-// expected-note@+2 4 {{declared here}}
-#endif
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note {{declared here}}
-
-template <class T, typename S, int N, int ST> // expected-note {{declared here}}
-T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
-
-#pragma omp target
-#pragma omp teams distribute simd safelen // expected-error {{expected '(' after 'safelen'}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen () // expected-error {{expected expression}}
-  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (argc  // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
-  for (int i = ST; i < N; i++) 
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-  
-#pragma omp target
-#pragma omp teams distribute simd safelen (ST // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (1)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = ST; i < N; i++)
-     argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ((ST > 0) ? 1 + ST : 2)
-  for (int i = ST; i < N; i++) 
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#if __cplusplus >= 201103L
-  // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (S) // expected-error {{'S' does not refer to a value}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#if __cplusplus <= 199711L
-  // expected-error@+5 2 {{expression is not an integral constant expression}}
-#else
-  // expected-error@+3 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (4)
-  for (int i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (N) // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}}
-  for (T i = ST; i < N; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-ST];
-
-  return argc;
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd safelen // expected-error {{expected '(' after 'safelen'}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen () // expected-error {{expected expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-  
-#if __cplusplus >= 201103L
-  // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#if __cplusplus >= 201103L
-  // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#pragma omp target
-#pragma omp teams distribute simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-#if __cplusplus <= 199711L
-  // expected-error@+5 {{expression is not an integral constant expression}}
-#else
-  // expected-error@+3 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
-#endif
-#pragma omp target
-#pragma omp teams distribute simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int i = 4; i < 12; i++)
-    argv[0][i] = argv[0][i] - argv[0][i-4];
-
-  // expected-note@+2 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
-#pragma omp target
-#pragma omp teams distribute simd safelen(safelen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
-  foo(); // expected-error {{statement after '#pragma omp teams distribute simd' must be a for loop}}
-
-  // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
-  return tmain<int, char, 12, 4>(argc, argv);
-}
-
diff --git a/test/OpenMP/teams_distribute_simd_thread_limit_messages.cpp b/test/OpenMP/teams_distribute_simd_thread_limit_messages.cpp
deleted file mode 100644 (file)
index b9c8ac3..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
-
-void foo() {
-}
-
-bool foobool(int argc) {
-  return argc;
-}
-
-struct S1; // expected-note 2 {{declared here}}
-
-template <typename T, int C> // expected-note {{declared here}}
-T tmain(T argc) {
-  char **a;
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(C)
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(T) // expected-error {{'T' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit() // expected-error {{expected expression}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc + argc)
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'thread_limit' clause}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(S1) // expected-error {{'S1' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(-2) // expected-error {{argument to 'thread_limit' clause must be a strictly positive integer value}}
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(-10u)
-  for (int j=0; j<100; j++) foo();
-#pragma omp target
-#pragma omp teams distribute simd thread_limit(3.14) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'double'}}
-  for (int j=0; j<100; j++) foo();
-
-  return 0;
-}
-
-int main(int argc, char **argv) {
-#pragma omp target
-#pragma omp teams distribute simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit () // expected-error {{expected expression}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc + argc)
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'thread_limit' clause}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (S1) // expected-error {{'S1' does not refer to a value}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (-2) // expected-error {{argument to 'thread_limit' clause must be a strictly positive integer value}}
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (-10u)
-  for (int j=0; j<100; j++) foo();
-
-#pragma omp target
-#pragma omp teams distribute simd thread_limit (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
-  for (int j=0; j<100; j++) foo();
-
-  return tmain<int, 10>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 10>' requested here}}
-}
index ad7cdfb6a399780ecc4639a22eaf427f130767cc..4a359299bdd07d6ce53d4a4a68859b3f8e477c84 100644 (file)
@@ -1978,8 +1978,6 @@ public:
       const OMPTargetParallelForSimdDirective *D);
   void VisitOMPTargetSimdDirective(const OMPTargetSimdDirective *D);
   void VisitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective *D);
-  void VisitOMPTeamsDistributeSimdDirective(
-      const OMPTeamsDistributeSimdDirective *D);
 
 private:
   void AddDeclarationNameInfo(const Stmt *S);
@@ -2769,11 +2767,6 @@ void EnqueueVisitor::VisitOMPTeamsDistributeDirective(
   VisitOMPLoopDirective(D);
 }
 
-void EnqueueVisitor::VisitOMPTeamsDistributeSimdDirective(
-    const OMPTeamsDistributeSimdDirective *D) {
-  VisitOMPLoopDirective(D);
-}
-
 void CursorVisitor::EnqueueWorkList(VisitorWorkList &WL, const Stmt *S) {
   EnqueueVisitor(WL, MakeCXCursor(S, StmtParent, TU,RegionOfInterest)).Visit(S);
 }
@@ -4902,8 +4895,6 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
     return cxstring::createRef("OMPTargetSimdDirective");
   case CXCursor_OMPTeamsDistributeDirective:
     return cxstring::createRef("OMPTeamsDistributeDirective");
-  case CXCursor_OMPTeamsDistributeSimdDirective:
-    return cxstring::createRef("OMPTeamsDistributeSimdDirective");
   case CXCursor_OverloadCandidate:
       return cxstring::createRef("OverloadCandidate");
   case CXCursor_TypeAliasTemplateDecl:
index 600b19be6bbadaed3458678aab57caeb8a281bac..047f8220fe896c8f038f032507d84e8110399f60 100644 (file)
@@ -656,9 +656,6 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent,
   case Stmt::OMPTeamsDistributeDirectiveClass:
     K = CXCursor_OMPTeamsDistributeDirective;
     break;
-  case Stmt::OMPTeamsDistributeSimdDirectiveClass:
-    K = CXCursor_OMPTeamsDistributeSimdDirective;
-    break;
   }
 
   CXCursor C = { K, 0, { Parent, S, TU } };