diff options
Diffstat (limited to 'test/OpenMP/target_teams_distribute_reduction_messages.cpp')
-rw-r--r-- | test/OpenMP/target_teams_distribute_reduction_messages.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/OpenMP/target_teams_distribute_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_reduction_messages.cpp index 6a9e6782f6..bdde93bd93 100644 --- a/test/OpenMP/target_teams_distribute_reduction_messages.cpp +++ b/test/OpenMP/target_teams_distribute_reduction_messages.cpp @@ -6,6 +6,16 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +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() { } @@ -112,7 +122,7 @@ T tmain(T argc) { for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute reduction(&& : argc) +#pragma omp target teams distribute reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}} for (int j=0; j<100; j++) foo(); @@ -151,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(); |