r357205 - [OPENMP]Add check for undefined behavior with thread allocators on

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 12:15:36 PDT 2019


Author: abataev
Date: Thu Mar 28 12:15:36 2019
New Revision: 357205

URL: http://llvm.org/viewvc/llvm-project?rev=357205&view=rev
Log:
[OPENMP]Add check for undefined behavior with thread allocators on
target and task-based directives.

According to OpenMP 5.0, 2.11.4 allocate Clause, Restrictions, For task,
taskloop or target directives, allocation requests to memory allocators
with the trait access set to thread result in unspecified behavior.
Patch introduces a check for omp_thread_mem_alloc predefined allocator
on target- and trask-based directives.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Sema/SemaOpenMP.cpp
    cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.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_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_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_distribute_firstprivate_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.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_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_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/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/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_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

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Mar 28 12:15:36 2019
@@ -9158,6 +9158,9 @@ def note_omp_previous_allocator : Note<
 def err_expected_allocator_clause : Error<"expected an 'allocator' clause "
   "inside of the target region; provide an 'allocator' clause or use 'requires'"
   " directive with the 'dynamic_allocators' clause">;
+def warn_omp_allocate_thread_on_task_target_directive : Warning<
+  "allocator with the 'thread' trait access has unspecified behavior on '%0' directive">,
+  InGroup<OpenMPClauses>;
 } // end of OpenMP category
 
 let CategoryName = "Related Result Type Issue" in {

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Thu Mar 28 12:15:36 2019
@@ -3640,6 +3640,33 @@ static bool checkIfClauses(Sema &S, Open
   return ErrorFound;
 }
 
+static bool checkAllocateClauses(Sema &S, DSAStackTy *Stack,
+                                 ArrayRef<OMPClause *> Clauses) {
+  assert(!S.CurContext->isDependentContext() &&
+         "Expected non-dependent context.");
+  bool IsCorrect = true;
+  auto AllocateRange =
+      llvm::make_filter_range(Clauses, OMPAllocateClause::classof);
+  for (OMPClause *C : AllocateRange) {
+    auto *AC = cast<OMPAllocateClause>(C);
+    OMPAllocateDeclAttr::AllocatorTypeTy AllocatorKind =
+        getAllocatorKind(S, Stack, AC->getAllocator());
+    // OpenMP, 2.11.4 allocate Clause, Restrictions.
+    // For task, taskloop or target directives, allocation requests to memory
+    // allocators with the trait access set to thread result in unspecified
+    // behavior.
+    if (AllocatorKind == OMPAllocateDeclAttr::OMPThreadMemAlloc &&
+        (isOpenMPTaskingDirective(Stack->getCurrentDirective()) ||
+         isOpenMPTargetExecutionDirective(Stack->getCurrentDirective()))) {
+      S.Diag(AC->getAllocator()->getExprLoc(),
+             diag::warn_omp_allocate_thread_on_task_target_directive)
+          << getOpenMPDirectiveName(Stack->getCurrentDirective());
+      continue;
+    }
+  }
+  return !IsCorrect;
+}
+
 StmtResult Sema::ActOnOpenMPExecutableDirective(
     OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
     OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
@@ -3973,6 +4000,12 @@ StmtResult Sema::ActOnOpenMPExecutableDi
     ErrorFound = checkIfClauses(*this, Kind, Clauses, AllowedNameModifiers) ||
                  ErrorFound;
 
+  // Check allocate clauses.
+  if (!CurContext->isDependentContext()) {
+    ErrorFound = checkAllocateClauses(*this, DSAStack, ClausesWithImplicit) ||
+                 ErrorFound;
+  }
+
   if (ErrorFound)
     return StmtError();
 

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
 class S2 {
@@ -112,7 +121,7 @@ int foomain(I argc, C **argv) {
 {}
 #pragma omp target firstprivate(argv[1]) // expected-error {{expected variable name}}
 {}
-#pragma omp target firstprivate(e, g)
+#pragma omp target firstprivate(e, g) allocate(omp_thread_mem_alloc: e) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target' directive}}
 {}
 #pragma omp target firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
 {}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -86,7 +95,7 @@ int main(int argc, char **argv) {
   foo();
   #pragma omp target parallel firstprivate (argv[1]) // expected-error {{expected variable name}}
   foo();
-  #pragma omp target parallel firstprivate(ba)
+  #pragma omp target parallel firstprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel' directive}}
   foo();
   #pragma omp target parallel firstprivate(ca)
   foo();

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -172,7 +181,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for firstprivate(argc)
+#pragma omp target parallel for allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
   for (i = 0; i < argc; ++i)
     foo();
 #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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_lastprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -178,7 +187,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for lastprivate(2 * 2) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for lastprivate(ba)
+#pragma omp target parallel for lastprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
   for (i = 0; i < argc; ++i)
     foo();
 #pragma omp target parallel for lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
 int x;
 };
@@ -154,7 +163,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for linear(argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for linear(e, g)
+#pragma omp target parallel for allocate(omp_thread_mem_alloc: e) linear(e, g) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -129,7 +138,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target parallel for private(argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target parallel for private(e, g)
+#pragma omp target parallel for private(e, g) allocate(omp_thread_mem_alloc: e) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target parallel for private(h) // expected-error {{threadprivate or thread local variable cannot be private}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -316,7 +325,7 @@ int main(int argc, char **argv) {
   for (int i = 0; i < 10; ++i)
     foo();
   static int m;
-#pragma omp target parallel for reduction(+ : m) // OK
+#pragma omp target parallel for allocate(omp_thread_mem_alloc: m) reduction(+ : m) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
   for (int i = 0; i < 10; ++i)
     m++;
 

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -87,7 +96,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target 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 target parallel for simd firstprivate(argc)
+#pragma omp target parallel for simd firstprivate(argc) allocate(omp_thread_mem_alloc: argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -89,7 +98,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target 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 parallel for simd lastprivate(argc)
+#pragma omp target parallel for simd allocate(omp_thread_mem_alloc: argc) lastprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
 int x;
 };
@@ -43,7 +52,7 @@ void test_linear_colons() {
 #pragma omp target parallel for simd linear(B, ::z, X::x)
   for (int i = 0; i < 10; ++i)
     ;
-#pragma omp target parallel for simd linear(::z)
+#pragma omp target parallel for simd linear(::z) allocate(omp_thread_mem_alloc: ::z) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
   for (int i = 0; i < 10; ++i)
     ;
 // expected-error at +1 {{expected variable name}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -59,7 +68,7 @@ public:
 
   S6() : a(0) {}
   S6(T v) : a(v) {
-#pragma omp target parallel for simd private(a) private(this->a)
+#pragma omp target parallel for simd allocate(omp_thread_mem_alloc: a) private(a) private(this->a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }
@@ -167,7 +176,7 @@ using A::x;
 int main(int argc, char **argv) {
   S4 e(4);
   S5 g(5);
-  S6<float> s6(0.0) , s6_0(1.0);
+  S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
   S7<S6<float> > s7(0.0) , s7_0(1.0);
   int i;
   int &j = i;

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -15,7 +24,7 @@ bool foobool(int argc) {
 }
 
 void foobar(int &ref) {
-#pragma omp target parallel for simd reduction(+:ref)
+#pragma omp target parallel for simd reduction(+:ref) allocate(omp_thread_mem_alloc: ref) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 }

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -87,7 +96,7 @@ int foomain(I argc, C **argv) {
 {}
 #pragma omp target parallel private(argv[1]) // expected-error {{expected variable name}}
 {}
-#pragma omp target parallel private(ba)
+#pragma omp target parallel allocate(omp_thread_mem_alloc: ba) private(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel' directive}}
 {}
 #pragma omp target parallel private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}
 {}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -157,7 +166,7 @@ T tmain(T argc) {
 #pragma omp for private(fl)
   for (int i = 0; i < 10; ++i)
   {}
-#pragma omp target parallel reduction(+ : fl)
+#pragma omp target parallel reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel' directive}}
     foo();
 #pragma omp target parallel
 #pragma omp for reduction(- : fl)

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
 extern S1 a;
 class S2 {
@@ -52,7 +61,7 @@ public:
 
   S6() : a(0) {}
   S6(T v) : a(v) {
-#pragma omp target private(a) private(this->a)
+#pragma omp target private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target' directive}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }
@@ -148,7 +157,7 @@ using A::x;
 int main(int argc, char **argv) {
   S4 e(4);
   S5 g(5);
-  S6<float> s6(0.0) , s6_0(1.0);
+  S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
   S7<S6<float> > s7(0.0) , s7_0(1.0);
   int i;
   int &j = i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -155,7 +164,7 @@ T tmain(T argc) {
 #pragma omp parallel
 #pragma omp for private(fl)
   for (int i = 0; i < 10; ++i)
-#pragma omp target reduction(+ : fl)
+#pragma omp target reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target' directive}}
     foo();
 #pragma omp parallel
 #pragma omp for reduction(- : fl)

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -109,7 +118,7 @@ int foomain(int argc, char **argv) {
   {
     int v = 0;
     int i;
-#pragma omp target simd firstprivate(i)
+#pragma omp target simd allocate(omp_thread_mem_alloc: i) firstprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target simd' directive}}
     for (int k = 0; k < argc; ++k) {
       i = k;
       v += i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_lastprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -111,7 +120,7 @@ int foomain(int argc, char **argv) {
   {
     int v = 0;
     int i;
-#pragma omp target simd lastprivate(i)
+#pragma omp target simd lastprivate(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target simd' directive}}
     for (int k = 0; k < argc; ++k) {
       i = k;
       v += i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
 int x;
 };
@@ -154,7 +163,7 @@ int foomain(I argc, C **argv) {
 #pragma omp target simd linear(argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k)
     ++k;
-#pragma omp target simd linear(e, g)
+#pragma omp target simd allocate(omp_thread_mem_alloc: e) linear(e, g) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target simd' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp target simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -59,7 +68,7 @@ public:
 
   S6() : a(0) {}
   S6(T v) : a(v) {
-#pragma omp target simd private(a) private(this->a)
+#pragma omp target simd private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target simd' directive}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }
@@ -167,7 +176,7 @@ using A::x;
 int main(int argc, char **argv) {
   S4 e(4);
   S5 g(5);
-  S6<float> s6(0.0) , s6_0(1.0);
+  S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
   S7<S6<float> > s7(0.0) , s7_0(1.0);
   int i;
   int &j = i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -15,7 +24,7 @@ bool foobool(int argc) {
 }
 
 void foobar(int &ref) {
-#pragma omp target simd reduction(+:ref)
+#pragma omp target simd allocate(omp_thread_mem_alloc: ref) reduction(+:ref) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target simd' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 }

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -97,7 +106,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute firstprivate (argv[1]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute firstprivate(ba)
+#pragma omp target teams distribute firstprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute' directive}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -89,7 +98,7 @@ int foomain(int argc, char **argv) {
 #pragma omp target teams distribute 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 lastprivate(argc)
+#pragma omp target teams distribute allocate(omp_thread_mem_alloc: argc) lastprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute' directive}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #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_firstprivate_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp?rev=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -97,7 +106,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for firstprivate (argv[1]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute parallel for firstprivate(ba)
+#pragma omp target teams distribute parallel for firstprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for' directive}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute parallel for firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -108,7 +117,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   int v = 0;
-#pragma omp target teams distribute parallel for lastprivate(i)
+#pragma omp target teams distribute parallel for allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for' directive}}
   for (int k = 0; k < argc; ++k) {
     i = k;
     v += i;

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -107,7 +116,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for firstprivate(i), private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute parallel for private(j)
+#pragma omp target teams distribute parallel for allocate(omp_thread_mem_alloc: j) private(j) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for' directive}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute parallel for reduction(+:i)

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -147,7 +156,7 @@ T tmain(T argc) {
 #pragma omp parallel reduction(min : i)
 #pragma omp target teams distribute parallel for reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
   for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for reduction(+ : fl)
+#pragma omp target teams distribute parallel for reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for' directive}}
     for (int j=0; j<100; j++) foo();
 
   return T();

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -97,7 +106,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for simd firstprivate (argv[1]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute parallel for simd firstprivate(ba)
+#pragma omp target teams distribute parallel for simd allocate(omp_thread_mem_alloc: ba) firstprivate(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for simd' directive}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute parallel for simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -108,7 +117,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   int v = 0;
-#pragma omp target teams distribute parallel for simd lastprivate(i)
+#pragma omp target teams distribute parallel for simd lastprivate(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for simd' directive}}
   for (int k = 0; k < argc; ++k) {
     i = k;
     v += i;

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
   int x;
 };

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -83,7 +92,7 @@ int main(int argc, char **argv) {
   #pragma omp target teams distribute parallel for simd private (argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-  #pragma omp target teams distribute parallel for simd private(ba)
+  #pragma omp target teams distribute parallel for simd private(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for simd' directive}}
   for (int k = 0; k < argc; ++k) ++k;
 
   #pragma omp target teams distribute parallel for simd private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -236,7 +245,7 @@ int main(int argc, char **argv) {
 #pragma omp parallel reduction(min : i)
 #pragma omp target teams distribute parallel for simd reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
   for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for simd reduction(+ : fl)
+#pragma omp target teams distribute parallel for simd allocate(omp_thread_mem_alloc: fl) reduction(+ : fl) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for simd' directive}}
     for (int j=0; j<100; j++) foo();
   static int m;
 #pragma omp target teams distribute parallel for simd reduction(+ : m) // OK

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -83,7 +92,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute private (argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute private(ba)
+#pragma omp target teams distribute private(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute' directive}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -152,7 +161,7 @@ T tmain(T argc) {
 #pragma omp parallel reduction(min : i)
 #pragma omp target teams distribute reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
   for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute reduction(+ : fl)
+#pragma omp target teams distribute allocate(omp_thread_mem_alloc: fl) reduction(+ : fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute' directive}}
     for (int j=0; j<100; j++) foo();
 
   return T();

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -97,7 +106,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute simd firstprivate (argv[1]) // expected-error {{expected variable name}}
   for (i = 0; i < argc; ++i) foo();
 
-#pragma omp target teams distribute simd firstprivate(ba)
+#pragma omp target teams distribute simd firstprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute simd' directive}}
   for (i = 0; i < argc; ++i) foo();
 
 #pragma omp target teams distribute simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -108,7 +117,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k) ++k;
 
   int v = 0;
-#pragma omp target teams distribute simd lastprivate(i)
+#pragma omp target teams distribute simd allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute simd' directive}}
   for (int k = 0; k < argc; ++k) {
     i = k;
     v += i;

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
   int x;
 };

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -83,7 +92,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute simd private (argv[1]) // expected-error {{expected variable name}}
   for (int k = 0; k < argc; ++k) ++k;
 
-#pragma omp target teams distribute simd private(ba)
+#pragma omp target teams distribute simd private(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute simd' directive}}
   for (int k = 0; k < argc; ++k) ++k;
 
 #pragma omp target teams distribute simd private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}

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=357205&r1=357204&r2=357205&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 Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -147,7 +156,7 @@ T tmain(T argc) {
 #pragma omp parallel reduction(min : i)
 #pragma omp target teams distribute simd reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
   for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd reduction(+ : fl)
+#pragma omp target teams distribute simd reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute simd' directive}}
     for (int j=0; j<100; j++) foo();
 
   return T();

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -87,7 +96,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp target teams firstprivate(argv[1]) // expected-error {{expected variable name}}
   foo();
-#pragma omp target teams firstprivate(ba)
+#pragma omp target teams allocate(omp_thread_mem_alloc: ba) firstprivate(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams' directive}}
   foo();
 #pragma omp target teams firstprivate(ca)
   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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -99,7 +108,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp target teams private(j)
   foo();
-#pragma omp target teams firstprivate(i)
+#pragma omp target teams firstprivate(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams' directive}}
   for (int k = 0; k < 10; ++k) {
 #pragma omp parallel private(i)
     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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -156,7 +165,7 @@ T tmain(T argc) {
 #pragma omp parallel for private(fl)
   for (int i = 0; i < 10; ++i)
   {}
-#pragma omp target teams reduction(+ : fl)
+#pragma omp target teams reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'target teams' directive}}
     foo();
 #pragma omp target teams
 #pragma omp parallel for reduction(- : fl)

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/task_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -96,7 +105,7 @@ int main(int argc, char **argv) {
 #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}}
-#pragma omp task firstprivate(ba)
+#pragma omp task allocate(omp_thread_mem_alloc: ba) firstprivate(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'task' directive}}
 #pragma omp task firstprivate(ca)
 #pragma omp task firstprivate(da)
 #pragma omp task firstprivate(S2::S2s)

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_in_reduction_message.cpp (original)
+++ cfe/trunk/test/OpenMP/task_in_reduction_message.cpp Thu Mar 28 12:15:36 2019
@@ -7,7 +7,16 @@
 // 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;
+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() {
 }
 
@@ -17,7 +26,7 @@ bool foobool(int argc) {
 
 void foobar(int &ref) {
 #pragma omp taskgroup task_reduction(+:ref)
-#pragma omp task in_reduction(+:ref)
+#pragma omp task in_reduction(+:ref) allocate(omp_thread_mem_alloc: ref) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'task' directive}}
   foo();
 }
 

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/task_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/task_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -93,7 +102,7 @@ int main(int argc, char **argv) {
   foo();
 #pragma omp task firstprivate(i)
   for (int k = 0; k < 10; ++k) {
-#pragma omp task private(i)
+#pragma omp task private(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'task' directive}}
     foo();
   }
   static int m;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -94,7 +103,7 @@ int foomain(int argc, char **argv) {
   for (int k = 0; k < argc; ++k)
     ++k;
 #pragma omp parallel
-#pragma omp taskloop firstprivate(argc)
+#pragma omp taskloop allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
   for (int k = 0; k < argc; ++k)
     ++k;
 #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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_in_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -224,7 +233,7 @@ T tmain(T argc) {
   foo();
 #pragma omp taskgroup task_reduction(+:fl)
 {
-#pragma omp taskloop in_reduction(+ : fl)
+#pragma omp taskloop in_reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp taskgroup task_reduction(*:fl) // expected-note 2 {{previously marked as task_reduction with different reduction operation}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_lastprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -123,7 +132,7 @@ int foomain(int argc, char **argv) {
   {
     int v = 0;
     int i;
-#pragma omp taskloop lastprivate(i)
+#pragma omp taskloop allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
     for (int k = 0; k < argc; ++k) {
       i = k;
       v += i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -59,7 +68,7 @@ public:
 
   S6() : a(0) {}
   S6(T v) : a(v) {
-#pragma omp taskloop private(a) private(this->a)
+#pragma omp taskloop private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }
@@ -177,7 +186,7 @@ using A::x;
 int main(int argc, char **argv) {
   S4 e(4);
   S5 g(5);
-  S6<float> s6(0.0) , s6_0(1.0);
+  S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
   S7<S6<float> > s7(0.0) , s7_0(1.0);
   int i;
   int &j = i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -192,7 +201,7 @@ T tmain(T argc) {
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel private(fl)
-#pragma omp taskloop reduction(+ : fl)
+#pragma omp taskloop reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel reduction(* : fl)

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_firstprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -121,7 +130,7 @@ int foomain(int argc, char **argv) {
   {
     int v = 0;
     int i;
-#pragma omp taskloop simd firstprivate(i)
+#pragma omp taskloop simd allocate(omp_thread_mem_alloc: i) firstprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
     for (int k = 0; k < argc; ++k) {
       i = k;
       v += i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_in_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -224,7 +233,7 @@ T tmain(T argc) {
   foo();
 #pragma omp taskgroup task_reduction(+:fl)
 {
-#pragma omp taskloop simd in_reduction(+ : fl)
+#pragma omp taskloop simd allocate(omp_thread_mem_alloc: fl) in_reduction(+ : fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp taskgroup task_reduction(*:fl) // expected-note 2 {{previously marked as task_reduction with different reduction operation}}

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_lastprivate_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -123,7 +132,7 @@ int foomain(int argc, char **argv) {
   {
     int v = 0;
     int i;
-#pragma omp taskloop simd lastprivate(i)
+#pragma omp taskloop simd lastprivate(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
     for (int k = 0; k < argc; ++k) {
       i = k;
       v += i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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;
+
 namespace X {
   int x;
 };
@@ -148,7 +157,7 @@ template<class I, class C> int foomain(I
   {
     int v = 0;
     int i;
-    #pragma omp taskloop simd linear(v:i)
+    #pragma omp taskloop simd allocate(omp_thread_mem_alloc: v) linear(v:i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
     for (int k = 0; k < argc; ++k) { i = k; v += i; }
   }
   #pragma omp taskloop simd linear(ref(j))

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_private_messages.cpp Thu Mar 28 12:15:36 2019
@@ -2,7 +2,16 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd %s
 
-extern int omp_default_mem_alloc;
+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() {
 }
 
@@ -59,7 +68,7 @@ public:
 
   S6() : a(0) {}
   S6(T v) : a(v) {
-#pragma omp taskloop simd private(a) private(this->a)
+#pragma omp taskloop simd allocate(omp_thread_mem_alloc: a) private(a) private(this->a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
     for (int k = 0; k < v; ++k)
       ++this->a;
   }
@@ -177,7 +186,7 @@ using A::x;
 int main(int argc, char **argv) {
   S4 e(4);
   S5 g(5);
-  S6<float> s6(0.0) , s6_0(1.0);
+  S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
   S7<S6<float> > s7(0.0) , s7_0(1.0);
   int i;
   int &j = i;

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=357205&r1=357204&r2=357205&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_reduction_messages.cpp Thu Mar 28 12:15:36 2019
@@ -6,7 +6,16 @@
 // 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;
+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() {
 }
 
@@ -192,7 +201,7 @@ T tmain(T argc) {
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel private(fl)
-#pragma omp taskloop simd reduction(+ : fl)
+#pragma omp taskloop simd reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop simd' directive}}
   for (int i = 0; i < 10; ++i)
     foo();
 #pragma omp parallel reduction(* : fl)




More information about the cfe-commits mailing list