From 471171c4c94ced4b0421049d6949c13bdce256f7 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 28 Mar 2019 19:15:36 +0000 Subject: [PATCH] [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. llvm-svn: 357205 --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 ++ clang/lib/Sema/SemaOpenMP.cpp | 33 ++++++++++++++++++++++ clang/test/OpenMP/target_firstprivate_messages.cpp | 13 +++++++-- .../target_parallel_firstprivate_messages.cpp | 13 +++++++-- .../target_parallel_for_firstprivate_messages.cpp | 13 +++++++-- .../target_parallel_for_lastprivate_messages.cpp | 13 +++++++-- .../OpenMP/target_parallel_for_linear_messages.cpp | 13 +++++++-- .../target_parallel_for_private_messages.cpp | 13 +++++++-- .../target_parallel_for_reduction_messages.cpp | 13 +++++++-- ...get_parallel_for_simd_firstprivate_messages.cpp | 13 +++++++-- ...rget_parallel_for_simd_lastprivate_messages.cpp | 13 +++++++-- .../target_parallel_for_simd_linear_messages.cpp | 13 +++++++-- .../target_parallel_for_simd_private_messages.cpp | 15 ++++++++-- ...target_parallel_for_simd_reduction_messages.cpp | 13 +++++++-- .../OpenMP/target_parallel_private_messages.cpp | 13 +++++++-- .../OpenMP/target_parallel_reduction_messages.cpp | 13 +++++++-- clang/test/OpenMP/target_private_messages.cpp | 15 ++++++++-- clang/test/OpenMP/target_reduction_messages.cpp | 13 +++++++-- .../OpenMP/target_simd_firstprivate_messages.cpp | 13 +++++++-- .../OpenMP/target_simd_lastprivate_messages.cpp | 13 +++++++-- clang/test/OpenMP/target_simd_linear_messages.cpp | 13 +++++++-- clang/test/OpenMP/target_simd_private_messages.cpp | 15 ++++++++-- .../test/OpenMP/target_simd_reduction_messages.cpp | 13 +++++++-- ...rget_teams_distribute_firstprivate_messages.cpp | 13 +++++++-- ...arget_teams_distribute_lastprivate_messages.cpp | 13 +++++++-- ...stribute_parallel_for_firstprivate_messages.cpp | 13 +++++++-- ...istribute_parallel_for_lastprivate_messages.cpp | 13 +++++++-- ...ms_distribute_parallel_for_private_messages.cpp | 13 +++++++-- ..._distribute_parallel_for_reduction_messages.cpp | 13 +++++++-- ...ute_parallel_for_simd_firstprivate_messages.cpp | 13 +++++++-- ...bute_parallel_for_simd_lastprivate_messages.cpp | 13 +++++++-- ...istribute_parallel_for_simd_linear_messages.cpp | 11 +++++++- ...stribute_parallel_for_simd_private_messages.cpp | 13 +++++++-- ...ribute_parallel_for_simd_reduction_messages.cpp | 13 +++++++-- .../target_teams_distribute_private_messages.cpp | 13 +++++++-- .../target_teams_distribute_reduction_messages.cpp | 13 +++++++-- ...teams_distribute_simd_firstprivate_messages.cpp | 13 +++++++-- ..._teams_distribute_simd_lastprivate_messages.cpp | 13 +++++++-- ...arget_teams_distribute_simd_linear_messages.cpp | 11 +++++++- ...rget_teams_distribute_simd_private_messages.cpp | 13 +++++++-- ...et_teams_distribute_simd_reduction_messages.cpp | 13 +++++++-- .../OpenMP/target_teams_firstprivate_messages.cpp | 13 +++++++-- .../test/OpenMP/target_teams_private_messages.cpp | 13 +++++++-- .../OpenMP/target_teams_reduction_messages.cpp | 13 +++++++-- clang/test/OpenMP/task_firstprivate_messages.cpp | 13 +++++++-- clang/test/OpenMP/task_in_reduction_message.cpp | 13 +++++++-- clang/test/OpenMP/task_private_messages.cpp | 13 +++++++-- .../test/OpenMP/taskloop_firstprivate_messages.cpp | 13 +++++++-- .../test/OpenMP/taskloop_in_reduction_messages.cpp | 13 +++++++-- .../test/OpenMP/taskloop_lastprivate_messages.cpp | 13 +++++++-- clang/test/OpenMP/taskloop_private_messages.cpp | 15 ++++++++-- clang/test/OpenMP/taskloop_reduction_messages.cpp | 13 +++++++-- .../OpenMP/taskloop_simd_firstprivate_messages.cpp | 13 +++++++-- .../OpenMP/taskloop_simd_in_reduction_messages.cpp | 13 +++++++-- .../OpenMP/taskloop_simd_lastprivate_messages.cpp | 13 +++++++-- .../test/OpenMP/taskloop_simd_linear_messages.cpp | 13 +++++++-- .../test/OpenMP/taskloop_simd_private_messages.cpp | 15 ++++++++-- .../OpenMP/taskloop_simd_reduction_messages.cpp | 13 +++++++-- 58 files changed, 655 insertions(+), 115 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index c19a88b..851cd0d 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index b4c8a64..0971277 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -3640,6 +3640,33 @@ static bool checkIfClauses(Sema &S, OpenMPDirectiveKind Kind, return ErrorFound; } +static bool checkAllocateClauses(Sema &S, DSAStackTy *Stack, + ArrayRef 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(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 Clauses, @@ -3973,6 +4000,12 @@ StmtResult Sema::ActOnOpenMPExecutableDirective( ErrorFound = checkIfClauses(*this, Kind, Clauses, AllowedNameModifiers) || ErrorFound; + // Check allocate clauses. + if (!CurContext->isDependentContext()) { + ErrorFound = checkAllocateClauses(*this, DSAStack, ClausesWithImplicit) || + ErrorFound; + } + if (ErrorFound) return StmtError(); diff --git a/clang/test/OpenMP/target_firstprivate_messages.cpp b/clang/test/OpenMP/target_firstprivate_messages.cpp index 2ab3a80..248751f 100644 --- a/clang/test/OpenMP/target_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_firstprivate_messages.cpp @@ -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}} {} diff --git a/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp b/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp index 3649039..d6c1bb2 100644 --- a/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp index 3a42517..286faec 100644 --- a/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp b/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp index ce5e1bf..d01e393 100644 --- a/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_linear_messages.cpp b/clang/test/OpenMP/target_parallel_for_linear_messages.cpp index c085303..3556faa 100644 --- a/clang/test/OpenMP/target_parallel_for_linear_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_linear_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_private_messages.cpp b/clang/test/OpenMP/target_parallel_for_private_messages.cpp index 4a6b2c2..2e3848a 100644 --- a/clang/test/OpenMP/target_parallel_for_private_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_private_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp b/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp index 8eeafd4..3b201f2 100644 --- a/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp @@ -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++; diff --git a/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp index aebc45a..77661a3 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp index 82271e1..750fa3b 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp index 30b0308..b5664dd 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp @@ -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@+1 {{expected variable name}} diff --git a/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp index 923f6378..6210323 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp @@ -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 s6(0.0) , s6_0(1.0); + S6 s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6::S6' requested here}} S7 > s7(0.0) , s7_0(1.0); int i; int &j = i; diff --git a/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp index 5d40388..87be4f1 100644 --- a/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp +++ b/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp @@ -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(); } diff --git a/clang/test/OpenMP/target_parallel_private_messages.cpp b/clang/test/OpenMP/target_parallel_private_messages.cpp index 52826a5..97ed1fc 100644 --- a/clang/test/OpenMP/target_parallel_private_messages.cpp +++ b/clang/test/OpenMP/target_parallel_private_messages.cpp @@ -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}} {} diff --git a/clang/test/OpenMP/target_parallel_reduction_messages.cpp b/clang/test/OpenMP/target_parallel_reduction_messages.cpp index 01a9d01..eca57a8 100644 --- a/clang/test/OpenMP/target_parallel_reduction_messages.cpp +++ b/clang/test/OpenMP/target_parallel_reduction_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/target_private_messages.cpp b/clang/test/OpenMP/target_private_messages.cpp index 4463dcf..245a0ea 100644 --- a/clang/test/OpenMP/target_private_messages.cpp +++ b/clang/test/OpenMP/target_private_messages.cpp @@ -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 s6(0.0) , s6_0(1.0); + S6 s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6::S6' requested here}} S7 > s7(0.0) , s7_0(1.0); int i; int &j = i; diff --git a/clang/test/OpenMP/target_reduction_messages.cpp b/clang/test/OpenMP/target_reduction_messages.cpp index b95be1f..b9b744f 100644 --- a/clang/test/OpenMP/target_reduction_messages.cpp +++ b/clang/test/OpenMP/target_reduction_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/target_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_simd_firstprivate_messages.cpp index 9063937..eac95ad 100644 --- a/clang/test/OpenMP/target_simd_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_simd_firstprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/target_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_simd_lastprivate_messages.cpp index d7ee2ca..8b48584 100644 --- a/clang/test/OpenMP/target_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_simd_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/target_simd_linear_messages.cpp b/clang/test/OpenMP/target_simd_linear_messages.cpp index 4b04497..86e3cc4 100644 --- a/clang/test/OpenMP/target_simd_linear_messages.cpp +++ b/clang/test/OpenMP/target_simd_linear_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_simd_private_messages.cpp b/clang/test/OpenMP/target_simd_private_messages.cpp index 65ac875..f95d77c 100644 --- a/clang/test/OpenMP/target_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_simd_private_messages.cpp @@ -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 s6(0.0) , s6_0(1.0); + S6 s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6::S6' requested here}} S7 > s7(0.0) , s7_0(1.0); int i; int &j = i; diff --git a/clang/test/OpenMP/target_simd_reduction_messages.cpp b/clang/test/OpenMP/target_simd_reduction_messages.cpp index e7a8737..e501594 100644 --- a/clang/test/OpenMP/target_simd_reduction_messages.cpp +++ b/clang/test/OpenMP/target_simd_reduction_messages.cpp @@ -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(); } diff --git a/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp index b32b8f3..833f951 100644 --- a/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp @@ -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 diff --git a/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp index 77f08f1..a7e33d0 100644 --- a/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp index 4cd7c45..d7be606 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp @@ -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'}} diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp index 661eaac..d06628f 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp index 3c7f164..86410b3 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp index 131ef84..01175de 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp index 3ef0389..46a91c9 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp @@ -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'}} diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp index efcd5a4..2652079 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp index 72d315a..029401a 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp @@ -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; }; diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp index 81ed3ad..1f3a131 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp index f7dd74c..6e298a7 100644 --- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp @@ -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 diff --git a/clang/test/OpenMP/target_teams_distribute_private_messages.cpp b/clang/test/OpenMP/target_teams_distribute_private_messages.cpp index 506bedd..93989a5 100644 --- a/clang/test/OpenMP/target_teams_distribute_private_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_private_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp b/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp index 6c245f1..bdde93b 100644 --- a/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp index 65c8542..1ce3adc 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp @@ -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'}} diff --git a/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp index bc5f3f8..1235f81 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp index a79fdca..f4131ed 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp @@ -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; }; diff --git a/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp index 63dad4e..7edcaf1 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp index 680794c..c033c05 100644 --- a/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp +++ b/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_teams_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_firstprivate_messages.cpp index 4a1ab3f..9f6eb8a 100644 --- a/clang/test/OpenMP/target_teams_firstprivate_messages.cpp +++ b/clang/test/OpenMP/target_teams_firstprivate_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_teams_private_messages.cpp b/clang/test/OpenMP/target_teams_private_messages.cpp index 9717d37..7714113 100644 --- a/clang/test/OpenMP/target_teams_private_messages.cpp +++ b/clang/test/OpenMP/target_teams_private_messages.cpp @@ -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(); diff --git a/clang/test/OpenMP/target_teams_reduction_messages.cpp b/clang/test/OpenMP/target_teams_reduction_messages.cpp index 6c714067..2d8a47b 100644 --- a/clang/test/OpenMP/target_teams_reduction_messages.cpp +++ b/clang/test/OpenMP/target_teams_reduction_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/task_firstprivate_messages.cpp b/clang/test/OpenMP/task_firstprivate_messages.cpp index fac5f52..b34cda7 100644 --- a/clang/test/OpenMP/task_firstprivate_messages.cpp +++ b/clang/test/OpenMP/task_firstprivate_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/task_in_reduction_message.cpp b/clang/test/OpenMP/task_in_reduction_message.cpp index 4120b73..d064a5f 100644 --- a/clang/test/OpenMP/task_in_reduction_message.cpp +++ b/clang/test/OpenMP/task_in_reduction_message.cpp @@ -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(); } diff --git a/clang/test/OpenMP/task_private_messages.cpp b/clang/test/OpenMP/task_private_messages.cpp index 9de0455..934f5aa 100644 --- a/clang/test/OpenMP/task_private_messages.cpp +++ b/clang/test/OpenMP/task_private_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/taskloop_firstprivate_messages.cpp b/clang/test/OpenMP/taskloop_firstprivate_messages.cpp index 81c4fff..fde767d 100644 --- a/clang/test/OpenMP/taskloop_firstprivate_messages.cpp +++ b/clang/test/OpenMP/taskloop_firstprivate_messages.cpp @@ -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 diff --git a/clang/test/OpenMP/taskloop_in_reduction_messages.cpp b/clang/test/OpenMP/taskloop_in_reduction_messages.cpp index bcfe86d..00c17d0 100644 --- a/clang/test/OpenMP/taskloop_in_reduction_messages.cpp +++ b/clang/test/OpenMP/taskloop_in_reduction_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/taskloop_lastprivate_messages.cpp b/clang/test/OpenMP/taskloop_lastprivate_messages.cpp index 5740aa5..929d2b8 100644 --- a/clang/test/OpenMP/taskloop_lastprivate_messages.cpp +++ b/clang/test/OpenMP/taskloop_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/taskloop_private_messages.cpp b/clang/test/OpenMP/taskloop_private_messages.cpp index cba929c..107a2f4 100644 --- a/clang/test/OpenMP/taskloop_private_messages.cpp +++ b/clang/test/OpenMP/taskloop_private_messages.cpp @@ -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 s6(0.0) , s6_0(1.0); + S6 s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6::S6' requested here}} S7 > s7(0.0) , s7_0(1.0); int i; int &j = i; diff --git a/clang/test/OpenMP/taskloop_reduction_messages.cpp b/clang/test/OpenMP/taskloop_reduction_messages.cpp index 9302438..a1c533c 100644 --- a/clang/test/OpenMP/taskloop_reduction_messages.cpp +++ b/clang/test/OpenMP/taskloop_reduction_messages.cpp @@ -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) diff --git a/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp b/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp index 662c4a5..7553bd2 100644 --- a/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp b/clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp index 8d62ec8..6ad8bad 100644 --- a/clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp @@ -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}} diff --git a/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp b/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp index 912e033..ec0d071 100644 --- a/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp @@ -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; diff --git a/clang/test/OpenMP/taskloop_simd_linear_messages.cpp b/clang/test/OpenMP/taskloop_simd_linear_messages.cpp index bf566e8..05b08d6 100644 --- a/clang/test/OpenMP/taskloop_simd_linear_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_linear_messages.cpp @@ -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 int foomain(I argc, C **argv) { { 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)) diff --git a/clang/test/OpenMP/taskloop_simd_private_messages.cpp b/clang/test/OpenMP/taskloop_simd_private_messages.cpp index 3e654d3..4198c89 100644 --- a/clang/test/OpenMP/taskloop_simd_private_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_private_messages.cpp @@ -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 s6(0.0) , s6_0(1.0); + S6 s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6::S6' requested here}} S7 > s7(0.0) , s7_0(1.0); int i; int &j = i; diff --git a/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp b/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp index 0257ccc..dc3a389 100644 --- a/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp +++ b/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp @@ -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) -- 2.7.4