r357068 - [OPENMP]Initial support for 'allocate' clause.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 07:14:32 PDT 2019


Author: abataev
Date: Wed Mar 27 07:14:31 2019
New Revision: 357068

URL: http://llvm.org/viewvc/llvm-project?rev=357068&view=rev
Log:
[OPENMP]Initial support for 'allocate' clause.

Added parsing/sema analysis of the allocate clause.

Modified:
    cfe/trunk/include/clang/AST/OpenMPClause.h
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
    cfe/trunk/include/clang/Basic/OpenMPKinds.def
    cfe/trunk/include/clang/Basic/OpenMPKinds.h
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/AST/ASTTypeTraits.cpp
    cfe/trunk/lib/AST/OpenMPClause.cpp
    cfe/trunk/lib/AST/StmtProfile.cpp
    cfe/trunk/lib/Basic/OpenMPKinds.cpp
    cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp
    cfe/trunk/lib/Parse/ParseOpenMP.cpp
    cfe/trunk/lib/Sema/SemaOpenMP.cpp
    cfe/trunk/lib/Sema/TreeTransform.h
    cfe/trunk/lib/Serialization/ASTReader.cpp
    cfe/trunk/lib/Serialization/ASTWriter.cpp
    cfe/trunk/test/OpenMP/allocate_allocator_messages.cpp
    cfe/trunk/test/OpenMP/atomic_messages.c
    cfe/trunk/test/OpenMP/barrier_messages.cpp
    cfe/trunk/test/OpenMP/cancel_messages.cpp
    cfe/trunk/test/OpenMP/cancellation_point_messages.cpp
    cfe/trunk/test/OpenMP/critical_messages.cpp
    cfe/trunk/test/OpenMP/declare_mapper_messages.c
    cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
    cfe/trunk/test/OpenMP/declare_simd_messages.cpp
    cfe/trunk/test/OpenMP/declare_target_messages.cpp
    cfe/trunk/test/OpenMP/distribute_ast_print.cpp
    cfe/trunk/test/OpenMP/distribute_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_private_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/distribute_private_messages.cpp
    cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/distribute_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/distribute_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/flush_messages.cpp
    cfe/trunk/test/OpenMP/for_ast_print.cpp
    cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/for_linear_messages.cpp
    cfe/trunk/test/OpenMP/for_private_messages.cpp
    cfe/trunk/test/OpenMP/for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/master_messages.cpp
    cfe/trunk/test/OpenMP/ordered_messages.cpp
    cfe/trunk/test/OpenMP/parallel_ast_print.cpp
    cfe/trunk/test/OpenMP/parallel_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_ast_print.cpp
    cfe/trunk/test/OpenMP/parallel_for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_private_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/parallel_for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/parallel_private_messages.cpp
    cfe/trunk/test/OpenMP/parallel_reduction_messages.cpp
    cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp
    cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp
    cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp
    cfe/trunk/test/OpenMP/requires_messages.cpp
    cfe/trunk/test/OpenMP/sections_ast_print.cpp
    cfe/trunk/test/OpenMP/sections_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/sections_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/sections_private_messages.cpp
    cfe/trunk/test/OpenMP/sections_reduction_messages.cpp
    cfe/trunk/test/OpenMP/simd_ast_print.cpp
    cfe/trunk/test/OpenMP/simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/simd_private_messages.cpp
    cfe/trunk/test/OpenMP/simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/single_ast_print.cpp
    cfe/trunk/test/OpenMP/single_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/single_private_messages.cpp
    cfe/trunk/test/OpenMP/target_data_messages.c
    cfe/trunk/test/OpenMP/target_enter_data_map_messages.c
    cfe/trunk/test/OpenMP/target_exit_data_map_messages.c
    cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_ast_print.cpp
    cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_ast_print.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_private_messages.cpp
    cfe/trunk/test/OpenMP/target_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/target_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_ast_print.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_ast_print.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_private_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp
    cfe/trunk/test/OpenMP/target_update_messages.cpp
    cfe/trunk/test/OpenMP/task_ast_print.cpp
    cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/task_in_reduction_message.cpp
    cfe/trunk/test/OpenMP/task_private_messages.cpp
    cfe/trunk/test/OpenMP/taskgroup_task_reduction_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_ast_print.cpp
    cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_private_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/taskwait_messages.cpp
    cfe/trunk/test/OpenMP/taskyield_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_ast_print.cpp
    cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_private_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_reduction_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_ast_print.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_private_messages.cpp
    cfe/trunk/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
    cfe/trunk/test/OpenMP/teams_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/teams_private_messages.cpp
    cfe/trunk/test/OpenMP/teams_reduction_messages.cpp
    cfe/trunk/test/OpenMP/threadprivate_messages.cpp
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/include/clang/AST/OpenMPClause.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OpenMPClause.h?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/OpenMPClause.h (original)
+++ cfe/trunk/include/clang/AST/OpenMPClause.h Wed Mar 27 07:14:31 2019
@@ -295,6 +295,92 @@ public:
   }
 };
 
+/// This represents clause 'allocate' in the '#pragma omp ...' directives.
+///
+/// \code
+/// #pragma omp parallel private(a) allocate(omp_default_mem_alloc :a)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has clause 'private'
+/// and clause 'allocate' for the variable 'a'.
+class OMPAllocateClause final
+    : public OMPVarListClause<OMPAllocateClause>,
+      private llvm::TrailingObjects<OMPAllocateClause, Expr *> {
+  friend class OMPClauseReader;
+  friend OMPVarListClause;
+  friend TrailingObjects;
+
+  /// Allocator specified in the clause, or 'nullptr' if the default one is
+  /// used.
+  Expr *Allocator = nullptr;
+  /// Position of the ':' delimiter in the clause;
+  SourceLocation ColonLoc;
+
+  /// Build clause with number of variables \a N.
+  ///
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param Allocator Allocator expression.
+  /// \param ColonLoc Location of ':' delimiter.
+  /// \param EndLoc Ending location of the clause.
+  /// \param N Number of the variables in the clause.
+  OMPAllocateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
+                    Expr *Allocator, SourceLocation ColonLoc,
+                    SourceLocation EndLoc, unsigned N)
+      : OMPVarListClause<OMPAllocateClause>(OMPC_allocate, StartLoc, LParenLoc,
+                                            EndLoc, N),
+        Allocator(Allocator), ColonLoc(ColonLoc) {}
+
+  /// Build an empty clause.
+  ///
+  /// \param N Number of variables.
+  explicit OMPAllocateClause(unsigned N)
+      : OMPVarListClause<OMPAllocateClause>(OMPC_allocate, SourceLocation(),
+                                            SourceLocation(), SourceLocation(),
+                                            N) {}
+
+  /// Sets location of ':' symbol in clause.
+  void setColonLoc(SourceLocation CL) { ColonLoc = CL; }
+
+  void setAllocator(Expr *A) { Allocator = A; }
+
+public:
+  /// Creates clause with a list of variables \a VL.
+  ///
+  /// \param C AST context.
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param Allocator Allocator expression.
+  /// \param ColonLoc Location of ':' delimiter.
+  /// \param EndLoc Ending location of the clause.
+  /// \param VL List of references to the variables.
+  /// \param PrivateVL List of references to private copies with initializers.
+  static OMPAllocateClause *Create(const ASTContext &C, SourceLocation StartLoc,
+                                   SourceLocation LParenLoc, Expr *Allocator,
+                                   SourceLocation ColonLoc,
+                                   SourceLocation EndLoc, ArrayRef<Expr *> VL);
+
+  /// Returns the allocator expression or nullptr, if no allocator is specified.
+  Expr *getAllocator() const { return Allocator; }
+
+  /// Returns the location of the ':' delimiter.
+  SourceLocation getColonLoc() const { return ColonLoc; }
+
+  /// Creates an empty clause with the place for \a N variables.
+  ///
+  /// \param C AST context.
+  /// \param N The number of variables.
+  static OMPAllocateClause *CreateEmpty(const ASTContext &C, unsigned N);
+
+  child_range children() {
+    return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
+                       reinterpret_cast<Stmt **>(varlist_end()));
+  }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_allocate;
+  }
+};
+
 /// This represents 'if' clause in the '#pragma omp ...' directive.
 ///
 /// \code

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Mar 27 07:14:31 2019
@@ -2804,7 +2804,6 @@ bool RecursiveASTVisitor<Derived>::Trave
     break;
 #include "clang/Basic/OpenMPKinds.def"
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_uniform:
   case OMPC_unknown:
     break;
@@ -2834,6 +2833,13 @@ bool RecursiveASTVisitor<Derived>::Visit
   return true;
 }
 
+template <typename Derived>
+bool RecursiveASTVisitor<Derived>::VisitOMPAllocateClause(OMPAllocateClause *C) {
+  TRY_TO(TraverseStmt(C->getAllocator()));
+  TRY_TO(VisitOMPClauseList(C));
+  return true;
+}
+
 template <typename Derived>
 bool RecursiveASTVisitor<Derived>::VisitOMPIfClause(OMPIfClause *C) {
   TRY_TO(VisitOMPClauseWithPreInit(C));

Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Wed Mar 27 07:14:31 2019
@@ -304,6 +304,7 @@ OPENMP_CLAUSE(unified_shared_memory, OMP
 OPENMP_CLAUSE(reverse_offload, OMPReverseOffloadClause)
 OPENMP_CLAUSE(dynamic_allocators, OMPDynamicAllocatorsClause)
 OPENMP_CLAUSE(atomic_default_mem_order, OMPAtomicDefaultMemOrderClause)
+OPENMP_CLAUSE(allocate, OMPAllocateClause)
 
 // Clauses allowed for OpenMP directive 'parallel'.
 OPENMP_PARALLEL_CLAUSE(if)
@@ -315,6 +316,7 @@ OPENMP_PARALLEL_CLAUSE(firstprivate)
 OPENMP_PARALLEL_CLAUSE(shared)
 OPENMP_PARALLEL_CLAUSE(reduction)
 OPENMP_PARALLEL_CLAUSE(copyin)
+OPENMP_PARALLEL_CLAUSE(allocate)
 
 // Clauses allowed for directive 'omp simd'.
 OPENMP_SIMD_CLAUSE(private)
@@ -325,6 +327,7 @@ OPENMP_SIMD_CLAUSE(safelen)
 OPENMP_SIMD_CLAUSE(simdlen)
 OPENMP_SIMD_CLAUSE(collapse)
 OPENMP_SIMD_CLAUSE(reduction)
+OPENMP_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for directive 'omp for'.
 OPENMP_FOR_CLAUSE(private)
@@ -336,6 +339,7 @@ OPENMP_FOR_CLAUSE(schedule)
 OPENMP_FOR_CLAUSE(ordered)
 OPENMP_FOR_CLAUSE(nowait)
 OPENMP_FOR_CLAUSE(linear)
+OPENMP_FOR_CLAUSE(allocate)
 
 // Clauses allowed for directive 'omp for simd'.
 OPENMP_FOR_SIMD_CLAUSE(private)
@@ -350,6 +354,7 @@ OPENMP_FOR_SIMD_CLAUSE(simdlen)
 OPENMP_FOR_SIMD_CLAUSE(linear)
 OPENMP_FOR_SIMD_CLAUSE(aligned)
 OPENMP_FOR_SIMD_CLAUSE(ordered)
+OPENMP_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'omp sections'.
 OPENMP_SECTIONS_CLAUSE(private)
@@ -357,12 +362,14 @@ OPENMP_SECTIONS_CLAUSE(lastprivate)
 OPENMP_SECTIONS_CLAUSE(firstprivate)
 OPENMP_SECTIONS_CLAUSE(reduction)
 OPENMP_SECTIONS_CLAUSE(nowait)
+OPENMP_SECTIONS_CLAUSE(allocate)
 
 // Clauses allowed for directive 'omp single'.
 OPENMP_SINGLE_CLAUSE(private)
 OPENMP_SINGLE_CLAUSE(firstprivate)
 OPENMP_SINGLE_CLAUSE(copyprivate)
 OPENMP_SINGLE_CLAUSE(nowait)
+OPENMP_SINGLE_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'cancel'.
 OPENMP_CANCEL_CLAUSE(if)
@@ -422,6 +429,7 @@ OPENMP_PARALLEL_FOR_CLAUSE(collapse)
 OPENMP_PARALLEL_FOR_CLAUSE(schedule)
 OPENMP_PARALLEL_FOR_CLAUSE(ordered)
 OPENMP_PARALLEL_FOR_CLAUSE(linear)
+OPENMP_PARALLEL_FOR_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'parallel for simd'.
 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(if)
@@ -441,6 +449,7 @@ OPENMP_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(linear)
 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(aligned)
 OPENMP_PARALLEL_FOR_SIMD_CLAUSE(ordered)
+OPENMP_PARALLEL_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'parallel sections'.
 OPENMP_PARALLEL_SECTIONS_CLAUSE(if)
@@ -453,6 +462,7 @@ OPENMP_PARALLEL_SECTIONS_CLAUSE(shared)
 OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction)
 OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin)
 OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate)
+OPENMP_PARALLEL_SECTIONS_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'task'.
 OPENMP_TASK_CLAUSE(if)
@@ -466,6 +476,7 @@ OPENMP_TASK_CLAUSE(mergeable)
 OPENMP_TASK_CLAUSE(depend)
 OPENMP_TASK_CLAUSE(priority)
 OPENMP_TASK_CLAUSE(in_reduction)
+OPENMP_TASK_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'atomic'.
 OPENMP_ATOMIC_CLAUSE(read)
@@ -485,6 +496,7 @@ OPENMP_TARGET_CLAUSE(defaultmap)
 OPENMP_TARGET_CLAUSE(firstprivate)
 OPENMP_TARGET_CLAUSE(is_device_ptr)
 OPENMP_TARGET_CLAUSE(reduction)
+OPENMP_TARGET_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'requires'.
 OPENMP_REQUIRES_CLAUSE(unified_address)
@@ -536,6 +548,7 @@ OPENMP_TARGET_PARALLEL_CLAUSE(proc_bind)
 OPENMP_TARGET_PARALLEL_CLAUSE(shared)
 OPENMP_TARGET_PARALLEL_CLAUSE(reduction)
 OPENMP_TARGET_PARALLEL_CLAUSE(is_device_ptr)
+OPENMP_TARGET_PARALLEL_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target parallel for'.
 OPENMP_TARGET_PARALLEL_FOR_CLAUSE(if)
@@ -557,6 +570,7 @@ OPENMP_TARGET_PARALLEL_FOR_CLAUSE(schedu
 OPENMP_TARGET_PARALLEL_FOR_CLAUSE(ordered)
 OPENMP_TARGET_PARALLEL_FOR_CLAUSE(linear)
 OPENMP_TARGET_PARALLEL_FOR_CLAUSE(is_device_ptr)
+OPENMP_TARGET_PARALLEL_FOR_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target update'.
 OPENMP_TARGET_UPDATE_CLAUSE(if)
@@ -574,6 +588,7 @@ OPENMP_TEAMS_CLAUSE(shared)
 OPENMP_TEAMS_CLAUSE(reduction)
 OPENMP_TEAMS_CLAUSE(num_teams)
 OPENMP_TEAMS_CLAUSE(thread_limit)
+OPENMP_TEAMS_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'ordered'.
 OPENMP_ORDERED_CLAUSE(threads)
@@ -616,6 +631,7 @@ OPENMP_TASKLOOP_CLAUSE(nogroup)
 OPENMP_TASKLOOP_CLAUSE(num_tasks)
 OPENMP_TASKLOOP_CLAUSE(reduction)
 OPENMP_TASKLOOP_CLAUSE(in_reduction)
+OPENMP_TASKLOOP_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'taskloop simd'.
 OPENMP_TASKLOOP_SIMD_CLAUSE(if)
@@ -638,6 +654,7 @@ OPENMP_TASKLOOP_SIMD_CLAUSE(nogroup)
 OPENMP_TASKLOOP_SIMD_CLAUSE(num_tasks)
 OPENMP_TASKLOOP_SIMD_CLAUSE(reduction)
 OPENMP_TASKLOOP_SIMD_CLAUSE(in_reduction)
+OPENMP_TASKLOOP_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'critical'.
 OPENMP_CRITICAL_CLAUSE(hint)
@@ -648,6 +665,7 @@ OPENMP_DISTRIBUTE_CLAUSE(firstprivate)
 OPENMP_DISTRIBUTE_CLAUSE(lastprivate)
 OPENMP_DISTRIBUTE_CLAUSE(collapse)
 OPENMP_DISTRIBUTE_CLAUSE(dist_schedule)
+OPENMP_DISTRIBUTE_CLAUSE(allocate)
 
 // Static attributes for 'dist_schedule' clause.
 OPENMP_DIST_SCHEDULE_KIND(static)
@@ -666,6 +684,7 @@ OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(sh
 OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(reduction)
 OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(copyin)
 OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(schedule)
+OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'distribute parallel for simd'
 OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(firstprivate)
@@ -685,6 +704,7 @@ OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAU
 OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(aligned)
 OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(safelen)
 OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
+OPENMP_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'distribute simd'
 OPENMP_DISTRIBUTE_SIMD_CLAUSE(private)
@@ -697,6 +717,7 @@ OPENMP_DISTRIBUTE_SIMD_CLAUSE(aligned)
 OPENMP_DISTRIBUTE_SIMD_CLAUSE(safelen)
 OPENMP_DISTRIBUTE_SIMD_CLAUSE(simdlen)
 OPENMP_DISTRIBUTE_SIMD_CLAUSE(reduction)
+OPENMP_DISTRIBUTE_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target parallel for simd'.
 OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(if)
@@ -721,6 +742,7 @@ OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(s
 OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
 OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(aligned)
 OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(is_device_ptr)
+OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target simd'.
 OPENMP_TARGET_SIMD_CLAUSE(if)
@@ -739,6 +761,7 @@ OPENMP_TARGET_SIMD_CLAUSE(safelen)
 OPENMP_TARGET_SIMD_CLAUSE(simdlen)
 OPENMP_TARGET_SIMD_CLAUSE(collapse)
 OPENMP_TARGET_SIMD_CLAUSE(reduction)
+OPENMP_TARGET_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'teams distribute'.
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(default)
@@ -751,6 +774,7 @@ OPENMP_TEAMS_DISTRIBUTE_CLAUSE(thread_li
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(lastprivate)
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(collapse)
 OPENMP_TEAMS_DISTRIBUTE_CLAUSE(dist_schedule)
+OPENMP_TEAMS_DISTRIBUTE_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'teams distribute simd'
 OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(default)
@@ -767,6 +791,7 @@ OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(line
 OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(aligned)
 OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(safelen)
 OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(simdlen)
+OPENMP_TEAMS_DISTRIBUTE_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'teams distribute parallel for simd'
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(firstprivate)
@@ -787,6 +812,7 @@ OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIM
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(num_teams)
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(thread_limit)
+OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'teams distribute parallel for'
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(firstprivate)
@@ -804,6 +830,7 @@ OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLA
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(num_teams)
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(thread_limit)
 OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(copyin)
+OPENMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target teams'.
 OPENMP_TARGET_TEAMS_CLAUSE(if)
@@ -820,6 +847,7 @@ OPENMP_TARGET_TEAMS_CLAUSE(shared)
 OPENMP_TARGET_TEAMS_CLAUSE(reduction)
 OPENMP_TARGET_TEAMS_CLAUSE(num_teams)
 OPENMP_TARGET_TEAMS_CLAUSE(thread_limit)
+OPENMP_TARGET_TEAMS_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target teams distribute'.
 OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(if)
@@ -839,6 +867,7 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(th
 OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(lastprivate)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(collapse)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(dist_schedule)
+OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target teams distribute parallel for'.
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(if)
@@ -861,6 +890,7 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(num_threads)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(proc_bind)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(schedule)
+OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive
 // 'target teams distribute parallel for simd'.
@@ -888,6 +918,7 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(aligned)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(safelen)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(simdlen)
+OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'target teams distribute simd'.
 OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(if)
@@ -910,9 +941,11 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAU
 OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(aligned)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(safelen)
 OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(simdlen)
+OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'taskgroup'.
 OPENMP_TASKGROUP_CLAUSE(task_reduction)
+OPENMP_TASKGROUP_CLAUSE(allocate)
 
 // Clauses allowed for OpenMP directive 'declare mapper'.
 OPENMP_DECLARE_MAPPER_CLAUSE(map)

Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.h?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/OpenMPKinds.h (original)
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.h Wed Mar 27 07:14:31 2019
@@ -35,7 +35,6 @@ enum OpenMPClauseKind {
 #include "clang/Basic/OpenMPKinds.def"
   OMPC_threadprivate,
   OMPC_uniform,
-  OMPC_allocate,
   OMPC_unknown
 };
 

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Mar 27 07:14:31 2019
@@ -9389,6 +9389,11 @@ public:
       ArrayRef<OpenMPMapModifierKind> MapTypeModifiers,
       ArrayRef<SourceLocation> MapTypeModifiersLoc, OpenMPMapClauseKind MapType,
       bool IsMapTypeImplicit, SourceLocation DepLinMapLoc);
+  /// Called on well-formed 'allocate' clause.
+  OMPClause *
+  ActOnOpenMPAllocateClause(Expr *Allocator, ArrayRef<Expr *> VarList,
+                            SourceLocation StartLoc, SourceLocation ColonLoc,
+                            SourceLocation LParenLoc, SourceLocation EndLoc);
   /// Called on well-formed 'private' clause.
   OMPClause *ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList,
                                       SourceLocation StartLoc,

Modified: cfe/trunk/lib/AST/ASTTypeTraits.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTTypeTraits.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTTypeTraits.cpp (original)
+++ cfe/trunk/lib/AST/ASTTypeTraits.cpp Wed Mar 27 07:14:31 2019
@@ -113,7 +113,6 @@ ASTNodeKind ASTNodeKind::getFromNode(con
 #define OPENMP_CLAUSE(Name, Class)                                             \
     case OMPC_##Name: return ASTNodeKind(NKI_##Class);
 #include "clang/Basic/OpenMPKinds.def"
-  case OMPC_allocate:
   case OMPC_threadprivate:
   case OMPC_uniform:
   case OMPC_unknown:

Modified: cfe/trunk/lib/AST/OpenMPClause.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/OpenMPClause.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/AST/OpenMPClause.cpp (original)
+++ cfe/trunk/lib/AST/OpenMPClause.cpp Wed Mar 27 07:14:31 2019
@@ -74,6 +74,7 @@ const OMPClauseWithPreInit *OMPClauseWit
   case OMPC_safelen:
   case OMPC_simdlen:
   case OMPC_allocator:
+  case OMPC_allocate:
   case OMPC_collapse:
   case OMPC_private:
   case OMPC_shared:
@@ -85,7 +86,6 @@ const OMPClauseWithPreInit *OMPClauseWit
   case OMPC_untied:
   case OMPC_mergeable:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_flush:
   case OMPC_read:
   case OMPC_write:
@@ -147,6 +147,7 @@ const OMPClauseWithPostUpdate *OMPClause
   case OMPC_safelen:
   case OMPC_simdlen:
   case OMPC_allocator:
+  case OMPC_allocate:
   case OMPC_collapse:
   case OMPC_private:
   case OMPC_shared:
@@ -158,7 +159,6 @@ const OMPClauseWithPostUpdate *OMPClause
   case OMPC_untied:
   case OMPC_mergeable:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_flush:
   case OMPC_read:
   case OMPC_write:
@@ -701,6 +701,25 @@ OMPInReductionClause *OMPInReductionClau
   return new (Mem) OMPInReductionClause(N);
 }
 
+OMPAllocateClause *
+OMPAllocateClause::Create(const ASTContext &C, SourceLocation StartLoc,
+                          SourceLocation LParenLoc, Expr *Allocator,
+                          SourceLocation ColonLoc, SourceLocation EndLoc,
+                          ArrayRef<Expr *> VL) {
+  // Allocate space for private variables and initializer expressions.
+  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(VL.size()));
+  auto *Clause = new (Mem) OMPAllocateClause(StartLoc, LParenLoc, Allocator,
+                                             ColonLoc, EndLoc, VL.size());
+  Clause->setVarRefs(VL);
+  return Clause;
+}
+
+OMPAllocateClause *OMPAllocateClause::CreateEmpty(const ASTContext &C,
+                                                  unsigned N) {
+  void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(N));
+  return new (Mem) OMPAllocateClause(N);
+}
+
 OMPFlushClause *OMPFlushClause::Create(const ASTContext &C,
                                        SourceLocation StartLoc,
                                        SourceLocation LParenLoc,
@@ -1264,6 +1283,21 @@ void OMPClausePrinter::VisitOMPClauseLis
   }
 }
 
+void OMPClausePrinter::VisitOMPAllocateClause(OMPAllocateClause *Node) {
+  if (Node->varlist_empty())
+    return;
+  OS << "allocate";
+  if (Expr *Allocator = Node->getAllocator()) {
+    OS << "(";
+    Allocator->printPretty(OS, nullptr, Policy, 0);
+    OS << ":";
+    VisitOMPClauseList(Node, ' ');
+  } else {
+    VisitOMPClauseList(Node, '(');
+  }
+  OS << ")";
+}
+
 void OMPClausePrinter::VisitOMPPrivateClause(OMPPrivateClause *Node) {
   if (!Node->varlist_empty()) {
     OS << "private";

Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Wed Mar 27 07:14:31 2019
@@ -716,6 +716,11 @@ void OMPClauseProfiler::VisitOMPDeviceCl
 void OMPClauseProfiler::VisitOMPMapClause(const OMPMapClause *C) {
   VisitOMPClauseList(C);
 }
+void OMPClauseProfiler::VisitOMPAllocateClause(const OMPAllocateClause *C) {
+  if (Expr *Allocator = C->getAllocator())
+    Profiler->VisitStmt(Allocator);
+  VisitOMPClauseList(C);
+}
 void OMPClauseProfiler::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {
   VistOMPClauseWithPreInit(C);
   if (C->getNumTeams())

Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)
+++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Wed Mar 27 07:14:31 2019
@@ -71,8 +71,6 @@ const char *clang::getOpenMPClauseName(O
     return "uniform";
   case OMPC_threadprivate:
     return "threadprivate or thread local";
-  case OMPC_allocate:
-    return "allocate";
   }
   llvm_unreachable("Invalid OpenMP clause kind");
 }
@@ -149,13 +147,13 @@ unsigned clang::getOpenMPSimpleClauseTyp
         .Default(OMPC_ATOMIC_DEFAULT_MEM_ORDER_unknown);
   case OMPC_unknown:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_if:
   case OMPC_final:
   case OMPC_num_threads:
   case OMPC_safelen:
   case OMPC_simdlen:
   case OMPC_allocator:
+  case OMPC_allocate:
   case OMPC_collapse:
   case OMPC_private:
   case OMPC_firstprivate:
@@ -332,13 +330,13 @@ const char *clang::getOpenMPSimpleClause
     llvm_unreachable("Invalid OpenMP 'atomic_default_mem_order' clause type");
   case OMPC_unknown:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_if:
   case OMPC_final:
   case OMPC_num_threads:
   case OMPC_safelen:
   case OMPC_simdlen:
   case OMPC_allocator:
+  case OMPC_allocate:
   case OMPC_collapse:
   case OMPC_private:
   case OMPC_firstprivate:

Modified: cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp Wed Mar 27 07:14:31 2019
@@ -3950,6 +3950,7 @@ static void emitOMPAtomicExpr(CodeGenFun
   case OMPC_safelen:
   case OMPC_simdlen:
   case OMPC_allocator:
+  case OMPC_allocate:
   case OMPC_collapse:
   case OMPC_default:
   case OMPC_seq_cst:
@@ -3965,7 +3966,6 @@ static void emitOMPAtomicExpr(CodeGenFun
   case OMPC_nowait:
   case OMPC_untied:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_depend:
   case OMPC_mergeable:
   case OMPC_device:

Modified: cfe/trunk/lib/Parse/ParseOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseOpenMP.cpp (original)
+++ cfe/trunk/lib/Parse/ParseOpenMP.cpp Wed Mar 27 07:14:31 2019
@@ -1562,7 +1562,7 @@ bool Parser::ParseOpenMPSimpleVarList(
 ///       thread_limit-clause | priority-clause | grainsize-clause |
 ///       nogroup-clause | num_tasks-clause | hint-clause | to-clause |
 ///       from-clause | is_device_ptr-clause | task_reduction-clause |
-///       in_reduction-clause | allocator-clause
+///       in_reduction-clause | allocator-clause | allocate-clause
 ///
 OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
                                      OpenMPClauseKind CKind, bool FirstClause) {
@@ -1708,6 +1708,7 @@ OMPClause *Parser::ParseOpenMPClause(Ope
   case OMPC_from:
   case OMPC_use_device_ptr:
   case OMPC_is_device_ptr:
+  case OMPC_allocate:
     Clause = ParseOpenMPVarListClause(DKind, CKind, WrongDirective);
     break;
   case OMPC_unknown:
@@ -1716,7 +1717,6 @@ OMPClause *Parser::ParseOpenMPClause(Ope
     SkipUntil(tok::annot_pragma_openmp_end, StopBeforeMatch);
     break;
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_uniform:
     if (!WrongDirective)
       Diag(Tok, diag::err_omp_unexpected_clause)
@@ -2306,6 +2306,31 @@ bool Parser::ParseOpenMPVarList(OpenMPDi
           ConsumeToken();
       }
     }
+  } else if (Kind == OMPC_allocate) {
+    // Handle optional allocator expression followed by colon delimiter.
+    ColonProtectionRAIIObject ColonRAII(*this);
+    TentativeParsingAction TPA(*this);
+    ExprResult Tail =
+        Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
+    Tail = Actions.ActOnFinishFullExpr(Tail.get(), T.getOpenLocation(),
+                                       /*DiscardedValue=*/false);
+    if (Tail.isUsable()) {
+      if (Tok.is(tok::colon)) {
+        Data.TailExpr = Tail.get();
+        Data.ColonLoc = ConsumeToken();
+        TPA.Commit();
+      } else {
+        // colon not found, no allocator specified, parse only list of
+        // variables.
+        TPA.Revert();
+      }
+    } else {
+      // Parsing was unsuccessfull, revert and skip to the end of clause or
+      // directive.
+      TPA.Revert();
+      SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
+                StopBeforeMatch);
+    }
   }
 
   bool IsComma =
@@ -2410,6 +2435,8 @@ bool Parser::ParseOpenMPVarList(OpenMPDi
 ///       'use_device_ptr' '(' list ')'
 ///    is_device_ptr-clause:
 ///       'is_device_ptr' '(' list ')'
+///    allocate-clause:
+///       'allocate' '(' [ allocator ':' ] list ')'
 ///
 /// For 'linear' clause linear-list may have the following forms:
 ///  list

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Wed Mar 27 07:14:31 2019
@@ -10152,6 +10152,10 @@ OMPClause *Sema::ActOnOpenMPVarListClaus
   case OMPC_is_device_ptr:
     Res = ActOnOpenMPIsDevicePtrClause(VarList, Locs);
     break;
+  case OMPC_allocate:
+    Res = ActOnOpenMPAllocateClause(TailExpr, VarList, StartLoc, LParenLoc,
+                                    ColonLoc, EndLoc);
+    break;
   case OMPC_if:
   case OMPC_final:
   case OMPC_num_threads:
@@ -10167,7 +10171,6 @@ OMPClause *Sema::ActOnOpenMPVarListClaus
   case OMPC_untied:
   case OMPC_mergeable:
   case OMPC_threadprivate:
-  case OMPC_allocate:
   case OMPC_read:
   case OMPC_write:
   case OMPC_update:
@@ -14700,3 +14703,55 @@ OMPClause *Sema::ActOnOpenMPIsDevicePtrC
                                       MVLI.VarBaseDeclarations,
                                       MVLI.VarComponents);
 }
+
+OMPClause *Sema::ActOnOpenMPAllocateClause(
+    Expr *Allocator, ArrayRef<Expr *> VarList, SourceLocation StartLoc,
+    SourceLocation ColonLoc, SourceLocation LParenLoc, SourceLocation EndLoc) {
+  if (Allocator) {
+    // OpenMP [2.11.4 allocate Clause, Description]
+    // allocator is an expression of omp_allocator_handle_t type.
+    if (!findOMPAllocatorHandleT(*this, Allocator->getExprLoc(), DSAStack))
+      return nullptr;
+
+    ExprResult AllocatorRes = DefaultLvalueConversion(Allocator);
+    if (AllocatorRes.isInvalid())
+      return nullptr;
+    AllocatorRes = PerformImplicitConversion(AllocatorRes.get(),
+                                             DSAStack->getOMPAllocatorHandleT(),
+                                             Sema::AA_Initializing,
+                                             /*AllowExplicit=*/true);
+    if (AllocatorRes.isInvalid())
+      return nullptr;
+    Allocator = AllocatorRes.get();
+  }
+  // Analyze and build list of variables.
+  SmallVector<Expr *, 8> Vars;
+  for (Expr *RefExpr : VarList) {
+    assert(RefExpr && "NULL expr in OpenMP private clause.");
+    SourceLocation ELoc;
+    SourceRange ERange;
+    Expr *SimpleRefExpr = RefExpr;
+    auto Res = getPrivateItem(*this, SimpleRefExpr, ELoc, ERange);
+    if (Res.second) {
+      // It will be analyzed later.
+      Vars.push_back(RefExpr);
+    }
+    ValueDecl *D = Res.first;
+    if (!D)
+      continue;
+
+    auto *VD = dyn_cast<VarDecl>(D);
+    DeclRefExpr *Ref = nullptr;
+    if (!VD && !CurContext->isDependentContext())
+      Ref = buildCapture(*this, D, SimpleRefExpr, /*WithInit=*/false);
+    Vars.push_back((VD || CurContext->isDependentContext())
+                       ? RefExpr->IgnoreParens()
+                       : Ref);
+  }
+
+  if (Vars.empty())
+    return nullptr;
+
+  return OMPAllocateClause::Create(Context, StartLoc, LParenLoc, Allocator,
+                                   ColonLoc, EndLoc, Vars);
+}

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Mar 27 07:14:31 2019
@@ -1827,6 +1827,19 @@ public:
                                           VarList, Locs, UnresolvedMappers);
   }
 
+  /// Build a new OpenMP 'allocate' clause.
+  ///
+  /// By default, performs semantic analysis to build the new OpenMP clause.
+  /// Subclasses may override this routine to provide different behavior.
+  OMPClause *RebuildOMPAllocateClause(Expr *Allocate, ArrayRef<Expr *> VarList,
+                                      SourceLocation StartLoc,
+                                      SourceLocation LParenLoc,
+                                      SourceLocation ColonLoc,
+                                      SourceLocation EndLoc) {
+    return getSema().ActOnOpenMPAllocateClause(Allocate, VarList, StartLoc,
+                                               LParenLoc, ColonLoc, EndLoc);
+  }
+
   /// Build a new OpenMP 'num_teams' clause.
   ///
   /// By default, performs semantic analysis to build the new statement.
@@ -8907,6 +8920,29 @@ OMPClause *TreeTransform<Derived>::Trans
 }
 
 template <typename Derived>
+OMPClause *
+TreeTransform<Derived>::TransformOMPAllocateClause(OMPAllocateClause *C) {
+  Expr *Allocator = C->getAllocator();
+  if (Allocator) {
+    ExprResult AllocatorRes = getDerived().TransformExpr(Allocator);
+    if (AllocatorRes.isInvalid())
+      return nullptr;
+    Allocator = AllocatorRes.get();
+  }
+  llvm::SmallVector<Expr *, 16> Vars;
+  Vars.reserve(C->varlist_size());
+  for (auto *VE : C->varlists()) {
+    ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
+    if (EVar.isInvalid())
+      return nullptr;
+    Vars.push_back(EVar.get());
+  }
+  return getDerived().RebuildOMPAllocateClause(
+      Allocator, Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(),
+      C->getEndLoc());
+}
+
+template <typename Derived>
 OMPClause *
 TreeTransform<Derived>::TransformOMPNumTeamsClause(OMPNumTeamsClause *C) {
   ExprResult E = getDerived().TransformExpr(C->getNumTeams());

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Mar 27 07:14:31 2019
@@ -11884,6 +11884,9 @@ OMPClause *OMPClauseReader::readClause()
     C = OMPIsDevicePtrClause::CreateEmpty(Context, Sizes);
     break;
   }
+  case OMPC_allocate:
+    C = OMPAllocateClause::CreateEmpty(Context, Record.readInt());
+    break;
   }
   Visit(C);
   C->setLocStart(Record.readSourceLocation());
@@ -12379,6 +12382,18 @@ void OMPClauseReader::VisitOMPMapClause(
   C->setComponents(Components, ListSizes);
 }
 
+void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) {
+  C->setLParenLoc(Record.readSourceLocation());
+  C->setColonLoc(Record.readSourceLocation());
+  C->setAllocator(Record.readSubExpr());
+  unsigned NumVars = C->varlist_size();
+  SmallVector<Expr *, 16> Vars;
+  Vars.reserve(NumVars);
+  for (unsigned i = 0; i != NumVars; ++i)
+    Vars.push_back(Record.readSubExpr());
+  C->setVarRefs(Vars);
+}
+
 void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
   VisitOMPClauseWithPreInit(C);
   C->setNumTeams(Record.readSubExpr());

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Mar 27 07:14:31 2019
@@ -6831,6 +6831,15 @@ void OMPClauseWriter::VisitOMPMapClause(
   }
 }
 
+void OMPClauseWriter::VisitOMPAllocateClause(OMPAllocateClause *C) {
+  Record.push_back(C->varlist_size());
+  Record.AddSourceLocation(C->getLParenLoc());
+  Record.AddSourceLocation(C->getColonLoc());
+  Record.AddStmt(C->getAllocator());
+  for (auto *VE : C->varlists())
+    Record.AddStmt(VE);
+}
+
 void OMPClauseWriter::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
   VisitOMPClauseWithPreInit(C);
   Record.AddStmt(C->getNumTeams());

Modified: cfe/trunk/test/OpenMP/allocate_allocator_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/allocate_allocator_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/allocate_allocator_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/allocate_allocator_messages.cpp Wed Mar 27 07:14:31 2019
@@ -7,7 +7,8 @@ struct St{
 };
 
 int sss;
-#pragma omp allocate(sss) allocate // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
+#pragma omp allocate(sss) allocat // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
+#pragma omp allocate(sss) allocate(sss) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp allocate'}}
 #pragma omp allocate(sss) allocator // expected-error {{expected '(' after 'allocator'}}
 #pragma omp allocate(sss) allocator(0,  // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include <omp.h>}} expected-note {{to match this '('}}
 #pragma omp allocate(sss) allocator(0,sss  // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include <omp.h>}} expected-note {{to match this '('}}

Modified: cfe/trunk/test/OpenMP/atomic_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_messages.c?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/atomic_messages.c (original)
+++ cfe/trunk/test/OpenMP/atomic_messages.c Wed Mar 27 07:14:31 2019
@@ -59,8 +59,8 @@ int readint() {
 
 int readS() {
   struct S a, b;
-  // expected-error at +1 {{directive '#pragma omp atomic' cannot contain more than one 'read' clause}}
-#pragma omp atomic read read
+  // expected-error at +1 {{directive '#pragma omp atomic' cannot contain more than one 'read' clause}} expected-error at +1 {{unexpected OpenMP clause 'allocate' in directive '#pragma omp atomic'}}
+#pragma omp atomic read read allocate(a)
   // expected-error at +2 {{the statement for 'atomic read' must be an expression statement of form 'v = x;', where v and x are both lvalue expressions with scalar type}}
   // expected-note at +1 {{expected expression of scalar type}}
   a = b;

Modified: cfe/trunk/test/OpenMP/barrier_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/barrier_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/barrier_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/barrier_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@ template <class T>
 T tmain(T argc) {
 #pragma omp barrier
   ;
+#pragma omp barrier allocate(argc)  // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp barrier'}}
 #pragma omp barrier untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp barrier'}}
 #pragma omp barrier unknown // expected-warning {{extra tokens at the end of '#pragma omp barrier' are ignored}}
   if (argc)

Modified: cfe/trunk/test/OpenMP/cancel_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/cancel_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/cancel_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/cancel_messages.cpp Wed Mar 27 07:14:31 2019
@@ -45,7 +45,7 @@ int main(int argc, char **argv) {
   }
 #pragma omp sections
   {
-#pragma omp cancel parallel // expected-error {{region cannot be closely nested inside 'sections' region}}
+#pragma omp cancel parallel allocate(argc) // expected-error {{region cannot be closely nested inside 'sections' region}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp cancel'}}
   }
   while (argc)
 #pragma omp cancel for // expected-error {{'#pragma omp cancel' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}}

Modified: cfe/trunk/test/OpenMP/cancellation_point_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/cancellation_point_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/cancellation_point_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/cancellation_point_messages.cpp Wed Mar 27 07:14:31 2019
@@ -10,7 +10,7 @@ int main(int argc, char **argv) {
   {
 #pragma omp cancellation point // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}}
   }
-#pragma omp cancellation point parallel untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp cancellation point'}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}}
+#pragma omp cancellation point parallel untied allocate(argc) // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp cancellation point'}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp cancellation point'}}
 #pragma omp cancellation point unknown         // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}}
 #pragma omp parallel
   {

Modified: cfe/trunk/test/OpenMP/critical_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/critical_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/critical_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/critical_messages.cpp Wed Mar 27 07:14:31 2019
@@ -8,7 +8,7 @@ template<typename T, int N>
 int tmain(int argc, char **argv) { // expected-note {{declared here}}
   #pragma omp critical
   ;
-  #pragma omp critical untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp critical'}}
+  #pragma omp critical untied allocate(argc) // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp critical'}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp critical'}}
   #pragma omp critical unknown // expected-warning {{extra tokens at the end of '#pragma omp critical' are ignored}}
   #pragma omp critical ( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   #pragma omp critical ( + // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}}

Modified: cfe/trunk/test/OpenMP/declare_mapper_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/declare_mapper_messages.c?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/declare_mapper_messages.c (original)
+++ cfe/trunk/test/OpenMP/declare_mapper_messages.c Wed Mar 27 07:14:31 2019
@@ -34,7 +34,7 @@ int fun(int arg) {
 #pragma omp declare mapper(id: struct vec v) map(v.len)                 // expected-note {{previous definition is here}}
 #pragma omp declare mapper(id: struct vec v) map(v.len)                 // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'id'}}
     {
-#pragma omp declare mapper(id: struct vec v) map(v.len)
+#pragma omp declare mapper(id: struct vec v) map(v.len) allocate(v)   // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp declare mapper'}}
       struct vec vv, v1;
 #pragma omp target map(mapper)                                          // expected-error {{use of undeclared identifier 'mapper'}}
       {}

Modified: cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/declare_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/declare_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/declare_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -147,7 +147,7 @@ struct A {
 
 int A_TEST() {
   A test;
-#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A())
+#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A()) allocate(test) // expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
 #pragma omp parallel reduction(+ : test)
   {}
   return 0;

Modified: cfe/trunk/test/OpenMP/declare_simd_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/declare_simd_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/declare_simd_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/declare_simd_messages.cpp Wed Mar 27 07:14:31 2019
@@ -195,8 +195,8 @@ void test() {
 #pragma omp declare simd linear(uval(b))
 // expected-error at +1 {{variable of non-reference type 'int *' can be used only with 'val' modifier, but used with 'ref'}}
 #pragma omp declare simd linear(ref(b))
-// expected-error at +1 {{expected one of 'ref', val' or 'uval' modifiers}}
-#pragma omp declare simd linear(uref(b))
+// expected-error at +1 {{expected one of 'ref', val' or 'uval' modifiers}} expected-warning at +1 {{extra tokens at the end of '#pragma omp declare simd' are ignored}}
+#pragma omp declare simd linear(uref(b)) allocate(b)
 void bar(int a, int *b);
 
 template <class T>

Modified: cfe/trunk/test/OpenMP/declare_target_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/declare_target_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/declare_target_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/declare_target_messages.cpp Wed Mar 27 07:14:31 2019
@@ -23,7 +23,7 @@ void c();
 
 void func() {} // expected-note {{'func' defined here}}
 
-#pragma omp declare target link(func) // expected-error {{function name is not allowed in 'link' clause}}
+#pragma omp declare target link(func) allocate(a) // expected-error {{function name is not allowed in 'link' clause}} expected-error {{unexpected 'allocate' clause, only 'to' or 'link' clauses expected}}
 
 extern int b;
 

Modified: cfe/trunk/test/OpenMP/distribute_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -29,14 +29,14 @@ public:
   S7(typename T::type v) : a(v) {
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute private(a) private(this->a) private(T::a)
+#pragma omp distribute private(a) private(this->a) private(T::a) allocate(a)
     for (int k = 0; k < a.a; ++k)
       ++this->a.a;
   }
   S7 &operator=(S7 &s) {
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute private(a) private(this->a)
+#pragma omp distribute allocate(a) private(a) private(this->a)
     for (int k = 0; k < s.a.a; ++k)
       ++s.a.a;
     return *this;
@@ -45,13 +45,13 @@ public:
 
 // CHECK: #pragma omp target
 // CHECK-NEXT: #pragma omp teams
-// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(T::a)
+// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(T::a) allocate(this->a)
 // CHECK: #pragma omp target
 // CHECK-NEXT: #pragma omp teams
-// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a)
+// CHECK-NEXT: #pragma omp distribute allocate(this->a) private(this->a) private(this->a)
 // CHECK: #pragma omp target
 // CHECK-NEXT: #pragma omp teams
-// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a)
+// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a) allocate(this->a)
 
 class S8 : public S7<S> {
   S8() {}

Modified: cfe/trunk/test/OpenMP/distribute_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -54,6 +54,8 @@ public:
   S6() : a(0) { }
 };
 
+extern int omp_default_mem_alloc;
+
 S3 h;
 #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
 
@@ -85,7 +87,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i) foo();
   #pragma omp target
   #pragma omp teams
-  #pragma omp distribute firstprivate (argc)
+  #pragma omp distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
   #pragma omp target
   #pragma omp teams

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -78,15 +78,15 @@ T tmain(T argc) {
 #pragma omp threadprivate(g)
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a)
-  // CHECK: #pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g)
+#pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a)
+  // CHECK: #pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a)
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N)
+#pragma omp distribute parallel for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
@@ -98,7 +98,7 @@ T tmain(T argc) {
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             a++;
-  // CHECK: #pragma omp distribute parallel for private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N)
+  // CHECK: #pragma omp distribute parallel for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -8,6 +8,7 @@ void foo() {
 bool foobool(int argc) {
   return argc;
 }
+extern int omp_default_mem_alloc;
 
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
@@ -100,7 +101,7 @@ int foomain(int argc, char **argv) {
     ++k;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for firstprivate(argc)
+#pragma omp distribute parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -8,7 +8,7 @@ void foo() {
 bool foobool(int argc) {
   return argc;
 }
-
+extern int omp_default_mem_alloc;
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
 class S2 {
@@ -102,7 +102,7 @@ int foomain(int argc, char **argv) {
     ++k;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for lastprivate(argc)
+#pragma omp distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -34,7 +35,7 @@ public:
   S4(int v) : a(v) {
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for private(a) private(this->a)
+#pragma omp distribute parallel for private(a) private(this->a) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: a, allocate(omp_default_mem_alloc: a), allocate(a) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -150,7 +151,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for reduction(&& : argc)
+#pragma omp distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -79,15 +79,15 @@ T tmain(T argc) {
 #pragma omp threadprivate(g)
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a)
-  // CHECK: #pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g)
+#pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a)
+  // CHECK: #pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a)
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N)
+#pragma omp distribute parallel for simd allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
@@ -99,7 +99,7 @@ T tmain(T argc) {
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             a++;
-  // CHECK: #pragma omp distribute parallel for simd private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N)
+  // CHECK: #pragma omp distribute parallel for simd allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -222,7 +223,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd firstprivate(argc)
+#pragma omp distribute parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -211,7 +212,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd lastprivate(argc)
+#pragma omp distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -283,7 +284,7 @@ int main(int argc, char **argv) {
 // expected-error at +3 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd linear (argc)
+#pragma omp distribute parallel for simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -142,7 +143,7 @@ int foomain(I argc, C **argv) {
     ++k;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd private(argc)
+#pragma omp distribute parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -334,7 +335,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd reduction(&& : argc)
+#pragma omp distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -63,7 +64,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp distribute private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp distribute private (argc)
+  #pragma omp distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp distribute private (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -27,23 +27,23 @@ public:
   S7(typename T::type v) : a(v) {
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd private(a) private(this->a) private(T::a)
+#pragma omp distribute simd private(a) private(this->a) private(T::a) allocate(T::a)
     for (int k = 0; k < a.a; ++k)
       ++this->a.a;
   }
   S7 &operator=(S7 &s) {
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd private(a) private(this->a)
+#pragma omp distribute simd allocate(a) private(a) private(this->a)
     for (int k = 0; k < s.a.a; ++k)
       ++s.a.a;
     return *this;
   }
 };
 
-// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(T::a){{$}}
-// CHECK: #pragma omp distribute simd private(this->a) private(this->a)
-// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a)
+// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(T::a) allocate(T::a){{$}}
+// CHECK: #pragma omp distribute simd allocate(this->a) private(this->a) private(this->a)
+// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a) allocate(this->S::a)
 
 class S8 : public S7<S> {
   S8() {}

Modified: cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -100,7 +101,7 @@ int foomain(int argc, char **argv) {
     ++k;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd firstprivate(argc)
+#pragma omp distribute simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -211,7 +212,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd lastprivate(argc)
+#pragma omp distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -272,7 +273,7 @@ int main(int argc, char **argv) {
 // expected-error at +3 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd linear (argc)
+#pragma omp distribute simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -142,7 +143,7 @@ int foomain(I argc, C **argv) {
     ++k;
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd private(argc)
+#pragma omp distribute simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/distribute_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -150,7 +151,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute simd reduction(&& : argc)
+#pragma omp distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/flush_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/flush_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/flush_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/flush_messages.cpp Wed Mar 27 07:14:31 2019
@@ -8,7 +8,7 @@ struct S1 { // expected-note 2 {{declare
 
 template <class T>
 T tmain(T argc) {
-#pragma omp flush
+#pragma omp flush allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp flush'}}
   ;
 #pragma omp flush untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp flush'}}
 #pragma omp flush unknown // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}

Modified: cfe/trunk/test/OpenMP/for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -105,14 +105,14 @@ T tmain(T argc) {
   T b = argc, c, d, e, f, g;
   static T a;
 // CHECK: static T a;
-#pragma omp for schedule(dynamic) linear(a)
-  // CHECK-NEXT: #pragma omp for schedule(dynamic) linear(a)
+#pragma omp for schedule(dynamic) linear(a) allocate(a)
+  // CHECK-NEXT: #pragma omp for schedule(dynamic) linear(a) allocate(a)
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
 #pragma omp parallel
-#pragma omp for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) nowait
+#pragma omp for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) nowait
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
@@ -125,7 +125,7 @@ T tmain(T argc) {
           for (int j = 0; j < 2; ++j)
             foo();
   // CHECK-NEXT: #pragma omp parallel
-  // CHECK-NEXT: #pragma omp for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) nowait
+  // CHECK-NEXT: #pragma omp for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) nowait
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -verify -fopenmp %s
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -92,7 +93,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp for firstprivate(argc)
+#pragma omp for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp for lastprivate(argc)
+#pragma omp for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -117,7 +118,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp for linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp for linear (argc : 5)
+  #pragma omp for linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp for linear (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp for private(argc)
+#pragma omp for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp for private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -295,7 +296,7 @@ int main(int argc, char **argv) {
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel
-#pragma omp for reduction(&& : argc)
+#pragma omp for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -90,7 +90,7 @@ template<class T> struct S {
 // CHECK: T res;
 // CHECK: T val;
 // CHECK: T lin = 0;
-    #pragma omp for simd private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5)
+    #pragma omp for simd private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res)
 // CHECK-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5)
     for (T i = 7; i < m_a; ++i) {
       val = v[i-7] + m_a;
@@ -117,7 +117,7 @@ template<class T> struct S {
 template<int LEN> struct S2 {
   static void func(int n, float *a, float *b, float *c) {
     int k1 = 0, k2 = 0;
-#pragma omp for simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN)
+#pragma omp for simd allocate(k1) safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN)
     for(int i = 0; i < n; i++) {
       c[i] = a[i] + b[i];
       c[k1] = a[k1] + b[k1];
@@ -132,7 +132,7 @@ template<int LEN> struct S2 {
 // CHECK: template<> struct S2<4> {
 // CHECK-NEXT: static void func(int n, float *a, float *b, float *c)     {
 // CHECK-NEXT:   int k1 = 0, k2 = 0;
-// CHECK-NEXT: #pragma omp for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4)
+// CHECK-NEXT: #pragma omp for simd allocate(k1) safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4)
 // CHECK-NEXT:   for (int i = 0; i < n; i++) {
 // CHECK-NEXT:     c[i] = a[i] + b[i];
 // CHECK-NEXT:     c[k1] = a[k1] + b[k1];

Modified: cfe/trunk/test/OpenMP/for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -93,7 +94,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp for simd firstprivate(argc)
+#pragma omp for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp for simd lastprivate(argc)
+#pragma omp for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -117,7 +118,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp for simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp for simd linear (argc : 5)
+  #pragma omp for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp for simd private(argc)
+#pragma omp for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp for simd private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -137,7 +138,7 @@ T tmain(T argc) {
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel
-#pragma omp for simd reduction(&& : argc)
+#pragma omp for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/master_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/master_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/master_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/master_messages.cpp Wed Mar 27 07:14:31 2019
@@ -28,7 +28,7 @@ int main() {
   #pragma omp single
   for (int i = 0; i < 10; ++i) {
     foo();
-    #pragma omp master // expected-error {{region cannot be closely nested inside 'single' region}}
+    #pragma omp master allocate(i) // expected-error {{region cannot be closely nested inside 'single' region}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp master'}}
     foo();
   }
   #pragma omp master

Modified: cfe/trunk/test/OpenMP/ordered_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/ordered_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/ordered_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/ordered_messages.cpp Wed Mar 27 07:14:31 2019
@@ -262,7 +262,7 @@ int k;
 #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}}
 #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}}
 #pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}}
-#pragma omp ordered depend(sink : i, j)
+#pragma omp ordered depend(sink : i, j) allocate(i) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp ordered'}}
 #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}}
 #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}}
 #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}}

Modified: cfe/trunk/test/OpenMP/parallel_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -205,13 +205,13 @@ int main (int argc, char **argv) {
 // CHECK-NEXT: #pragma omp parallel
   a=2;
 // CHECK-NEXT: a = 2;
-#pragma omp parallel default(none), private(argc,b) firstprivate(argv) if (parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(| : c, d, arr1[argc]) reduction(* : e, arr[:10][0:argc])
-// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) if(parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(|: c,d,arr1[argc]) reduction(*: e,arr[:10][0:argc])
+#pragma omp parallel default(none), private(argc,b) firstprivate(argv) if (parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(| : c, d, arr1[argc]) reduction(* : e, arr[:10][0:argc]) allocate(e)
+// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) if(parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(|: c,d,arr1[argc]) reduction(*: e,arr[:10][0:argc]) allocate(e)
   foo();
 // CHECK-NEXT: foo();
-// CHECK-NEXT: #pragma omp parallel if(b) num_threads(c) proc_bind(close) reduction(^: e,f) reduction(&&: g,arr[0:argc][:10])
+// CHECK-NEXT: #pragma omp parallel allocate(e) if(b) num_threads(c) proc_bind(close) reduction(^: e,f) reduction(&&: g,arr[0:argc][:10])
 // CHECK-NEXT: foo()
-#pragma omp parallel if (b) num_threads(c) proc_bind(close) reduction(^:e, f) reduction(&& : g, arr[0:argc][:10])
+#pragma omp parallel allocate(e) if (b) num_threads(c) proc_bind(close) reduction(^:e, f) reduction(&& : g, arr[0:argc][:10])
   foo();
   return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x);
 }

Modified: cfe/trunk/test/OpenMP/parallel_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -71,7 +72,7 @@ int main(int argc, char **argv) {
   #pragma omp parallel firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
   #pragma omp parallel firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   #pragma omp parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-  #pragma omp parallel firstprivate (argc)
+  #pragma omp parallel firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   #pragma omp parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}}
   #pragma omp parallel firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
   #pragma omp parallel firstprivate (d)

Modified: cfe/trunk/test/OpenMP/parallel_for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -70,13 +70,13 @@ T tmain(T argc) {
 // CHECK: static T a;
   static T g;
 #pragma omp threadprivate(g)
-#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a)
-  // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a)
+#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a)
+  // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a)
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
-#pragma omp parallel for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
+#pragma omp parallel for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
@@ -88,7 +88,7 @@ T tmain(T argc) {
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             foo();
-  // CHECK-NEXT: #pragma omp parallel for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
+  // CHECK-NEXT: #pragma omp parallel for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/parallel_for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -86,7 +87,7 @@ int foomain(int argc, char **argv) {
 #pragma omp parallel for firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for firstprivate(argc)
+#pragma omp parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for lastprivate(argc)
+#pragma omp parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
 int x;
 };
@@ -42,7 +43,7 @@ void test_linear_colons() {
 #pragma omp parallel for linear(B, ::z, X::x)
   for (int i = 0; i < 10; ++i)
     ;
-#pragma omp parallel for linear(::z)
+#pragma omp parallel for linear(::z) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     ;
 // expected-error at +1 {{expected variable name}}

Modified: cfe/trunk/test/OpenMP/parallel_for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for private(argc)
+#pragma omp parallel for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -130,7 +131,7 @@ T tmain(T argc) {
 #pragma omp parallel for 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp parallel for reduction(&& : argc)
+#pragma omp parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -91,8 +91,8 @@ template<class T> struct S {
 // CHECK: T res;
 // CHECK: T val;
 // CHECK: T lin = 0;
-    #pragma omp parallel for simd private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) if(7)
-// CHECK-NEXT: #pragma omp parallel for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) if(7)
+    #pragma omp parallel for simd private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) if(7) allocate(lin)
+// CHECK-NEXT: #pragma omp parallel for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) if(7) allocate(lin)
     for (T i = 7; i < m_a; ++i) {
       val = v[i-7] + m_a;
       res = val;
@@ -118,7 +118,7 @@ template<class T> struct S {
 template<int LEN> struct S2 {
   static void func(int n, float *a, float *b, float *c) {
     int k1 = 0, k2 = 0;
-#pragma omp parallel for simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN)
+#pragma omp parallel for simd allocate(k1) safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN)
     for(int i = 0; i < n; i++) {
       c[i] = a[i] + b[i];
       c[k1] = a[k1] + b[k1];
@@ -133,7 +133,7 @@ template<int LEN> struct S2 {
 // CHECK: template<> struct S2<4> {
 // CHECK-NEXT: static void func(int n, float *a, float *b, float *c)     {
 // CHECK-NEXT:   int k1 = 0, k2 = 0;
-// CHECK-NEXT: #pragma omp parallel for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4)
+// CHECK-NEXT: #pragma omp parallel for simd allocate(k1) safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4)
 // CHECK-NEXT:   for (int i = 0; i < n; i++) {
 // CHECK-NEXT:     c[i] = a[i] + b[i];
 // CHECK-NEXT:     c[k1] = a[k1] + b[k1];

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -86,7 +87,7 @@ int foomain(int argc, char **argv) {
 #pragma omp parallel for simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for simd firstprivate(argc)
+#pragma omp parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -87,7 +88,7 @@ int foomain(int argc, char **argv) {
 #pragma omp parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for simd lastprivate(argc)
+#pragma omp parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -117,7 +118,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp parallel for simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp parallel for simd linear (argc : 5)
+  #pragma omp parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp parallel for simd private(argc)
+#pragma omp parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -124,7 +125,7 @@ T tmain(T argc) {
 #pragma omp parallel for 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp parallel for simd reduction(&& : argc)
+#pragma omp parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/parallel_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -68,7 +69,7 @@ int main(int argc, char **argv) {
   #pragma omp parallel private (S1) // expected-error {{'S1' does not refer to a value}}
   #pragma omp parallel private (a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}}
   #pragma omp parallel private (argv[1]) // expected-error {{expected variable name}}
-  #pragma omp parallel private(ba)
+  #pragma omp parallel private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   #pragma omp parallel private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}
   #pragma omp parallel private(da) // expected-error {{const-qualified variable cannot be private}}
   #pragma omp parallel private(S2::S2s) // expected-error {{shared variable cannot be private}}

Modified: cfe/trunk/test/OpenMP/parallel_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -112,7 +113,7 @@ T tmain(T argc) {
   foo();
 #pragma omp parallel 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'}}
   foo();
-#pragma omp parallel reduction(&& : argc)
+#pragma omp parallel reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -41,11 +41,11 @@ T tmain(T argc, T *argv) {
   {
     a = 2;
   }
-#pragma omp parallel sections default(none), private(argc, b) firstprivate(argv) shared(d) if (parallel: argc > 0) num_threads(C) copyin(S < T > ::TS) proc_bind(master) reduction(+ : c) reduction(max : e)
+#pragma omp parallel sections default(none), private(argc, b) firstprivate(argv) shared(d) if (parallel: argc > 0) num_threads(C) copyin(S < T > ::TS) proc_bind(master) reduction(+ : c) reduction(max : e) allocate(e)
   {
     foo();
   }
-#pragma omp parallel sections if (C) num_threads(s) proc_bind(close) reduction(^ : e, f) reduction(&& : g) lastprivate(b, c)
+#pragma omp parallel sections allocate(b) if (C) num_threads(s) proc_bind(close) reduction(^ : e, f) reduction(&& : g) lastprivate(b, c)
   {
     foo();
 #pragma omp section
@@ -62,11 +62,11 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: {
 // CHECK-NEXT: a = 2;
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S<T>::TS) proc_bind(master) reduction(+: c) reduction(max: e)
+// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S<T>::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
+// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: #pragma omp section
@@ -80,11 +80,11 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: {
 // CHECK-NEXT: a = 2;
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S<int>::TS) proc_bind(master) reduction(+: c) reduction(max: e)
+// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S<int>::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
+// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: #pragma omp section
@@ -98,11 +98,11 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: {
 // CHECK-NEXT: a = 2;
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S<long>::TS) proc_bind(master) reduction(+: c) reduction(max: e)
+// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S<long>::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp parallel sections if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
+// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c)
 // CHECK-NEXT: {
 // CHECK-NEXT: foo();
 // CHECK-NEXT: #pragma omp section

Modified: cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -92,7 +93,7 @@ int foomain(int argc, char **argv) {
   {
     foo();
   }
-#pragma omp parallel sections firstprivate(argc)
+#pragma omp parallel sections firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -93,7 +94,7 @@ int foomain(int argc, char **argv) {
   {
     foo();
   }
-#pragma omp parallel sections lastprivate(argc)
+#pragma omp parallel sections lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -134,7 +135,7 @@ int foomain(I argc, C **argv) {
   {
     foo();
   }
-#pragma omp parallel sections private(argc)
+#pragma omp parallel sections private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -136,7 +137,7 @@ T tmain(T argc) {
   {
     foo();
   }
-#pragma omp parallel sections reduction(&& : argc)
+#pragma omp parallel sections reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/requires_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/requires_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/requires_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/requires_messages.cpp Wed Mar 27 07:14:31 2019
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100  %s
 
-#pragma omp requires unified_address // expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note{{unified_address clause previously used here}}
+int a;
+#pragma omp requires unified_address allocate(a) // expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note{{unified_address clause previously used here}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp requires'}}
 
 #pragma omp requires unified_shared_memory // expected-note {{unified_shared_memory clause previously used here}} expected-note{{unified_shared_memory clause previously used here}}
 

Modified: cfe/trunk/test/OpenMP/sections_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -18,12 +18,12 @@ T tmain(T argc) {
   static T a;
 // CHECK: static T a;
 #pragma omp parallel
-#pragma omp sections private(argc, b), firstprivate(c, d), lastprivate(d, f) reduction(- : g) nowait
+#pragma omp sections private(argc, b), firstprivate(c, d), lastprivate(d, f) reduction(- : g) nowait allocate(d)
   {
     foo();
   }
   // CHECK-NEXT: #pragma omp parallel
-  // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(c,d) lastprivate(d,f) reduction(-: g) nowait{{$}}
+  // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(c,d) lastprivate(d,f) reduction(-: g) nowait allocate(d){{$}}
   // CHECK-NEXT: {
   // CHECK-NEXT: foo();
   // CHECK-NEXT: }
@@ -36,7 +36,7 @@ int main(int argc, char **argv) {
   static int a;
 // CHECK: static int a;
 #pragma omp parallel
-#pragma omp sections private(argc, b), firstprivate(argv, c), lastprivate(d, f) reduction(+ : g) nowait
+#pragma omp sections allocate(c) private(argc, b), firstprivate(argv, c), lastprivate(d, f) reduction(+ : g) nowait
   {
 #pragma omp section
     foo();
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
     foo();
   }
   // CHECK-NEXT: #pragma omp parallel
-  // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(argv,c) lastprivate(d,f) reduction(+: g) nowait
+  // CHECK-NEXT: #pragma omp sections allocate(c) private(argc,b) firstprivate(argv,c) lastprivate(d,f) reduction(+: g) nowait
   // CHECK-NEXT: {
   // CHECK-NEXT: #pragma omp section{{$}}
   // CHECK-NEXT: foo();

Modified: cfe/trunk/test/OpenMP/sections_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -99,7 +100,7 @@ int foomain(int argc, char **argv) {
     foo();
   }
 #pragma omp parallel
-#pragma omp sections firstprivate(argc)
+#pragma omp sections firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/sections_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -206,7 +207,7 @@ int main(int argc, char **argv) {
     foo();
   }
 #pragma omp parallel
-#pragma omp sections lastprivate(argc)
+#pragma omp sections lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/sections_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -134,7 +135,7 @@ int foomain(I argc, C **argv) {
   {
     foo();
   }
-#pragma omp sections private(argc)
+#pragma omp sections private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/sections_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/sections_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/sections_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/sections_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -14,7 +15,7 @@ bool foobool(int argc) {
 }
 
 void foobar(int &ref) {
-#pragma omp parallel   
+#pragma omp parallel
 #pragma omp sections reduction(+:ref)
   {
     foo();
@@ -149,7 +150,7 @@ T tmain(T argc) {
     foo();
   }
 #pragma omp parallel
-#pragma omp sections reduction(&& : argc)
+#pragma omp sections reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -94,8 +94,8 @@ template<class T> struct S {
 // CHECK: T val;
 // CHECK: T lin = 0;
 // CHECK: T &ref = res;
-    #pragma omp simd private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) linear(ref(ref))
-// CHECK-NEXT: #pragma omp simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) linear(ref(ref))
+    #pragma omp simd allocate(res) private(val)  safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) linear(ref(ref))
+// CHECK-NEXT: #pragma omp simd allocate(res) private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) linear(ref(ref))
     for (T i = 7; i < m_a; ++i) {
       val = v[i-7] + m_a;
       res = val;
@@ -121,7 +121,7 @@ template<class T> struct S {
 template<int LEN> struct S2 {
   static void func(int n, float *a, float *b, float *c) {
     int k1 = 0, k2 = 0;
-#pragma omp simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN)
+#pragma omp simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) allocate(k1)
     for(int i = 0; i < n; i++) {
       c[i] = a[i] + b[i];
       c[k1] = a[k1] + b[k1];
@@ -136,7 +136,7 @@ template<int LEN> struct S2 {
 // CHECK: template<> struct S2<4> {
 // CHECK-NEXT: static void func(int n, float *a, float *b, float *c)     {
 // CHECK-NEXT:   int k1 = 0, k2 = 0;
-// CHECK-NEXT: #pragma omp simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4)
+// CHECK-NEXT: #pragma omp simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) allocate(k1)
 // CHECK-NEXT:   for (int i = 0; i < n; i++) {
 // CHECK-NEXT:     c[i] = a[i] + b[i];
 // CHECK-NEXT:     c[k1] = a[k1] + b[k1];

Modified: cfe/trunk/test/OpenMP/simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -87,7 +88,7 @@ int foomain(I argc, C **argv) {
 #pragma omp simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp simd lastprivate(argc)
+#pragma omp simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -127,7 +128,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp simd linear (argc : 5)
+  #pragma omp simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp simd linear (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -105,7 +106,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp simd private (argc)
+  #pragma omp simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp simd private (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -124,7 +125,7 @@ T tmain(T argc) {
 #pragma omp 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp simd reduction(&& : argc)
+#pragma omp simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/single_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/single_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/single_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -46,16 +46,16 @@ T tmain(T argc) {
   SST<T> sst;
 // CHECK: static T a;
 #pragma omp parallel private(g)
-#pragma omp single private(argc, b), firstprivate(c, d), nowait
+#pragma omp single private(argc, b), firstprivate(c, d), nowait allocate(d)
   foo();
   // CHECK: #pragma omp parallel private(g)
-  // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait
+  // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait allocate(d)
   // CHECK-NEXT: foo();
 #pragma omp parallel private(g)
-#pragma omp single private(argc, b), firstprivate(c, d), copyprivate(g)
+#pragma omp single allocate(argc) private(argc, b), firstprivate(c, d), copyprivate(g)
   foo();
   // CHECK-NEXT: #pragma omp parallel private(g)
-  // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) copyprivate(g)
+  // CHECK-NEXT: #pragma omp single allocate(argc) private(argc,b) firstprivate(c,d) copyprivate(g)
   // CHECK-NEXT: foo();
   return T();
 }

Modified: cfe/trunk/test/OpenMP/single_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/single_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/single_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -87,7 +88,7 @@ int foomain(int argc, char **argv) {
 #pragma omp single firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   foo();
 #pragma omp parallel
-#pragma omp single firstprivate(argc)
+#pragma omp single firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp parallel
 #pragma omp single firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/single_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/single_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/single_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -110,7 +111,7 @@ int foomain(I argc, C **argv) {
   foo();
 #pragma omp single private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   foo();
-#pragma omp single private(argc)
+#pragma omp single private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp single private(S1) // expected-error {{'S1' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_data_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_data_messages.c?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_data_messages.c (original)
+++ cfe/trunk/test/OpenMP/target_data_messages.c Wed Mar 27 07:14:31 2019
@@ -10,7 +10,7 @@ int main(int argc, char **argv) {
   {}
   L1:
     foo();
-  #pragma omp target data map(a)
+  #pragma omp target data map(a) allocate(a) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target data'}}
   {
     foo();
     goto L1; // expected-error {{use of undeclared label 'L1'}}

Modified: cfe/trunk/test/OpenMP/target_enter_data_map_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_enter_data_map_messages.c?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_enter_data_map_messages.c (original)
+++ cfe/trunk/test/OpenMP/target_enter_data_map_messages.c Wed Mar 27 07:14:31 2019
@@ -12,7 +12,7 @@ int main(int argc, char **argv) {
   #pragma omp target enter data map(r) // expected-error {{map type must be specified for '#pragma omp target enter data'}}
   #pragma omp target enter data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target enter data'}}
 
-  #pragma omp target enter data map(always, to: r)
+  #pragma omp target enter data map(always, to: r) allocate(r) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target enter data'}}
   #pragma omp target enter data map(always, alloc: r)
   #pragma omp target enter data map(always, from: r) // expected-error {{map type 'from' is not allowed for '#pragma omp target enter data'}}
   #pragma omp target enter data map(release: r) // expected-error {{map type 'release' is not allowed for '#pragma omp target enter data'}}

Modified: cfe/trunk/test/OpenMP/target_exit_data_map_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_exit_data_map_messages.c?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_exit_data_map_messages.c (original)
+++ cfe/trunk/test/OpenMP/target_exit_data_map_messages.c Wed Mar 27 07:14:31 2019
@@ -12,7 +12,7 @@ int main(int argc, char **argv) {
   #pragma omp target exit data map(r) // expected-error {{map type must be specified for '#pragma omp target exit data'}}
   #pragma omp target exit data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target exit data'}}
 
-  #pragma omp target exit data map(always, from: r)
+  #pragma omp target exit data map(always, from: r) allocate(r) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target exit data'}}
   #pragma omp target exit data map(delete: r)
   #pragma omp target exit data map(release: r)
   #pragma omp target exit data map(always, alloc: r) // expected-error {{map type 'alloc' is not allowed for '#pragma omp target exit data'}}

Modified: cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
 class S2 {
@@ -103,7 +104,7 @@ int foomain(I argc, C **argv) {
 {}
 #pragma omp target firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
 {}
-#pragma omp target firstprivate(argc)
+#pragma omp target firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
 {}
 #pragma omp target firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
 {}

Modified: cfe/trunk/test/OpenMP/target_parallel_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -41,9 +41,9 @@ T tmain(T argc, T *argv) {
   T i, j, a[20];
 #pragma omp target parallel
   h=2;
-#pragma omp target parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(C) proc_bind(master) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10])
+#pragma omp target parallel allocate(argv) default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(C) proc_bind(master) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10])
   foo();
-#pragma omp target parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(&& : g)
+#pragma omp target parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(&& : g) allocate(g)
   foo();
 #pragma omp target parallel if (target:argc > 0)
   foo();
@@ -76,9 +76,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: T i, j, a[20]
 // CHECK-NEXT: #pragma omp target parallel{{$}}
 // CHECK-NEXT: h = 2;
-// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10])
+// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10])
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) allocate(g)
 // CHECK-NEXT: foo()
 // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0)
 // CHECK-NEXT: foo()
@@ -108,9 +108,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: int i, j, a[20]
 // CHECK-NEXT: #pragma omp target parallel
 // CHECK-NEXT: h = 2;
-// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10])
+// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10])
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) allocate(g)
 // CHECK-NEXT: foo()
 // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0)
 // CHECK-NEXT: foo()
@@ -140,9 +140,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: char i, j, a[20]
 // CHECK-NEXT: #pragma omp target parallel
 // CHECK-NEXT: h = 2;
-// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10])
+// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10])
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) allocate(g)
 // CHECK-NEXT: foo()
 // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0)
 // CHECK-NEXT: foo()

Modified: cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
   foo();
   #pragma omp target parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   foo();
-  #pragma omp target parallel firstprivate (argc)
+  #pragma omp target parallel firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
   #pragma omp target parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_parallel_for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -73,13 +73,13 @@ T tmain(T argc, T *argv) {
 // CHECK: static T a;
   static T g;
 #pragma omp threadprivate(g)
-#pragma omp target parallel for schedule(dynamic) default(none) linear(a)
-  // CHECK: #pragma omp target parallel for schedule(dynamic) default(none) linear(a)
+#pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a)
+  // CHECK: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a)
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
-#pragma omp target parallel for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
+#pragma omp target parallel for allocate(b) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
@@ -91,7 +91,7 @@ T tmain(T argc, T *argv) {
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             foo();
-  // CHECK-NEXT: #pragma omp target parallel for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
+  // CHECK-NEXT: #pragma omp target parallel for allocate(b) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -86,7 +87,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target parallel for firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for firstprivate(argc)
+#pragma omp target parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for lastprivate(argc)
+#pragma omp target parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
 int x;
 };
@@ -139,7 +140,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for linear(argc : 5)
+#pragma omp target parallel for linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for linear(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for private(argc)
+#pragma omp target parallel for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -124,7 +125,7 @@ T tmain(T argc) {
 #pragma omp target parallel for 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp target parallel for reduction(&& : argc)
+#pragma omp target parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -75,20 +75,20 @@ T tmain(T argc, T *argv) {
   const T clen = 5;
 // CHECK: T clen = 5;
 #pragma omp threadprivate(g)
-#pragma omp target parallel for simd schedule(dynamic) default(none) linear(a)
-  // CHECK: #pragma omp target parallel for simd schedule(dynamic) default(none) linear(a)
+#pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) allocate(a)
+  // CHECK: #pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) allocate(a)
   for (T i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (T i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
-#pragma omp target parallel for simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
+#pragma omp target parallel for simd allocate(d) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             foo();
-  // CHECK-NEXT: #pragma omp target parallel for simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
+  // CHECK-NEXT: #pragma omp target parallel for simd allocate(d) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -171,7 +172,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for simd firstprivate(argc)
+#pragma omp target parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -162,7 +163,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for simd lastprivate(argc)
+#pragma omp target parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
 int x;
 };
@@ -139,7 +140,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for simd linear(argc : 5)
+#pragma omp target parallel for simd linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for simd linear(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for simd private(argc)
+#pragma omp target parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -124,7 +125,7 @@ T tmain(T argc) {
 #pragma omp target parallel for 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp target parallel for simd reduction(&& : argc)
+#pragma omp target parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -76,7 +77,7 @@ int foomain(I argc, C **argv) {
 {}
 #pragma omp target parallel private(argc argv) // expected-error {{expected ',' or ')' in 'private' clause}}
 {}
-#pragma omp target parallel private(argc)
+#pragma omp target parallel private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
 {}
 #pragma omp target parallel private(S1) // expected-error {{'S1' does not refer to a value}}
 {}

Modified: cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -112,7 +113,7 @@ T tmain(T argc) {
   foo();
 #pragma omp target parallel 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'}}
   foo();
-#pragma omp target parallel reduction(&& : argc)
+#pragma omp target parallel reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
 class S2 {
@@ -103,7 +104,7 @@ int foomain(I argc, C **argv) {
 {}
 #pragma omp target private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
 {}
-#pragma omp target private(argc)
+#pragma omp target private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
 {}
 #pragma omp target private(S1) // expected-error {{'S1' does not refer to a value}}
 {}

Modified: cfe/trunk/test/OpenMP/target_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -207,7 +208,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp target reduction(~ : argc) // expected-error {{expected unqualified-id}}
   foo();
-#pragma omp target reduction(&& : argc)
+#pragma omp target reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -76,20 +76,20 @@ T tmain(T argc, T *argv) {
 // CHECK: T clen = 5;
   T *p;
 #pragma omp threadprivate(g)
-#pragma omp target simd linear(a)
-  // CHECK: #pragma omp target simd linear(a)
+#pragma omp target simd linear(a) allocate(a)
+  // CHECK: #pragma omp target simd linear(a) allocate(a)
   for (T i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (T i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
-#pragma omp target simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) if (target :argc) reduction(+ : h)
+#pragma omp target simd allocate(f) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) if (target :argc) reduction(+ : h)
   for (int i = 0; i < 2; ++i)
     for (int j = 0; j < 2; ++j)
       for (int j = 0; j < 2; ++j)
         for (int j = 0; j < 2; ++j)
           for (int j = 0; j < 2; ++j)
             foo();
-  // CHECK-NEXT: #pragma omp target simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) if(target: argc) reduction(+: h)
+  // CHECK-NEXT: #pragma omp target simd allocate(f) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) if(target: argc) reduction(+: h)
   // CHECK-NEXT: for (int i = 0; i < 2; ++i)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)
   // CHECK-NEXT: for (int j = 0; j < 2; ++j)

Modified: cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -86,7 +87,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target simd firstprivate(argc)
+#pragma omp target simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target simd lastprivate(argc)
+#pragma omp target simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
 int x;
 };
@@ -139,7 +140,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target simd linear(argc : 5)
+#pragma omp target simd linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target simd linear(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target simd private(argc)
+#pragma omp target simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target simd private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -124,7 +125,7 @@ T tmain(T argc) {
 #pragma omp target 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp target simd reduction(&& : argc)
+#pragma omp target simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp target simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -39,9 +39,9 @@ T tmain(T argc, T *argv) {
   S<T> s;
 #pragma omp target teams
   a=2;
-#pragma omp target teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) num_teams(C) thread_limit(d*C)
+#pragma omp target teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) num_teams(C) thread_limit(d*C) allocate(argv)
   foo();
-#pragma omp target teams reduction(^:e, f) reduction(&& : g)
+#pragma omp target teams allocate(f) reduction(^:e, f) reduction(&& : g)
   foo();
   return 0;
 }
@@ -52,9 +52,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: S<T> s;
 // CHECK-NEXT: #pragma omp target teams{{$}}
 // CHECK-NEXT: a = 2;
-// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C)
+// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C) allocate(argv)
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g)
 // CHECK-NEXT: foo()
 // CHECK: template<> int tmain<int, 5>(int argc, int *argv) {
 // CHECK-NEXT: int b = argc, c, d, e, f, g;
@@ -62,9 +62,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: S<int> s;
 // CHECK-NEXT: #pragma omp target teams
 // CHECK-NEXT: a = 2;
-// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5)
+// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5) allocate(argv)
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g)
 // CHECK-NEXT: foo()
 // CHECK: template<> long tmain<long, 1>(long argc, long *argv) {
 // CHECK-NEXT: long b = argc, c, d, e, f, g;
@@ -72,9 +72,9 @@ T tmain(T argc, T *argv) {
 // CHECK-NEXT: S<long> s;
 // CHECK-NEXT: #pragma omp target teams
 // CHECK-NEXT: a = 2;
-// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1)
+// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1) allocate(argv)
 // CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g)
+// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g)
 // CHECK-NEXT: foo()
 
 enum Enum { };

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -55,7 +55,7 @@ class S8 : public S7<S> {
 
 public:
   S8(int v) : S7<S>(v){
-#pragma omp target teams distribute private(a) private(this->a) private(S7<S>::a) 
+#pragma omp target teams distribute private(a) private(this->a) private(S7<S>::a)
     for (int k = 0; k < a.a; ++k)
       ++this->a.a;
   }
@@ -68,14 +68,14 @@ public:
 
   void bar() {
     int b, argv, d, c, e, f;
-#pragma omp target teams distribute default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
+#pragma omp target teams distribute allocate(argv) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) allocate(e)
     for (int k = 0; k < a.a; ++k)
       ++a.a;
   }
 };
 // CHECK: #pragma omp target teams distribute private(this->a) private(this->a) private(this->S7<S>::a)
 // CHECK: #pragma omp target teams distribute private(this->a) private(this->a)
-// CHECK: #pragma omp target teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
+// CHECK: #pragma omp target teams distribute allocate(argv) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) allocate(e)
 
 template <class T, int N>
 T tmain(T argc) {

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -84,7 +85,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute firstprivate (argc)
+#pragma omp target teams distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute firstprivate (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -162,7 +163,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute lastprivate(argc)
+#pragma omp target teams distribute lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -72,7 +72,7 @@ public:
   }
   void bar() {
     int b, argv, d, c, e, f8;
-#pragma omp target teams distribute parallel for default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d)
+#pragma omp target teams distribute parallel for allocate(b) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) allocate(e)
     for (int k = 0; k < a.a; ++k)
       ++a.a;
   }
@@ -80,7 +80,7 @@ public:
 // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a) private(this->S::a)
 // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a) private(this->S7<S>::a)
 // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a)
-// CHECK: #pragma omp target teams distribute parallel for default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d)
+// CHECK: #pragma omp target teams distribute parallel for allocate(b) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) allocate(e)
 
 template <class T, int N>
 T tmain(T argc) {

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -84,7 +85,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute parallel for firstprivate (argc)
+#pragma omp target teams distribute parallel for firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute parallel for firstprivate (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target teams distribute parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute parallel for lastprivate(argc)
+#pragma omp target teams distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -70,7 +71,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute parallel for private (argc)
+#pragma omp target teams distribute parallel for private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute parallel for private (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -107,7 +108,7 @@ T tmain(T argc) {
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute parallel for 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 teams distribute parallel for reduction(&& : argc)
+#pragma omp target teams distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   for (int j=0; j<100; j++) foo();

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -33,7 +33,7 @@ public:
   }
   S7 &operator=(S7 &s) {
     int k;
-#pragma omp target teams distribute parallel for simd private(a) private(this->a) linear(k)
+#pragma omp target teams distribute parallel for simd allocate(a) private(a) private(this->a) linear(k) allocate(k)
     for (k = 0; k < s.a.a; ++k)
       ++s.a.a;
 
@@ -58,7 +58,7 @@ public:
   }
 };
 // CHECK: #pragma omp target teams distribute parallel for simd private(this->a) private(this->a) private(T::a)
-// CHECK: #pragma omp target teams distribute parallel for simd private(this->a) private(this->a) linear(k)
+// CHECK: #pragma omp target teams distribute parallel for simd allocate(this->a) private(this->a) private(this->a) linear(k) allocate(k)
 // CHECK: #pragma omp target teams distribute parallel for simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
 // CHECK: #pragma omp target teams distribute parallel for simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
 

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -84,7 +85,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for simd firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute parallel for simd firstprivate (argc)
+#pragma omp target teams distribute parallel for simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute parallel for simd firstprivate (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target teams distribute parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute parallel for simd lastprivate(argc)
+#pragma omp target teams distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -142,7 +143,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
 
 // expected-error at +1 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
-#pragma omp target teams distribute parallel for simd linear (argc : 5)
+#pragma omp target teams distribute parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -70,7 +71,7 @@ int main(int argc, char **argv) {
   #pragma omp target teams distribute parallel for simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-  #pragma omp target teams distribute parallel for simd private (argc)
+  #pragma omp target teams distribute parallel for simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target teams distribute parallel for simd private (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -107,7 +108,7 @@ T tmain(T argc) {
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute parallel for 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 teams distribute parallel for simd reduction(&& : argc)
+#pragma omp target teams distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   for (int j=0; j<100; j++) foo();

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -70,7 +71,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute private (argc)
+#pragma omp target teams distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute private (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -112,7 +113,7 @@ T tmain(T argc) {
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute 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 teams distribute reduction(&& : argc)
+#pragma omp target teams distribute reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   for (int j=0; j<100; j++) foo();

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -33,7 +33,7 @@ public:
   }
   S7 &operator=(S7 &s) {
     int k;
-#pragma omp target teams distribute simd private(a) private(this->a) linear(k)
+#pragma omp target teams distribute simd allocate(a) private(a) private(this->a) linear(k) allocate(k)
     for (k = 0; k < s.a.a; ++k)
       ++s.a.a;
     return *this;
@@ -55,7 +55,7 @@ public:
   }
 };
 // CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) private(T::a)
-// CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) linear(k)
+// CHECK: #pragma omp target teams distribute simd allocate(this->a) private(this->a) private(this->a) linear(k) allocate(k)
 // CHECK: #pragma omp target teams distribute simd private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
 // CHECK: #pragma omp target teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
 // CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) private(this->S::a)

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -84,7 +85,7 @@ int main(int argc, char **argv) {
 #pragma omp target 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 teams distribute simd firstprivate (argc)
+#pragma omp target teams distribute simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute simd firstprivate (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -88,7 +89,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target 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 teams distribute simd lastprivate(argc)
+#pragma omp target teams distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -209,7 +210,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
 // expected-error at +1 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
-#pragma omp target teams distribute simd linear (argc)
+#pragma omp target teams distribute simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute simd linear (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -70,7 +71,7 @@ int main(int argc, char **argv) {
 #pragma omp target 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 teams distribute simd private (argc)
+#pragma omp target teams distribute simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute simd private (S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -107,7 +108,7 @@ T tmain(T argc) {
   for (int j=0; j<100; j++) foo();
 #pragma omp target 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 teams distribute simd reduction(&& : argc)
+#pragma omp target teams distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target teams distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   for (int j=0; j<100; j++) foo();

Modified: cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -78,7 +79,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp target teams firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   foo();
-#pragma omp target teams firstprivate(argc)
+#pragma omp target teams firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target teams firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_teams_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -78,7 +79,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp target teams private (argv[1]) // expected-error {{expected variable name}}
   foo();
-#pragma omp target teams private(ba)
+#pragma omp target teams private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target teams private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -112,7 +113,7 @@ T tmain(T argc) {
   foo();
 #pragma omp target teams 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'}}
   foo();
-#pragma omp target teams reduction(&& : argc)
+#pragma omp target teams reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target teams reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/target_update_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_update_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_update_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_update_messages.cpp Wed Mar 27 07:14:31 2019
@@ -26,7 +26,7 @@ int main(int argc, char **argv) {
   #pragma omp target update to(m) ] // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
   #pragma omp target update to(m) ) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
 
-  #pragma omp target update from(m) // OK
+  #pragma omp target update from(m) allocate(m) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target update'}}
   {
     foo();
   }

Modified: cfe/trunk/test/OpenMP/task_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/task_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/task_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -28,8 +28,8 @@ protected:
 
 public:
   S7(typename T::type v) : a(v) {
-#pragma omp taskgroup task_reduction(+:b)
-#pragma omp task private(a) private(this->a) private(T::a) in_reduction(+:this->b)
+#pragma omp taskgroup allocate(b) task_reduction(+:b)
+#pragma omp task private(a) private(this->a) private(T::a) in_reduction(+:this->b) allocate(b)
     for (int k = 0; k < a.a; ++k)
       ++this->a.a;
   }
@@ -41,8 +41,8 @@ public:
   }
 };
 
-// CHECK: #pragma omp taskgroup task_reduction(+: this->b)
-// CHECK: #pragma omp task private(this->a) private(this->a) private(T::a) in_reduction(+: this->b){{$}}
+// CHECK: #pragma omp taskgroup allocate(this->b) task_reduction(+: this->b)
+// CHECK: #pragma omp task private(this->a) private(this->a) private(T::a) in_reduction(+: this->b) allocate(this->b){{$}}
 // CHECK: #pragma omp task private(this->a) private(this->a)
 // CHECK: #pragma omp task private(this->a) private(this->a) private(this->S1::a)
 

Modified: cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -91,7 +92,7 @@ int main(int argc, char **argv) {
 #pragma omp task firstprivate(argc                          // expected-error {{expected ')'}} expected-note {{to match this '('}}
 #pragma omp task firstprivate(argc,                         // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
 #pragma omp task firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
-#pragma omp task firstprivate(argc)
+#pragma omp task firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
 #pragma omp task firstprivate(S1)            // expected-error {{'S1' does not refer to a value}}
 #pragma omp task firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
 #pragma omp task firstprivate(argv[1])       // expected-error {{expected variable name}}

Modified: cfe/trunk/test/OpenMP/task_in_reduction_message.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/task_in_reduction_message.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_in_reduction_message.cpp (original)
+++ cfe/trunk/test/OpenMP/task_in_reduction_message.cpp Wed Mar 27 07:14:31 2019
@@ -7,6 +7,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 // SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -245,7 +246,7 @@ int main(int argc, char **argv) {
 #pragma omp task in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
   foo();
 }
-#pragma omp task in_reduction(| : argc)
+#pragma omp task in_reduction(| : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 }
 #pragma omp task in_reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}

Modified: cfe/trunk/test/OpenMP/task_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/task_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/task_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
 #pragma omp task private(S1)                           // expected-error {{'S1' does not refer to a value}}
 #pragma omp task private(a, b, c, d, f)                // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}}
 #pragma omp task private(argv[1])                      // expected-error {{expected variable name}}
-#pragma omp task private(ba)
+#pragma omp task private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
 #pragma omp task private(ca)           // expected-error {{const-qualified variable without mutable fields cannot be private}}
 #pragma omp task private(da)           // expected-error {{const-qualified variable cannot be private}}
 #pragma omp task private(S2::S2s)      // expected-error {{shared variable cannot be private}}

Modified: cfe/trunk/test/OpenMP/taskgroup_task_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskgroup_task_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskgroup_task_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskgroup_task_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -112,7 +113,7 @@ T tmain(T argc) {
   foo();
 #pragma omp taskgroup task_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'}}
   foo();
-#pragma omp taskgroup task_reduction(&& : argc)
+#pragma omp taskgroup task_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp taskgroup task_reduction(^ : T) // expected-error {{'T' does not refer to a value}}
   foo();

Modified: cfe/trunk/test/OpenMP/taskloop_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -17,10 +17,10 @@ T tmain(T argc) {
   T b = argc, c, d, e, f, g;
   static T a;
 // CHECK: static T a;
-#pragma omp taskgroup task_reduction(+: d)
-#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) in_reduction(+: d)
-  // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
-  // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) in_reduction(+: d){{$}}
+#pragma omp taskgroup allocate(d) task_reduction(+: d)
+#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) in_reduction(+: d) allocate(d)
+  // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d)
+  // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) in_reduction(+: d) allocate(d){{$}}
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)

Modified: cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -199,7 +200,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp parallel
-#pragma omp taskloop firstprivate(argc)
+#pragma omp taskloop firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -164,7 +165,7 @@ T tmain(T argc) {
   for (int i = 0; i < 10; ++i)
   foo();
 #pragma omp taskgroup task_reduction(&&:argc)
-#pragma omp taskloop in_reduction(&& : argc)
+#pragma omp taskloop in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
   foo();
 #pragma omp taskloop in_reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp taskloop lastprivate(argc)
+#pragma omp taskloop lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/taskloop_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp taskloop private(argc)
+#pragma omp taskloop private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp taskloop private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -133,7 +134,7 @@ T tmain(T argc) {
 #pragma omp taskloop 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp taskloop reduction(&& : argc)
+#pragma omp taskloop reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp taskloop reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -18,10 +18,10 @@ T tmain(T argc) {
   T *ptr;
   static T a;
 // CHECK: static T a;
-#pragma omp taskgroup task_reduction(+: d)
-#pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d)
-  // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
-  // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}}
+#pragma omp taskgroup task_reduction(+: d) allocate(d)
+#pragma omp taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d)
+  // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) allocate(d)
+  // CHECK-NEXT: #pragma omp taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}}
   for (int i = 0; i < 2; ++i)
     a = 2;
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)

Modified: cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -93,7 +94,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp taskloop simd firstprivate(argc)
+#pragma omp taskloop simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -164,7 +165,7 @@ T tmain(T argc) {
   for (int i = 0; i < 10; ++i)
   foo();
 #pragma omp taskgroup task_reduction(&&:argc)
-#pragma omp taskloop simd in_reduction(&& : argc)
+#pragma omp taskloop simd in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
   foo();
 #pragma omp taskloop simd in_reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp taskloop simd lastprivate(argc)
+#pragma omp taskloop simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel

Modified: cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -127,7 +128,7 @@ template<class I, class C> int foomain(I
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
-  #pragma omp taskloop simd linear (argc : 5)
+  #pragma omp taskloop simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
   #pragma omp taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
   for (int k = 0; k < argc; ++k) ++k;

Modified: cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -116,7 +117,7 @@ int foomain(I argc, C **argv) {
 #pragma omp taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp taskloop simd private(argc)
+#pragma omp taskloop simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -133,7 +134,7 @@ T tmain(T argc) {
 #pragma omp taskloop 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 i = 0; i < 10; ++i)
     foo();
-#pragma omp taskloop simd reduction(&& : argc)
+#pragma omp taskloop simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp taskloop simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/taskwait_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskwait_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskwait_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskwait_messages.cpp Wed Mar 27 07:14:31 2019
@@ -4,7 +4,7 @@
 
 template <class T>
 T tmain(T argc) {
-#pragma omp taskwait
+#pragma omp taskwait allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskwait'}}
   ;
 #pragma omp taskwait untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}}
 #pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}}

Modified: cfe/trunk/test/OpenMP/taskyield_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskyield_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskyield_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskyield_messages.cpp Wed Mar 27 07:14:31 2019
@@ -4,7 +4,7 @@
 
 template <class T>
 T tmain(T argc) {
-#pragma omp taskyield
+#pragma omp taskyield allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskyield'}}
   ;
 #pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
 #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}

Modified: cfe/trunk/test/OpenMP/teams_distribute_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -10,6 +10,16 @@
 #ifndef HEADER
 #define HEADER
 
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
 void foo() {}
 
 struct S {
@@ -78,7 +88,7 @@ public:
   void bar() {
     int b, argv, d, c, e, f;
 #pragma omp target
-#pragma omp teams distribute default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
+#pragma omp teams distribute allocate(omp_thread_mem_alloc:argv) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc:c)
     for (int k = 0; k < a.a; ++k)
       ++a.a;
   }
@@ -88,7 +98,7 @@ public:
 // CHECK: #pragma omp target
 // CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a)
 // CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
+// CHECK-NEXT: #pragma omp teams distribute allocate(omp_thread_mem_alloc: argv) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc: c)
 
 template <class T, int N>
 T tmain(T argc) {

Modified: cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -91,7 +92,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target
-#pragma omp teams distribute firstprivate (argc)
+#pragma omp teams distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target
-#pragma omp teams distribute lastprivate(argc)
+#pragma omp teams distribute lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -81,7 +81,7 @@ public:
   void bar() {
     int b, argv, d, c, e, f8;
 #pragma omp target
-#pragma omp teams distribute parallel for default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) copyin(x)
+#pragma omp teams distribute parallel for allocate(b) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) copyin(x) allocate(argv)
     for (int k = 0; k < a.a; ++k)
       ++a.a;
   }
@@ -93,7 +93,7 @@ public:
 // CHECK: #pragma omp target
 // CHECK-NEXT: #pragma omp teams distribute parallel for private(this->a) private(this->a)
 // CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute parallel for default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) copyin(x)
+// CHECK-NEXT: #pragma omp teams distribute parallel for allocate(b) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) copyin(x) allocate(argv)
 
 template <class T, int N>
 T tmain(T argc) {

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -91,7 +92,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target
-#pragma omp teams distribute parallel for firstprivate (argc)
+#pragma omp teams distribute parallel for firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target
-#pragma omp teams distribute parallel for lastprivate(argc)
+#pragma omp teams distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target
-  #pragma omp teams distribute parallel for private (argc)
+  #pragma omp teams distribute parallel for private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -119,7 +120,7 @@ T tmain(T argc) {
 #pragma omp teams distribute parallel for 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 parallel for reduction(&& : argc)
+#pragma omp teams distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target
 #pragma omp teams distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -136,12 +136,12 @@ T tmain(T argc) {
 // CHECK-NEXT: for (int i = 0; i < 2; ++i)
 // CHECK-NEXT: a = 2;
 #pragma omp target
-#pragma omp teams distribute parallel for simd private(argc, b), firstprivate(c, d), collapse(2)
+#pragma omp teams distribute parallel for simd allocate(b) private(argc, b), firstprivate(c, d), collapse(2) allocate(d)
   for (int i = 0; i < 10; ++i)
     for (int j = 0; j < 10; ++j)
       foo();
 // CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute parallel for simd private(argc,b) firstprivate(c,d) collapse(2)
+// CHECK-NEXT: #pragma omp teams distribute parallel for simd allocate(b) private(argc,b) firstprivate(c,d) collapse(2) allocate(d)
 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
 // CHECK-NEXT: foo();

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -91,7 +92,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target
-#pragma omp teams distribute parallel for simd firstprivate (argc)
+#pragma omp teams distribute parallel for simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target
-#pragma omp teams distribute parallel for simd lastprivate(argc)
+#pragma omp teams distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -161,7 +162,7 @@ template<class I, class C> int foomain(I
 
 // expected-error at +2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
 #pragma omp target
-#pragma omp teams distribute parallel for simd linear (argc : 5)
+#pragma omp teams distribute parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target
-  #pragma omp teams distribute parallel for simd private (argc)
+  #pragma omp teams distribute parallel for simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -119,7 +120,7 @@ T tmain(T argc) {
 #pragma omp teams distribute parallel for 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 parallel for simd reduction(&& : argc)
+#pragma omp teams distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target
 #pragma omp teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/teams_distribute_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target
-  #pragma omp teams distribute private (argc)
+  #pragma omp teams distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -125,7 +126,7 @@ T tmain(T argc) {
 #pragma omp teams distribute 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 reduction(&& : argc)
+#pragma omp teams distribute reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int j=0; j<100; j++) foo();
 #pragma omp target
 #pragma omp teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_ast_print.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_ast_print.cpp Wed Mar 27 07:14:31 2019
@@ -130,12 +130,12 @@ T tmain(T argc) {
 // 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)
+#pragma omp teams distribute simd allocate(b) private(argc, b), firstprivate(c, d), collapse(2) allocate(c)
   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: #pragma omp teams distribute simd allocate(b) private(argc,b) firstprivate(c,d) collapse(2) allocate(c)
 // CHECK-NEXT: for (int i = 0; i < 10; ++i)
 // CHECK-NEXT: for (int j = 0; j < 10; ++j)
 // CHECK-NEXT: foo();

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -91,7 +92,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target
-#pragma omp teams distribute simd firstprivate (argc)
+#pragma omp teams distribute simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -95,7 +96,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target
-#pragma omp teams distribute simd lastprivate(argc)
+#pragma omp teams distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 namespace X {
   int x;
 };
@@ -161,7 +162,7 @@ template<class I, class C> int foomain(I
 
 // expected-error at +2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}}
 #pragma omp target
-#pragma omp teams distribute simd linear (argc : 5)
+#pragma omp teams distribute simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -77,7 +78,7 @@ int main(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target
-  #pragma omp teams distribute simd private (argc)
+  #pragma omp teams distribute simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target

Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -119,7 +120,7 @@ T tmain(T argc) {
 #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)
+#pragma omp teams distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   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}}

Modified: cfe/trunk/test/OpenMP/teams_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_firstprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_firstprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -85,7 +86,7 @@ int main(int argc, char **argv) {
 #pragma omp teams firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   foo();
 #pragma omp target
-#pragma omp teams firstprivate(argc)
+#pragma omp teams firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target
 #pragma omp teams firstprivate(S1) // expected-error {{'S1' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/teams_private_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_private_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_private_messages.cpp Wed Mar 27 07:14:31 2019
@@ -2,6 +2,7 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -89,7 +90,7 @@ int main(int argc, char **argv) {
   #pragma omp teams private (argv[1]) // expected-error {{expected variable name}}
   foo();
   #pragma omp target
-  #pragma omp teams private(ba)
+  #pragma omp teams private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
   #pragma omp target
   #pragma omp teams private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}

Modified: cfe/trunk/test/OpenMP/teams_reduction_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_reduction_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_reduction_messages.cpp Wed Mar 27 07:14:31 2019
@@ -6,6 +6,7 @@
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-target
 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-target
 
+extern int omp_default_mem_alloc;
 void foo() {
 }
 
@@ -125,7 +126,7 @@ T tmain(T argc) {
 #pragma omp teams 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'}}
   foo();
 #pragma omp target
-#pragma omp teams reduction(&& : argc)
+#pragma omp teams reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
   foo();
 #pragma omp target
 #pragma omp teams reduction(^ : T) // expected-error {{'T' does not refer to a value}}

Modified: cfe/trunk/test/OpenMP/threadprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/threadprivate_messages.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/threadprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/threadprivate_messages.cpp Wed Mar 27 07:14:31 2019
@@ -19,7 +19,7 @@ struct CompleteSt1{
 
 int a; // expected-note {{'a' defined here}}
 
-#pragma omp threadprivate(a)
+#pragma omp threadprivate(a) allocate(a) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
 #pragma omp threadprivate(u) // expected-error {{use of undeclared identifier 'u'}}
 #pragma omp threadprivate(d, a)
 int foo() { // expected-note {{declared here}}

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=357068&r1=357067&r2=357068&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Mar 27 07:14:31 2019
@@ -2263,6 +2263,10 @@ void OMPClauseEnqueue::VisitOMPClauseLis
   }
 }
 
+void OMPClauseEnqueue::VisitOMPAllocateClause(const OMPAllocateClause *C) {
+  VisitOMPClauseList(C);
+  Visitor->AddStmt(C->getAllocator());
+}
 void OMPClauseEnqueue::VisitOMPPrivateClause(const OMPPrivateClause *C) {
   VisitOMPClauseList(C);
   for (const auto *E : C->private_copies()) {




More information about the cfe-commits mailing list