From 64cdc6a98b87b75a9e7b88a45870ee88c4169ee1 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 19 Jan 2019 05:36:54 +0000 Subject: Emit !callback metadata and introduce the callback attribute With commit r351627, LLVM gained the ability to apply (existing) IPO optimizations on indirections through callbacks, or transitive calls. The general idea is that we use an abstraction to hide the middle man and represent the callback call in the context of the initial caller. It is described in more detail in the commit message of the LLVM patch r351627, the llvm::AbstractCallSite class description, and the language reference section on callback-metadata. This commit enables clang to emit !callback metadata that is understood by LLVM. It does so in three different cases: 1) For known broker functions declarations that are directly generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel. 2) For known broker functions that are identified by their name and source location through the builtin detection, e.g., pthread_create from the POSIX thread API. 3) For user annotated functions that carry the "callback(callee, ...)" attribute. The attribute has to include the name, or index, of the callback callee and how the passed arguments can be identified (as many as the callback callee has). See the callback attribute documentation for detailed information. Differential Revision: https://reviews.llvm.org/D55483 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351629 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/parallel_codegen.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/parallel_codegen.cpp b/test/OpenMP/parallel_codegen.cpp index 19eebc8289..ae117a0aad 100644 --- a/test/OpenMP/parallel_codegen.cpp +++ b/test/OpenMP/parallel_codegen.cpp @@ -82,9 +82,9 @@ int main (int argc, char **argv) { // CHECK-DEBUG-NEXT: } // CHECK-DAG: define linkonce_odr {{.*}}void [[FOO]]({{i32[ ]?[a-z]*}} %argc) -// CHECK-DAG: declare {{.*}}void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) +// CHECK-DAG: declare !callback ![[cbid:[0-9]+]] {{.*}}void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) // CHECK-DEBUG-DAG: define linkonce_odr void [[FOO]](i32 %argc) -// CHECK-DEBUG-DAG: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) +// CHECK-DEBUG-DAG: declare !callback ![[cbid:[0-9]+]] void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) // CHECK-DEBUG-DAG: define internal void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]]) // CHECK-DEBUG-DAG: call void [[OMP_OUTLINED_DEBUG]] @@ -131,5 +131,6 @@ int main (int argc, char **argv) { // CHECK: attributes #[[FN_ATTRS]] = {{.+}} nounwind // CHECK-DEBUG: attributes #[[FN_ATTRS]] = {{.+}} nounwind - +// CHECK: ![[cbid]] = !{![[cbidb:[0-9]+]]} +// CHECK: ![[cbidb]] = !{i64 2, i64 -1, i64 -1, i1 true} #endif -- cgit v1.2.3 From 00c3372fa3b073da0902153b72024df9075217c2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 28 Jan 2019 20:03:02 +0000 Subject: [OPENMP][NVPTX]Emit service debug variable for NVPTX. In case of the empty module, the ptxas tool may emit error message about empty debug info sections. This patch fixes this bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352421 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_firstprivate_codegen.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp index 53b0f75885..8ffc08294a 100644 --- a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp +++ b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp @@ -16,6 +16,7 @@ struct TT { // TCHECK: [[TT:%.+]] = type { i64, i8 } // TCHECK: [[S1:%.+]] = type { double } +// TCHECK: @{{.*}}_$_{{.*}} = common global i32 0, !dbg !{{[0-9]+}} int foo(int n, double *ptr) { int a = 0; short aa = 0; -- cgit v1.2.3 From bacf8f5143b14a2a24213c888508a84a7755341e Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 29 Jan 2019 18:51:58 +0000 Subject: [OPENMP]Make the loop with unsigned counter countable. According to the report, better to keep the original strict compare operation as the loop condition with unsigned loop counters to make the loop countable. This allows further loop transformations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352526 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_codegen.cpp | 6 ++++-- test/OpenMP/ordered_codegen.cpp | 3 ++- test/OpenMP/parallel_for_codegen.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_codegen.cpp b/test/OpenMP/for_codegen.cpp index 2e44478b63..47c5be9bec 100644 --- a/test/OpenMP/for_codegen.cpp +++ b/test/OpenMP/for_codegen.cpp @@ -203,7 +203,8 @@ void dynamic1(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] @@ -244,7 +245,8 @@ void guided7(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] diff --git a/test/OpenMP/ordered_codegen.cpp b/test/OpenMP/ordered_codegen.cpp index ef7d39dfd0..70da820c1f 100644 --- a/test/OpenMP/ordered_codegen.cpp +++ b/test/OpenMP/ordered_codegen.cpp @@ -78,7 +78,8 @@ void dynamic1(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] diff --git a/test/OpenMP/parallel_for_codegen.cpp b/test/OpenMP/parallel_for_codegen.cpp index a3d307afac..fe1eb1ef11 100644 --- a/test/OpenMP/parallel_for_codegen.cpp +++ b/test/OpenMP/parallel_for_codegen.cpp @@ -197,7 +197,8 @@ void dynamic1(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] @@ -239,7 +240,8 @@ void guided7(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] -- cgit v1.2.3 From 830774927c8f5ad05bf8c3d9d58b0ebb3f3c14ba Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 29 Jan 2019 21:12:28 +0000 Subject: [OPENMP]Fix PR40513: lastprivate taskloop counter. We don't need to use the predetermined data-sharing attributes for the loop counters if the user explicitly specified correct data-sharing attributes for such variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352543 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/taskloop_lastprivate_codegen.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/taskloop_lastprivate_codegen.cpp b/test/OpenMP/taskloop_lastprivate_codegen.cpp index fa1549d7fc..000ca8f02f 100644 --- a/test/OpenMP/taskloop_lastprivate_codegen.cpp +++ b/test/OpenMP/taskloop_lastprivate_codegen.cpp @@ -4,6 +4,7 @@ // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s // RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s // RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s +// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LOOP %s // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s @@ -11,11 +12,12 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s // RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=SIMD-ONLY0 %s // SIMD-ONLY0-NOT: {{__kmpc|__tgt}} // expected-no-diagnostics // It doesn't pass on win32. // REQUIRES: shell -#ifndef ARRAY +#if !defined(ARRAY) && !defined(LOOP) #ifndef HEADER #define HEADER @@ -501,7 +503,7 @@ int main() { // CHECK: ret i32 #endif -#else +#elif defined(ARRAY) // ARRAY-LABEL: array_func struct St { int a, b; @@ -522,5 +524,16 @@ void array_func(int n, float a[n], St s[2]) { for (int i = 0; i < 10; ++i) ; } +#else + +// LOOP-LABEL: loop +void loop() { +// LOOP: call i8* @__kmpc_omp_task_alloc( +// LOOP: call void @__kmpc_taskloop( + int i; +#pragma omp taskloop lastprivate(i) + for (i = 0; i < 10; ++i) + ; +} #endif -- cgit v1.2.3 From 93270fb6cbf0e1d92a6fdea5b032e6950380d8b6 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 30 Jan 2019 20:49:52 +0000 Subject: [OPENMP]Fix PR40536: Do not emit __kmpc_push_target_tripcount if not required. Function __kmpc_push_target_tripcount should be emitted only if the offloading entry is going to be emitted (for use in tgt_target... functions). Otherwise, it should not be emitted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352669 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp | 3 +++ test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp | 2 +- test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp index e439431a05..4c7ac2441c 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp @@ -2,6 +2,7 @@ #ifndef HEADER #define HEADER // Test host codegen. +// RUN: %clang_cc1 -DCK1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix HCK_NO_TGT // RUN: %clang_cc1 -DCK1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK1 --check-prefix CK1-64 --check-prefix HCK1 --check-prefix HCK1-64 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK1 --check-prefix CK1-64 --check-prefix HCK1 --check-prefix HCK1-64 @@ -38,6 +39,8 @@ #ifdef CK1 +// HCK_NO_TGT-NOT: @__kmpc_push_target_tripcount + // HCK1: define{{.*}} i32 @{{.+}}target_teams_fun{{.*}}( int target_teams_fun(int *g){ int n = 1000; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp index af6ed9744a..8f1e88f980 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp @@ -83,7 +83,7 @@ int main() { // CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call i{{[0-9]+}} @__tgt_target_teams( // CHECK: call void [[OFFLOADING_FUN_0:@.+]]( -// CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) +// CHECK-NOT: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call void [[OFFLOADING_FUN_1:@.+]]( // CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call i{{[0-9]+}} @__tgt_target_teams( diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp index b6778417be..79ae4fe29a 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp @@ -83,7 +83,7 @@ int main() { // CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call i{{[0-9]+}} @__tgt_target_teams( // CHECK: call void [[OFFLOADING_FUN_0:@.+]]( -// CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) +// CHECK-NOT: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call void [[OFFLOADING_FUN_1:@.+]]( // CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100) // CHECK: call i{{[0-9]+}} @__tgt_target_teams( -- cgit v1.2.3 From e93ddfad28fbdc140c8b92f273c602876342d030 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 1 Feb 2019 20:25:04 +0000 Subject: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. This patch implements parsing and sema for "omp declare mapper" directive. User defined mapper, i.e., declare mapper directive, is a new feature in OpenMP 5.0. It is introduced to extend existing map clauses for the purpose of simplifying the copy of complex data structures between host and device (i.e., deep copy). An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(struct S s) map(s, s.d[0:s.len]) // Memory region that d points to is also mapped using this mapper. Contributed-by: Lingda Li Differential Revision: https://reviews.llvm.org/D56326 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352906 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_mapper_ast_print.c | 48 ++++++++++++++++ test/OpenMP/declare_mapper_ast_print.cpp | 97 ++++++++++++++++++++++++++++++++ test/OpenMP/declare_mapper_messages.c | 41 ++++++++++++++ test/OpenMP/declare_mapper_messages.cpp | 70 +++++++++++++++++++++++ 4 files changed, 256 insertions(+) create mode 100644 test/OpenMP/declare_mapper_ast_print.c create mode 100644 test/OpenMP/declare_mapper_ast_print.cpp create mode 100644 test/OpenMP/declare_mapper_messages.c create mode 100644 test/OpenMP/declare_mapper_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_mapper_ast_print.c b/test/OpenMP/declare_mapper_ast_print.c new file mode 100644 index 0000000000..a2c78a1c16 --- /dev/null +++ b/test/OpenMP/declare_mapper_ast_print.c @@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +// CHECK: struct vec { +struct vec { + int len; + double *data; +}; +// CHECK: }; + +// CHECK: struct dat { +struct dat { + int i; + double d; +#pragma omp declare mapper(id: struct vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len){{$}} +}; +// CHECK: }; + +#pragma omp declare mapper(id: struct vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len){{$}} +#pragma omp declare mapper(default : struct vec kk) map(kk.len) map(kk.data[0:2]) +// CHECK: #pragma omp declare mapper (default : struct vec kk) map(tofrom: kk.len) map(tofrom: kk.data[0:2]){{$}} +#pragma omp declare mapper(struct dat d) map(to: d.d) +// CHECK: #pragma omp declare mapper (default : struct dat d) map(to: d.d){{$}} + +// CHECK: int main() { +int main() { +#pragma omp declare mapper(id: struct vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len) + { +#pragma omp declare mapper(id: struct vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len) + } + return 0; +} +// CHECK: } + +#endif diff --git a/test/OpenMP/declare_mapper_ast_print.cpp b/test/OpenMP/declare_mapper_ast_print.cpp new file mode 100644 index 0000000000..dab7455697 --- /dev/null +++ b/test/OpenMP/declare_mapper_ast_print.cpp @@ -0,0 +1,97 @@ +// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +// CHECK: namespace N1 { +namespace N1 +{ +// CHECK: class vec { +class vec { +public: + int len; + double *data; +}; +// CHECK: }; + +#pragma omp declare mapper(id: vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}} +}; +// CHECK: } +// CHECK: ; + +template +class dat { +public: + class datin { + public: + T in; + }; + int i; + T d; +#pragma omp declare mapper(id: N1::vec v) map(v.len) +#pragma omp declare mapper(id: datin v) map(v.in) +}; + +// CHECK: template class dat { +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}} +// CHECK: #pragma omp declare mapper (id : dat::datin v) map(tofrom: v.in){{$}} +// CHECK: }; +// CHECK: template<> class dat { +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}} +// CHECK: #pragma omp declare mapper (id : dat::datin v) map(tofrom: v.in){{$}} +// CHECK: }; + +#pragma omp declare mapper(default : N1::vec kk) map(kk.len) map(kk.data[0:2]) +// CHECK: #pragma omp declare mapper (default : N1::vec kk) map(tofrom: kk.len) map(tofrom: kk.data[0:2]){{$}} +#pragma omp declare mapper(dat d) map(to: d.d) +// CHECK: #pragma omp declare mapper (default : dat d) map(to: d.d){{$}} + +template +T foo(T a) { + struct foodat { + T a; + }; +#pragma omp declare mapper(struct foodat v) map(v.a) +#pragma omp declare mapper(id: N1::vec v) map(v.len) + { +#pragma omp declare mapper(id: N1::vec v) map(v.len) + } + return 0; +} + +// CHECK: template T foo(T a) { +// CHECK: #pragma omp declare mapper (default : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) +// CHECK: { +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) +// CHECK: } +// CHECK: } +// CHECK: template<> int foo(int a) { +// CHECK: #pragma omp declare mapper (default : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) +// CHECK: { +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) +// CHECK: } +// CHECK: } + +// CHECK: int main() { +int main() { +#pragma omp declare mapper(id: N1::vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) + { +#pragma omp declare mapper(id: N1::vec v) map(v.len) +// CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) + } + return foo(0); +} +// CHECK: } + +#endif diff --git a/test/OpenMP/declare_mapper_messages.c b/test/OpenMP/declare_mapper_messages.c new file mode 100644 index 0000000000..c8e65b2a36 --- /dev/null +++ b/test/OpenMP/declare_mapper_messages.c @@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s + +int temp; // expected-note {{'temp' declared here}} + +struct vec { // expected-note {{definition of 'struct vec' is not complete until the closing '}'}} + int len; +#pragma omp declare mapper(id: struct vec v) map(v.len) // expected-error {{incomplete definition of type 'struct vec'}} + double *data; +}; + +#pragma omp declare mapper // expected-error {{expected '(' after 'declare mapper'}} +#pragma omp declare mapper { // expected-error {{expected '(' after 'declare mapper'}} +#pragma omp declare mapper( // expected-error {{expected a type}} expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(# // expected-error {{expected a type}} expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(struct v // expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(struct vec // expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(S v // expected-error {{unknown type name 'S'}} +#pragma omp declare mapper(struct vec v // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp declare mapper(aa:struct vec v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} +#pragma omp declare mapper(bb:struct vec v) private(v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} // expected-error {{unexpected OpenMP clause 'private' in directive '#pragma omp declare mapper'}} +#pragma omp declare mapper(cc:struct vec v) map(v) ( // expected-warning {{extra tokens at the end of '#pragma omp declare mapper' are ignored}} + +#pragma omp declare mapper(++: struct vec v) map(v.len) // expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp declare mapper(id1: struct vec v) map(v.len, temp) // expected-error {{only variable v is allowed in map clauses of this 'omp declare mapper' directive}} +#pragma omp declare mapper(default : struct vec kk) map(kk.data[0:2]) // expected-note {{previous definition is here}} +#pragma omp declare mapper(struct vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'default'}} +#pragma omp declare mapper(int v) map(v) // expected-error {{mapper type must be of struct, union or class type}} + +int fun(int arg) { +#pragma omp declare mapper(id: struct vec v) map(v.len) + { +#pragma omp declare mapper(id: struct vec v) map(v.len) // expected-note {{previous definition is here}} +#pragma omp declare mapper(id: struct vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'id'}} + { +#pragma omp declare mapper(id: struct vec v) map(v.len) + } + } + return arg; +} diff --git a/test/OpenMP/declare_mapper_messages.cpp b/test/OpenMP/declare_mapper_messages.cpp new file mode 100644 index 0000000000..29c76ad79f --- /dev/null +++ b/test/OpenMP/declare_mapper_messages.cpp @@ -0,0 +1,70 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 %s + +int temp; // expected-note {{'temp' declared here}} + +class vec { // expected-note {{definition of 'vec' is not complete until the closing '}'}} +private: + int p; // expected-note {{declared private here}} +public: + int len; +#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{member access into incomplete type 'vec'}} + double *data; +}; + +#pragma omp declare mapper // expected-error {{expected '(' after 'declare mapper'}} +#pragma omp declare mapper { // expected-error {{expected '(' after 'declare mapper'}} +#pragma omp declare mapper( // expected-error {{expected a type}} expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(# // expected-error {{expected a type}} expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(v // expected-error {{unknown type name 'v'}} expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(vec // expected-error {{expected declarator on 'omp declare mapper' directive}} +#pragma omp declare mapper(S v // expected-error {{unknown type name 'S'}} +#pragma omp declare mapper(vec v // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp declare mapper(aa: vec v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} +#pragma omp declare mapper(bb: vec v) private(v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} // expected-error {{unexpected OpenMP clause 'private' in directive '#pragma omp declare mapper'}} +#pragma omp declare mapper(cc: vec v) map(v) ( // expected-warning {{extra tokens at the end of '#pragma omp declare mapper' are ignored}} + +#pragma omp declare mapper(++: vec v) map(v.len) // expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp declare mapper(id1: vec v) map(v.len, temp) // expected-error {{only variable v is allowed in map clauses of this 'omp declare mapper' directive}} +#pragma omp declare mapper(default : vec kk) map(kk.data[0:2]) // expected-note {{previous definition is here}} +#pragma omp declare mapper(vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'default'}} +#pragma omp declare mapper(int v) map(v) // expected-error {{mapper type must be of struct, union or class type}} +#pragma omp declare mapper(id2: vec v) map(v.len, v.p) // expected-error {{'p' is a private member of 'vec'}} + +namespace N1 { +template +class stack { // expected-note {{template is declared here}} +public: + int len; + T *data; +#pragma omp declare mapper(id: vec v) map(v.len) // expected-note {{previous definition is here}} +#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} +}; +}; + +#pragma omp declare mapper(default : N1::stack s) map(s.len) // expected-error {{use of class template 'N1::stack' requires template arguments}} +#pragma omp declare mapper(id1: N1::stack s) map(s.data) +#pragma omp declare mapper(default : S s) map(s.len) // expected-error {{no template named 'S'}} + +template +T foo(T a) { +#pragma omp declare mapper(id: vec v) map(v.len) // expected-note {{previous definition is here}} +#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} +} + +int fun(int arg) { +#pragma omp declare mapper(id: vec v) map(v.len) + { +#pragma omp declare mapper(id: vec v) map(v.len) // expected-note {{previous definition is here}} + { +#pragma omp declare mapper(id: vec v) map(v.len) + } +#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} + } + return arg; +} -- cgit v1.2.3 From 56c55d5f16e3fdf8da45871ddc94a1ae19af290a Mon Sep 17 00:00:00 2001 From: Sergi Mateo Bellido Date: Mon, 4 Feb 2019 07:33:19 +0000 Subject: [OpenMP] Adding support to the mutexinoutset dep-type Summary: this commit adds support to a new dependence type introduced in OpenMP 5.0. The LLVM OpenMP RTL already supports this feature, so we only need to modify CLANG to take advantage of them. Differential Revision: https://reviews.llvm.org/D57576 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353018 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_depend_messages.cpp | 8 ++--- test/OpenMP/target_enter_data_depend_messages.cpp | 16 ++++----- test/OpenMP/target_exit_data_depend_messages.cpp | 16 ++++----- test/OpenMP/target_parallel_depend_messages.cpp | 8 ++--- .../OpenMP/target_parallel_for_depend_messages.cpp | 8 ++--- .../target_parallel_for_simd_depend_messages.cpp | 8 ++--- test/OpenMP/target_simd_depend_messages.cpp | 8 ++--- test/OpenMP/target_teams_depend_messages.cpp | 8 ++--- .../target_teams_distribute_depend_messages.cpp | 8 ++--- ...ams_distribute_parallel_for_depend_messages.cpp | 8 ++--- ...istribute_parallel_for_simd_depend_messages.cpp | 8 ++--- ...arget_teams_distribute_simd_depend_messages.cpp | 8 ++--- test/OpenMP/target_update_depend_messages.cpp | 16 ++++----- test/OpenMP/task_codegen.cpp | 39 ++++++++++++++++++++++ test/OpenMP/task_depend_messages.cpp | 8 ++--- 15 files changed, 107 insertions(+), 68 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_depend_messages.cpp b/test/OpenMP/target_depend_messages.cpp index 5fdf37daf7..d699080545 100644 --- a/test/OpenMP/target_depend_messages.cpp +++ b/test/OpenMP/target_depend_messages.cpp @@ -24,13 +24,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); diff --git a/test/OpenMP/target_enter_data_depend_messages.cpp b/test/OpenMP/target_enter_data_depend_messages.cpp index ccc29ea49a..c9a0d7ab3c 100644 --- a/test/OpenMP/target_enter_data_depend_messages.cpp +++ b/test/OpenMP/target_enter_data_depend_messages.cpp @@ -26,13 +26,13 @@ int tmain(T argc, S **argv, R *env[]) { int i; #pragma omp target enter data map(to: i) depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target enter data map(to: i) depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target enter data map(to: i) depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target enter data map(to: i) depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target enter data map(to: i) depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target enter data map(to: i) depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target enter data map(to: i) depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target enter data map(to: i) depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target enter data map(to: i) depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target enter data map(to: i) depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); @@ -101,13 +101,13 @@ int main(int argc, char **argv, char *env[]) { int i; #pragma omp target enter data map(to: i) depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target enter data map(to: i) depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target enter data map(to: i) depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target enter data map(to: i) depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target enter data map(to: i) depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target enter data map(to: i) depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target enter data map(to: i) depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target enter data map(to: i) depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target enter data map(to: i) depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target enter data map(to: i) depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); diff --git a/test/OpenMP/target_exit_data_depend_messages.cpp b/test/OpenMP/target_exit_data_depend_messages.cpp index 7334cd751f..07ff02fad4 100644 --- a/test/OpenMP/target_exit_data_depend_messages.cpp +++ b/test/OpenMP/target_exit_data_depend_messages.cpp @@ -26,13 +26,13 @@ int tmain(T argc, S **argv, R *env[]) { int i; #pragma omp target exit data map(from: i) depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target exit data map(from: i) depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target exit data map(from: i) depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target exit data map(from: i) depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target exit data map(from: i) depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target exit data map(from: i) depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target exit data map(from: i) depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target exit data map(from: i) depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target exit data map(from: i) depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target exit data map(from: i) depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); @@ -101,13 +101,13 @@ int main(int argc, char **argv, char *env[]) { int i; #pragma omp target exit data map(from: i) depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target exit data map(from: i) depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target exit data map(from: i) depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target exit data map(from: i) depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target exit data map(from: i) depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target exit data map(from: i) depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target exit data map(from: i) depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target exit data map(from: i) depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target exit data map(from: i) depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target exit data map(from: i) depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); diff --git a/test/OpenMP/target_parallel_depend_messages.cpp b/test/OpenMP/target_parallel_depend_messages.cpp index 746c223706..15e22134b3 100644 --- a/test/OpenMP/target_parallel_depend_messages.cpp +++ b/test/OpenMP/target_parallel_depend_messages.cpp @@ -24,13 +24,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target parallel depend // expected-error {{expected '(' after 'depend'}} foo(); - #pragma omp target parallel depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target parallel depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); - #pragma omp target parallel depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target parallel depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); - #pragma omp target parallel depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target parallel depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target parallel depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); diff --git a/test/OpenMP/target_parallel_for_depend_messages.cpp b/test/OpenMP/target_parallel_for_depend_messages.cpp index d644711b5e..4b255ab0f3 100644 --- a/test/OpenMP/target_parallel_for_depend_messages.cpp +++ b/test/OpenMP/target_parallel_for_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target parallel for depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel for depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel for depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target parallel for depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target parallel for depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_parallel_for_simd_depend_messages.cpp b/test/OpenMP/target_parallel_for_simd_depend_messages.cpp index 5a735fc77a..6410a6c35a 100644 --- a/test/OpenMP/target_parallel_for_simd_depend_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target parallel for simd depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for simd depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel for simd depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for simd depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target parallel for simd depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for simd depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target parallel for simd depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target parallel for simd depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target parallel for simd depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_simd_depend_messages.cpp b/test/OpenMP/target_simd_depend_messages.cpp index 80f988d7a0..69594db71c 100644 --- a/test/OpenMP/target_simd_depend_messages.cpp +++ b/test/OpenMP/target_simd_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target simd depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target simd depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target simd depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target simd depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target simd depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target simd depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target simd depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); - #pragma omp target simd depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target simd depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target simd depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_depend_messages.cpp b/test/OpenMP/target_teams_depend_messages.cpp index 235ce98ee9..79aef0d35a 100644 --- a/test/OpenMP/target_teams_depend_messages.cpp +++ b/test/OpenMP/target_teams_depend_messages.cpp @@ -24,13 +24,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target teams depend // expected-error {{expected '(' after 'depend'}} foo(); -#pragma omp target teams depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); -#pragma omp target teams depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); -#pragma omp target teams depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target teams depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo(); -#pragma omp target teams depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} +#pragma omp target teams depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} foo(); #pragma omp target teams depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} foo(); diff --git a/test/OpenMP/target_teams_distribute_depend_messages.cpp b/test/OpenMP/target_teams_distribute_depend_messages.cpp index 9daba67020..14c7745155 100644 --- a/test/OpenMP/target_teams_distribute_depend_messages.cpp +++ b/test/OpenMP/target_teams_distribute_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target teams distribute depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target teams distribute depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} +#pragma omp target teams distribute depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp index 253e139b82..d853771c0d 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target teams distribute parallel for depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute parallel for depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute parallel for depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target teams distribute parallel for depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} +#pragma omp target teams distribute parallel for depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp index 7cc0d41234..2690b01e22 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target teams distribute parallel for simd depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute parallel for simd depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute parallel for simd depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target teams distribute parallel for simd depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} +#pragma omp target teams distribute parallel for simd depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp b/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp index 9c70d051d7..7e2012ace3 100644 --- a/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp @@ -25,13 +25,13 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target teams distribute simd depend // expected-error {{expected '(' after 'depend'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute simd depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} +#pragma omp target teams distribute simd depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target teams distribute simd depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} +#pragma omp target teams distribute simd depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_update_depend_messages.cpp b/test/OpenMP/target_update_depend_messages.cpp index d52f566844..016219c073 100644 --- a/test/OpenMP/target_update_depend_messages.cpp +++ b/test/OpenMP/target_update_depend_messages.cpp @@ -30,10 +30,10 @@ int tmain(T argc, S **argv, R *env[]) { {} #pragma omp target update to(z) depend // expected-error {{expected '(' after 'depend'}} - #pragma omp target update to(z) depend( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp target update to(z) depend() // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp target update to(z) depend(argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} - #pragma omp target update to(z) depend(source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target update to(z) depend( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target update to(z) depend() // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target update to(z) depend(argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target update to(z) depend(source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} #pragma omp target update to(z) depend(source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} #pragma omp target update to(z) depend(in : argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} #pragma omp target update to(z) depend(out: ) // expected-error {{expected expression}} @@ -78,10 +78,10 @@ int main(int argc, char **argv, char *env[]) { {} #pragma omp target update to(z) depend // expected-error {{expected '(' after 'depend'}} - #pragma omp target update to(z) depend( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp target update to(z) depend() // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp target update to(z) depend(argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} - #pragma omp target update to(z) depend(source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp target update to(z) depend( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target update to(z) depend() // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp target update to(z) depend(argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target update to(z) depend(source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} #pragma omp target update to(z) depend(source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} #pragma omp target update to(z) depend(in : argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} #pragma omp target update to(z) depend(out: ) // expected-error {{expected expression}} diff --git a/test/OpenMP/task_codegen.cpp b/test/OpenMP/task_codegen.cpp index b034bb29c8..a20c87239b 100644 --- a/test/OpenMP/task_codegen.cpp +++ b/test/OpenMP/task_codegen.cpp @@ -149,6 +149,45 @@ int main() { { a = 1; } +// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i32 0, i64 40, i64 1, +// CHECK: getelementptr inbounds [2 x [[STRUCT_S]]], [2 x [[STRUCT_S]]]* [[S]], i64 0, i64 0 +// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i64 0, i64 0 +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: ptrtoint [[STRUCT_S]]* %{{.+}} to i64 +// CHECK: store i64 %{{[^,]+}}, i64* +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 1 +// CHECK: store i64 4, i64* +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 +// CHECK: store i8 4, i8* +// CHECK: [[B_VAL:%.+]] = load i8, i8* [[B]] +// CHECK: [[IDX2:%.+]] = sext i8 [[B_VAL]] to i64 +// CHECK: [[IDX1:%.+]] = mul nsw i64 4, [[A_VAL]] +// CHECK: [[START:%.+]] = getelementptr inbounds i32, i32* %{{.+}}, i64 [[IDX1]] +// CHECK: [[START1:%.+]] = getelementptr inbounds i32, i32* [[START]], i64 [[IDX2]] +// CHECK: [[B_VAL:%.+]] = load i8, i8* [[B]] +// CHECK: [[IDX2:%.+]] = sext i8 [[B_VAL]] to i64 +// CHECK: [[IDX1:%.+]] = mul nsw i64 9, [[A_VAL]] +// CHECK: [[END:%.+]] = getelementptr inbounds i32, i32* %{{.+}}, i64 [[IDX1]] +// CHECK: [[END1:%.+]] = getelementptr inbounds i32, i32* [[END]], i64 [[IDX2]] +// CHECK: [[END2:%.+]] = getelementptr i32, i32* [[END1]], i32 1 +// CHECK: [[START_INT:%.+]] = ptrtoint i32* [[START1]] to i64 +// CHECK: [[END_INT:%.+]] = ptrtoint i32* [[END2]] to i64 +// CHECK: [[SIZEOF:%.+]] = sub nuw i64 [[END_INT]], [[START_INT]] +// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i64 0, i64 1 +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: ptrtoint i32* [[START1]] to i64 +// CHECK: store i64 %{{[^,]+}}, i64* +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 1 +// CHECK: store i64 [[SIZEOF]], i64* +// CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 +// CHECK: store i8 4, i8* +// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: bitcast [[KMP_DEPEND_INFO]]* %{{.+}} to i8* +// CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 2, i8* %{{[^,]+}}, i32 0, i8* null) +#pragma omp task untied depend(mutexinoutset: s[0], arr[4:][b]) + { + a = 1; + } // CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i32 3, i64 40, i64 1, // CHECK: getelementptr inbounds [3 x [[KMP_DEPEND_INFO]]], [3 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i64 0, i64 0 // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 0 diff --git a/test/OpenMP/task_depend_messages.cpp b/test/OpenMP/task_depend_messages.cpp index 469785e97c..12d1d1a684 100644 --- a/test/OpenMP/task_depend_messages.cpp +++ b/test/OpenMP/task_depend_messages.cpp @@ -23,10 +23,10 @@ int main(int argc, char **argv, char *env[]) { auto arr = x; // expected-error {{use of undeclared identifier 'x'}} #pragma omp task depend // expected-error {{expected '(' after 'depend'}} - #pragma omp task depend ( // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp task depend () // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} - #pragma omp task depend (argc // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} - #pragma omp task depend (source : argc) // expected-error {{expected 'in', 'out' or 'inout' in OpenMP clause 'depend'}} + #pragma omp task depend ( // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp task depend () // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} + #pragma omp task depend (argc // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} expected-warning {{missing ':' after dependency type - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task depend (source : argc) // expected-error {{expected 'in', 'out', 'inout' or 'mutexinoutset' in OpenMP clause 'depend'}} #pragma omp task depend (source) // expected-error {{expected expression}} expected-warning {{missing ':' after dependency type - ignoring}} #pragma omp task depend (in : argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}} #pragma omp task depend (out: ) // expected-error {{expected expression}} -- cgit v1.2.3 From 8c2557c8ff429945c39226b599e5179fa53902ec Mon Sep 17 00:00:00 2001 From: Kelvin Li Date: Tue, 5 Feb 2019 16:43:00 +0000 Subject: [OPENMP] issue error messages for multiple teams contructs in a target construct The fix is to issue error messages if there are more than one teams construct inside a target constructs. #pragma omp target { #pragma omp teams { ... } #pragma omp teams { ... } } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353186 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nesting_of_regions.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nesting_of_regions.cpp b/test/OpenMP/nesting_of_regions.cpp index 0955ee2155..fc9230c687 100644 --- a/test/OpenMP/nesting_of_regions.cpp +++ b/test/OpenMP/nesting_of_regions.cpp @@ -4078,6 +4078,13 @@ void foo() { #pragma omp teams ++a; } +#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} + { +#pragma omp teams // expected-note {{directive outside teams construct here}} + ++a; +#pragma omp teams // expected-note {{nested teams construct here}} + ++a; + } #pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} { ++a; // expected-note {{statement outside teams construct here}} @@ -12691,6 +12698,13 @@ void foo() { #pragma omp teams ++a; } +#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} + { +#pragma omp teams // expected-note {{directive outside teams construct here}} + ++a; +#pragma omp teams // expected-note {{nested teams construct here}} + ++a; + } #pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} { ++a; // expected-note {{statement outside teams construct here}} -- cgit v1.2.3 From 81348c0430dce0d5f2a9ebfc3c876f299576317d Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Fri, 8 Feb 2019 15:34:12 +0000 Subject: [opaque pointer types] Cleanup CGBuilder's Create*GEP. Some of these functions take some extraneous arguments, e.g. EltSize, Offset, which are computable from the Type and DataLayout. Add some asserts to ensure that the computed values are consistent with the passed-in values, in preparation for eliminating the extraneous arguments. This also asserts that the Type is an Array for the calls named "Array" and a Struct for the calls named "Struct". Then, correct a couple of errors: 1. Using CreateStructGEP on an array type. (this causes the majority of the test differences, as struct GEPs are created with i32 indices, while array GEPs are created with i64 indices) 2. Passing the wrong Offset to CreateStructGEP in TargetInfo.cpp on x86-64 NACL (which uses 32-bit pointers). Differential Revision: https://reviews.llvm.org/D57766 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353529 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_enter_data_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_exit_data_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_parallel_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_parallel_for_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_parallel_for_simd_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_simd_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_teams_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_teams_distribute_depend_codegen.cpp | 8 ++++---- .../target_teams_distribute_parallel_for_depend_codegen.cpp | 8 ++++---- .../OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp | 2 +- .../target_teams_distribute_parallel_for_simd_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp | 8 ++++---- test/OpenMP/target_update_depend_codegen.cpp | 8 ++++---- test/OpenMP/task_codegen.cpp | 9 ++++----- 15 files changed, 57 insertions(+), 58 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_depend_codegen.cpp b/test/OpenMP/target_depend_codegen.cpp index 588ab9757e..2ce7cbe559 100644 --- a/test/OpenMP/target_depend_codegen.cpp +++ b/test/OpenMP/target_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_enter_data_depend_codegen.cpp b/test/OpenMP/target_enter_data_depend_codegen.cpp index e17150d576..6b04a20966 100644 --- a/test/OpenMP/target_enter_data_depend_codegen.cpp +++ b/test/OpenMP/target_enter_data_depend_codegen.cpp @@ -90,7 +90,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i8* [[BC]], i32 0, i8* null) @@ -161,7 +161,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 3, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -239,7 +239,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 4, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -320,7 +320,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 5, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) diff --git a/test/OpenMP/target_exit_data_depend_codegen.cpp b/test/OpenMP/target_exit_data_depend_codegen.cpp index fec750dde2..df6981c12a 100644 --- a/test/OpenMP/target_exit_data_depend_codegen.cpp +++ b/test/OpenMP/target_exit_data_depend_codegen.cpp @@ -90,7 +90,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i8* [[BC]], i32 0, i8* null) @@ -161,7 +161,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 3, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -239,7 +239,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 4, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -320,7 +320,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 5, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) diff --git a/test/OpenMP/target_parallel_depend_codegen.cpp b/test/OpenMP/target_parallel_depend_codegen.cpp index dc55ec15e5..abd71351e1 100644 --- a/test/OpenMP/target_parallel_depend_codegen.cpp +++ b/test/OpenMP/target_parallel_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_parallel_for_depend_codegen.cpp b/test/OpenMP/target_parallel_for_depend_codegen.cpp index 85ec945c4f..107283a7ed 100644 --- a/test/OpenMP/target_parallel_for_depend_codegen.cpp +++ b/test/OpenMP/target_parallel_for_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[IN]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp b/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp index 83d752d9ab..2a76e318ca 100644 --- a/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp +++ b/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[IN]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[IN]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[IN]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_simd_depend_codegen.cpp b/test/OpenMP/target_simd_depend_codegen.cpp index e87b4fc8c3..37f726aa2a 100644 --- a/test/OpenMP/target_simd_depend_codegen.cpp +++ b/test/OpenMP/target_simd_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_teams_depend_codegen.cpp b/test/OpenMP/target_teams_depend_codegen.cpp index 9f9c7656ea..3c783fa178 100644 --- a/test/OpenMP/target_teams_depend_codegen.cpp +++ b/test/OpenMP/target_teams_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* @0, i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_teams_distribute_depend_codegen.cpp b/test/OpenMP/target_teams_distribute_depend_codegen.cpp index 99b7f2c2e9..c5d54da976 100644 --- a/test/OpenMP/target_teams_distribute_depend_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp index f573c04547..884c3642fb 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp index 7a1ea81091..6846aaf434 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp @@ -104,7 +104,7 @@ int target_teams_fun(int *g){ // CK1: ret void // CK1: define internal void @[[OUTL1]]({{.+}}) - // CK1: [[ARRDECAY:%.+]] = getelementptr inbounds [1000 x i32], [1000 x i32]* %{{.+}}, i32 0, i32 0 + // CK1: [[ARRDECAY:%.+]] = getelementptr inbounds [1000 x i32], [1000 x i32]* %{{.+}}, i{{32|64}} 0, i{{32|64}} 0 // CK1: [[ARR_CAST:%.+]] = ptrtoint i32* [[ARRDECAY]] to i{{32|64}} // CK1: [[MASKED_PTR:%.+]] = and i{{32|64}} [[ARR_CAST]], 7 // CK1: [[COND:%.+]] = icmp eq i{{32|64}} [[MASKED_PTR]], 0 diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp index 1258e685ea..8a02da4c62 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp index 1eb732322c..0516979f8c 100644 --- a/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp @@ -98,7 +98,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 // CHECK: getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 3 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 4, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) @@ -138,7 +138,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -154,7 +154,7 @@ int foo(int n) { // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 1 // CHECK: getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 2 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]], i32 3, i8* [[DEP]], i32 0, i8* null) // CHECK: br label %[[EXIT:.+]] @@ -170,7 +170,7 @@ int foo(int n) { // CHECK: [[TASK:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, i32 (i32, i8*)* bitcast (i32 (i32, %{{.+}}*)* [[TASK_ENTRY2:@.+]] to i32 (i32, i8*)*)) // CHECK: [[BC_TASK:%.+]] = bitcast i8* [[TASK]] to [[TASK_TY2:%.+]]* // CHECK: getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 - // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i32 0, i32 0 + // CHECK: [[DEP_START:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0 // CHECK: [[DEP:%.+]] = bitcast %struct.kmp_depend_info* [[DEP_START]] to i8* // CHECK: call void @__kmpc_omp_wait_deps(%struct.ident_t* [[ID]], i32 [[GTID]], i32 1, i8* [[DEP]], i32 0, i8* null) // CHECK: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* [[ID]], i32 [[GTID]], i8* [[TASK]]) diff --git a/test/OpenMP/target_update_depend_codegen.cpp b/test/OpenMP/target_update_depend_codegen.cpp index ee1b0bfcee..96c51f8cf4 100644 --- a/test/OpenMP/target_update_depend_codegen.cpp +++ b/test/OpenMP/target_update_depend_codegen.cpp @@ -90,7 +90,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [1 x %struct.kmp_depend_info], [1 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i8* [[BC]], i32 0, i8* null) @@ -161,7 +161,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [3 x %struct.kmp_depend_info], [3 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 3, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -239,7 +239,7 @@ void foo(int arg) { // CK1: store i[[sz]] 800, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 3, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [4 x %struct.kmp_depend_info], [4 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 4, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) @@ -320,7 +320,7 @@ void foo(int arg) { // CK1: store i[[sz]] 4, i[[sz]]* [[DEP_SIZE]], // CK1: [[DEP_ATTRS:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[DEP]], i32 0, i32 2 // CK1: store i8 1, i8* [[DEP_ATTRS]] - // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i32 0, i32 0 + // CK1: [[DEP:%.+]] = getelementptr inbounds [5 x %struct.kmp_depend_info], [5 x %struct.kmp_depend_info]* [[MAIN_DEP]], i[[sz]] 0, i[[sz]] 0 // CK1: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[DEP]] to i8* // CK1: call void @__kmpc_omp_wait_deps(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 5, i8* [[BC]], i32 0, i8* null) // CK1: call void @__kmpc_omp_task_begin_if0(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]]) diff --git a/test/OpenMP/task_codegen.cpp b/test/OpenMP/task_codegen.cpp index a20c87239b..2c4eb682d8 100644 --- a/test/OpenMP/task_codegen.cpp +++ b/test/OpenMP/task_codegen.cpp @@ -95,7 +95,7 @@ int main() { // CHECK: store i64 [[SIZEOF]], i64* [[T0]] // CHECK: [[T0:%.*]] = getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 // CHECK: store i8 1, i8* [[T0]] -// CHECK: [[DEPS:%.*]] = getelementptr inbounds [4 x [[KMP_DEPEND_INFO]]], [4 x [[KMP_DEPEND_INFO]]]* [[DEPENDENCIES]], i32 0, i32 0 +// CHECK: [[DEPS:%.*]] = getelementptr inbounds [4 x [[KMP_DEPEND_INFO]]], [4 x [[KMP_DEPEND_INFO]]]* [[DEPENDENCIES]], i{{32|64}} 0, i{{32|64}} 0 // CHECK: bitcast [[KMP_DEPEND_INFO]]* [[DEPS]] to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 4, i8* %{{[^,]+}}, i32 0, i8* null) #pragma omp task shared(a, s) depend(in : a, b, s, arr[:]) @@ -142,7 +142,7 @@ int main() { // CHECK: store i64 [[SIZEOF]], i64* // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 // CHECK: store i8 3, i8* -// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i{{32|64}} 0, i{{32|64}} 0 // CHECK: bitcast [[KMP_DEPEND_INFO]]* %{{.+}} to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 2, i8* %{{[^,]+}}, i32 0, i8* null) #pragma omp task untied depend(out : s[0], arr[4:][b]) @@ -181,7 +181,7 @@ int main() { // CHECK: store i64 [[SIZEOF]], i64* // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 // CHECK: store i8 4, i8* -// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: getelementptr inbounds [2 x [[KMP_DEPEND_INFO]]], [2 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i{{32|64}} 0, i{{32|64}} 0 // CHECK: bitcast [[KMP_DEPEND_INFO]]* %{{.+}} to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 2, i8* %{{[^,]+}}, i32 0, i8* null) #pragma omp task untied depend(mutexinoutset: s[0], arr[4:][b]) @@ -229,7 +229,7 @@ int main() { // CHECK: store i64 [[SIZEOF]], i64* // CHECK: getelementptr inbounds [[KMP_DEPEND_INFO]], [[KMP_DEPEND_INFO]]* %{{[^,]+}}, i32 0, i32 2 // CHECK: store i8 3, i8* -// CHECK: getelementptr inbounds [3 x [[KMP_DEPEND_INFO]]], [3 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i32 0, i32 0 +// CHECK: getelementptr inbounds [3 x [[KMP_DEPEND_INFO]]], [3 x [[KMP_DEPEND_INFO]]]* %{{[^,]+}}, i{{32|64}} 0, i{{32|64}} 0 // CHECK: bitcast [[KMP_DEPEND_INFO]]* %{{.+}} to i8* // CHECK: call i32 @__kmpc_omp_task_with_deps([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 3, i8* %{{[^,]+}}, i32 0, i8* null) #pragma omp task final(true) depend(inout: a, s[1], arr[:a][3:]) @@ -332,4 +332,3 @@ struct S1 { // CHECK: call i8* @__kmpc_omp_task_alloc( #endif - -- cgit v1.2.3 From 6bf67196e149f0822d10728c9d1065b6e3c99c10 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 8 Feb 2019 17:38:09 +0000 Subject: [OPENMP]Initial support for the delayed diagnostics. It is important to delay the emission of the diagnostic messages for the functions unless it is proved that the function is going to be used on the device side. It is required to support compilation with some of the target-specific system headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353540 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_exceptions_messages.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_exceptions_messages.cpp b/test/OpenMP/nvptx_target_exceptions_messages.cpp index 15c9522540..433ba13f73 100644 --- a/test/OpenMP/nvptx_target_exceptions_messages.cpp +++ b/test/OpenMP/nvptx_target_exceptions_messages.cpp @@ -68,4 +68,17 @@ int baz2() { return 2 + baz3(); } +int baz1() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} + +int foobar1(); +int foobar2(); + +int (*A)() = &foobar1; +#pragma omp declare target +int (*B)() = &foobar2; +#pragma omp end declare target + +int foobar1() { throw 1; } +int foobar2() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} + #endif // HEADER -- cgit v1.2.3 From 494c7e87ffb0fc7fb0741c4c814d72c2b407dc8c Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 8 Feb 2019 17:42:00 +0000 Subject: Revert "[OPENMP]Initial support for the delayed diagnostics." This reverts commit r353540. Erroneously committed, need to fix the message and description. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353541 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_exceptions_messages.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_exceptions_messages.cpp b/test/OpenMP/nvptx_target_exceptions_messages.cpp index 433ba13f73..15c9522540 100644 --- a/test/OpenMP/nvptx_target_exceptions_messages.cpp +++ b/test/OpenMP/nvptx_target_exceptions_messages.cpp @@ -68,17 +68,4 @@ int baz2() { return 2 + baz3(); } -int baz1() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} - -int foobar1(); -int foobar2(); - -int (*A)() = &foobar1; -#pragma omp declare target -int (*B)() = &foobar2; -#pragma omp end declare target - -int foobar1() { throw 1; } -int foobar2() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} - #endif // HEADER -- cgit v1.2.3 From a03305e04cab8922eb52a61636e1112c4fc3fb48 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 8 Feb 2019 18:02:25 +0000 Subject: [OPENMP]Delay emission of the error messages for the exceptions. Fixed diagnostic emission for the exceptions support in case of the compilation of OpenMP code for the devices. From now on, it uses delayed diagnostics mechanism, previously used for CUDA only. It allow to diagnose not allowed used of exceptions only in functions that are going to be codegen'ed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353542 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_exceptions_messages.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_exceptions_messages.cpp b/test/OpenMP/nvptx_target_exceptions_messages.cpp index 15c9522540..433ba13f73 100644 --- a/test/OpenMP/nvptx_target_exceptions_messages.cpp +++ b/test/OpenMP/nvptx_target_exceptions_messages.cpp @@ -68,4 +68,17 @@ int baz2() { return 2 + baz3(); } +int baz1() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} + +int foobar1(); +int foobar2(); + +int (*A)() = &foobar1; +#pragma omp declare target +int (*B)() = &foobar2; +#pragma omp end declare target + +int foobar1() { throw 1; } +int foobar2() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}} + #endif // HEADER -- cgit v1.2.3 From d1f4353f6e59e74948fb8442a8fda9b0bf379700 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 15 Feb 2019 00:27:53 +0000 Subject: PR40642: Fix determination of whether the final statement of a statement expression is a discarded-value expression. Summary: We used to get this wrong in three ways: 1) During parsing, an expression-statement followed by the }) ending a statement expression was always treated as producing the value of the statement expression. That's wrong for ({ if (1) expr; }) 2) During template instantiation, various kinds of statement (most statements not appearing directly in a compound-statement) were not treated as discarded-value expressions, resulting in missing volatile loads (etc). 3) In all contexts, an expression-statement with attributes was not treated as producing the value of the statement expression, eg ({ [[attr]] expr; }). Also fix incorrect enforcement of OpenMP rule that directives can "only be placed in the program at a position where ignoring or deleting the directive would result in a program with correct syntax". In particular, a label (be it goto, case, or default) should not affect whether directives are permitted. Reviewers: aaron.ballman, rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57984 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354090 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/barrier_messages.cpp | 8 ++++---- test/OpenMP/cancel_messages.cpp | 4 ++-- test/OpenMP/cancellation_point_messages.cpp | 4 ++-- test/OpenMP/flush_messages.cpp | 8 ++++---- test/OpenMP/taskwait_messages.cpp | 8 ++++---- test/OpenMP/taskyield_messages.cpp | 14 ++++++++++---- 6 files changed, 26 insertions(+), 20 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/barrier_messages.cpp b/test/OpenMP/barrier_messages.cpp index 137453a893..42edc9f46a 100644 --- a/test/OpenMP/barrier_messages.cpp +++ b/test/OpenMP/barrier_messages.cpp @@ -29,7 +29,7 @@ T tmain(T argc) { #pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp barrier +#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp barrier @@ -49,7 +49,7 @@ T tmain(T argc) { #pragma omp barrier } label: -#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} +#pragma omp barrier label1 : { #pragma omp barrier } @@ -83,7 +83,7 @@ int main(int argc, char **argv) { #pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp barrier +#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp barrier @@ -103,7 +103,7 @@ int main(int argc, char **argv) { #pragma omp barrier } label: -#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}} +#pragma omp barrier label1 : { #pragma omp barrier } diff --git a/test/OpenMP/cancel_messages.cpp b/test/OpenMP/cancel_messages.cpp index b14c42f395..f78b28c1cb 100644 --- a/test/OpenMP/cancel_messages.cpp +++ b/test/OpenMP/cancel_messages.cpp @@ -63,7 +63,7 @@ int main(int argc, char **argv) { #pragma omp cancel parallel // expected-error {{'#pragma omp cancel' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} switch (argc) case 1: -#pragma omp cancel sections // expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} +#pragma omp cancel sections // expected-error {{'#pragma omp cancel' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} switch (argc) case 1: { #pragma omp cancel for // expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} @@ -83,7 +83,7 @@ int main(int argc, char **argv) { #pragma omp cancel taskgroup // expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} } label: -#pragma omp cancel parallel // expected-error {{'#pragma omp cancel' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} +#pragma omp cancel parallel // expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} label1 : { #pragma omp cancel sections // expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} } diff --git a/test/OpenMP/cancellation_point_messages.cpp b/test/OpenMP/cancellation_point_messages.cpp index 2bf667c407..058818df71 100644 --- a/test/OpenMP/cancellation_point_messages.cpp +++ b/test/OpenMP/cancellation_point_messages.cpp @@ -63,7 +63,7 @@ int main(int argc, char **argv) { #pragma omp cancellation point parallel // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} switch (argc) case 1: -#pragma omp cancellation point sections // expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} +#pragma omp cancellation point sections // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} switch (argc) case 1: { #pragma omp cancellation point for // expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} @@ -83,7 +83,7 @@ int main(int argc, char **argv) { #pragma omp cancellation point taskgroup // expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} } label: -#pragma omp cancellation point parallel // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} +#pragma omp cancellation point parallel // expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} label1 : { #pragma omp cancellation point sections // expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} } diff --git a/test/OpenMP/flush_messages.cpp b/test/OpenMP/flush_messages.cpp index da1d0c2412..f4456489a9 100644 --- a/test/OpenMP/flush_messages.cpp +++ b/test/OpenMP/flush_messages.cpp @@ -33,7 +33,7 @@ T tmain(T argc) { #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp flush +#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp flush @@ -53,7 +53,7 @@ T tmain(T argc) { #pragma omp flush } label: -#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} +#pragma omp flush label1 : { #pragma omp flush } @@ -97,7 +97,7 @@ int main(int argc, char **argv) { #pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp flush +#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp flush @@ -117,7 +117,7 @@ int main(int argc, char **argv) { #pragma omp flush } label: -#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}} +#pragma omp flush label1 : { #pragma omp flush } diff --git a/test/OpenMP/taskwait_messages.cpp b/test/OpenMP/taskwait_messages.cpp index 46efff5972..55bf2ddcad 100644 --- a/test/OpenMP/taskwait_messages.cpp +++ b/test/OpenMP/taskwait_messages.cpp @@ -29,7 +29,7 @@ T tmain(T argc) { #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp taskwait +#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp taskwait @@ -49,7 +49,7 @@ T tmain(T argc) { #pragma omp taskwait } label: -#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} +#pragma omp taskwait label1 : { #pragma omp taskwait } @@ -83,7 +83,7 @@ int main(int argc, char **argv) { #pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp taskwait +#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp taskwait @@ -103,7 +103,7 @@ int main(int argc, char **argv) { #pragma omp taskwait } label: -#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} +#pragma omp taskwait label1 : { #pragma omp taskwait } diff --git a/test/OpenMP/taskyield_messages.cpp b/test/OpenMP/taskyield_messages.cpp index fd98a8786f..48f741df91 100644 --- a/test/OpenMP/taskyield_messages.cpp +++ b/test/OpenMP/taskyield_messages.cpp @@ -29,7 +29,7 @@ T tmain(T argc) { #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp taskyield +#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp taskyield @@ -49,10 +49,13 @@ T tmain(T argc) { #pragma omp taskyield } label: -#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} +#pragma omp taskyield label1 : { #pragma omp taskyield } +if (1) + label2: +#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} return T(); } @@ -83,7 +86,7 @@ int main(int argc, char **argv) { #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} switch (argc) case 1: -#pragma omp taskyield +#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} switch (argc) case 1: { #pragma omp taskyield @@ -103,10 +106,13 @@ int main(int argc, char **argv) { #pragma omp taskyield } label: -#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} +#pragma omp taskyield label1 : { #pragma omp taskyield } +if (1) + label2: +#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}} return tmain(argc); } -- cgit v1.2.3 From 238a43704cfd30b68eb78775e123609faab5ca11 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 19 Feb 2019 16:38:20 +0000 Subject: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier. This patch implements the parsing and sema support for OpenMP map clauses with potential user-defined mapper attached. User defined mapper is a new feature in OpenMP 5.0. A map clause can have an explicit or implicit associated mapper, which instructs the compiler to generate extra data mapping. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss Contributed-by: Lingda Li Differential Revision: https://reviews.llvm.org/D58074 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354347 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_mapper_ast_print.c | 8 +++ test/OpenMP/declare_mapper_ast_print.cpp | 41 +++++++++++++- test/OpenMP/declare_mapper_codegen.cpp | 66 ++++++++++++++++++++++ test/OpenMP/declare_mapper_messages.c | 15 +++++ test/OpenMP/declare_mapper_messages.cpp | 23 ++++++++ test/OpenMP/target_map_messages.cpp | 16 +++--- test/OpenMP/target_parallel_for_map_messages.cpp | 4 +- .../target_parallel_for_simd_map_messages.cpp | 4 +- test/OpenMP/target_parallel_map_messages.cpp | 4 +- test/OpenMP/target_simd_map_messages.cpp | 4 +- .../target_teams_distribute_map_messages.cpp | 4 +- ..._teams_distribute_parallel_for_map_messages.cpp | 4 +- ...s_distribute_parallel_for_simd_map_messages.cpp | 4 +- .../target_teams_distribute_simd_map_messages.cpp | 4 +- test/OpenMP/target_teams_map_messages.cpp | 4 +- 15 files changed, 176 insertions(+), 29 deletions(-) create mode 100644 test/OpenMP/declare_mapper_codegen.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_mapper_ast_print.c b/test/OpenMP/declare_mapper_ast_print.c index a2c78a1c16..6023fc5f17 100644 --- a/test/OpenMP/declare_mapper_ast_print.c +++ b/test/OpenMP/declare_mapper_ast_print.c @@ -40,6 +40,14 @@ int main() { { #pragma omp declare mapper(id: struct vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len) + struct vec vv; + struct dat dd[10]; +#pragma omp target map(mapper(id) alloc: vv) +// CHECK: #pragma omp target map(mapper(id),alloc: vv) + { vv.len++; } +#pragma omp target map(mapper(default), from: dd[0:10]) +// CHECK: #pragma omp target map(mapper(default),from: dd[0:10]) + { dd[0].i++; } } return 0; } diff --git a/test/OpenMP/declare_mapper_ast_print.cpp b/test/OpenMP/declare_mapper_ast_print.cpp index dab7455697..c6baec3971 100644 --- a/test/OpenMP/declare_mapper_ast_print.cpp +++ b/test/OpenMP/declare_mapper_ast_print.cpp @@ -21,6 +21,13 @@ public: }; // CHECK: }; +// CHECK: class vecchild : public N1::vec { +class vecchild : public vec { +public: + int lenc; +}; +// CHECK: }; + #pragma omp declare mapper(id: vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len){{$}} }; @@ -56,34 +63,62 @@ public: template T foo(T a) { + struct foodatchild { + T k; + }; struct foodat { T a; + struct foodatchild b; }; -#pragma omp declare mapper(struct foodat v) map(v.a) +#pragma omp declare mapper(id: struct foodat v) map(v.a) +#pragma omp declare mapper(idd: struct foodatchild v) map(v.k) #pragma omp declare mapper(id: N1::vec v) map(v.len) { #pragma omp declare mapper(id: N1::vec v) map(v.len) } + struct foodat fd; +#pragma omp target map(mapper(id) alloc: fd) + { fd.a++; } +#pragma omp target map(mapper(idd) alloc: fd.b) + { fd.b.k++; } return 0; } // CHECK: template T foo(T a) { -// CHECK: #pragma omp declare mapper (default : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (id : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (idd : struct foodatchild v) map(tofrom: v.k) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) // CHECK: { // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) // CHECK: } +// CHECK: #pragma omp target map(mapper(id),alloc: fd) +// CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) // CHECK: } // CHECK: template<> int foo(int a) { -// CHECK: #pragma omp declare mapper (default : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (id : struct foodat v) map(tofrom: v.a) +// CHECK: #pragma omp declare mapper (idd : struct foodatchild v) map(tofrom: v.k) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) // CHECK: { // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) // CHECK: } +// CHECK: #pragma omp target map(mapper(id),alloc: fd) +// CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) // CHECK: } // CHECK: int main() { int main() { + N1::vec vv, vvv; + N1::vecchild vc; + dat dd; +#pragma omp target map(mapper(N1::id) tofrom: vv) map(mapper(dat::id) alloc: vvv) +// CHECK: #pragma omp target map(mapper(N1::id),tofrom: vv) map(mapper(dat::id),alloc: vvv) + { vv.len++; } +#pragma omp target map(mapper(N1::id) tofrom: vc) +// CHECK: #pragma omp target map(mapper(N1::id),tofrom: vc) + { vc.len++; } +#pragma omp target map(mapper(default) tofrom: dd) +// CHECK: #pragma omp target map(mapper(default),tofrom: dd) + { dd.d++; } #pragma omp declare mapper(id: N1::vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) { diff --git a/test/OpenMP/declare_mapper_codegen.cpp b/test/OpenMP/declare_mapper_codegen.cpp new file mode 100644 index 0000000000..3f80b7eb19 --- /dev/null +++ b/test/OpenMP/declare_mapper_codegen.cpp @@ -0,0 +1,66 @@ +///==========================================================================/// +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s +// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s +// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s + +// SIMD-ONLY0-NOT: {{__kmpc|__tgt}} + +// expected-no-diagnostics +#ifndef HEADER +#define HEADER + +class C { +public: + int a; +}; + +#pragma omp declare mapper(id: C s) map(s.a) + +// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l49.region_id = weak constant i8 0 + +// CHECK-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i{{64|32}}] [i{{64|32}} 4] +// CHECK-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35] + +// CHECK-LABEL: foo{{.*}}( +void foo(int a){ + int i = a; + C c; + c.a = a; + + // CHECK-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}}) + // CHECK-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0 + // CHECK-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 + // CHECK-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 + // CHECK-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 + // CHECK-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to %class.C** + // CHECK-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to %class.C** + // CHECK-DAG: store %class.C* [[VAL:%[^,]+]], %class.C** [[CBP1]] + // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[CP1]] + #pragma omp target map(mapper(id),tofrom: c) + { + ++c.a; + } + // CHECK: call void [[KERNEL:@.+]](%class.C* [[VAL]]) +} + + +// CHECK: define internal void [[KERNEL]](%class.C* {{.+}}[[ARG:%.+]]) +// CHECK: [[ADDR:%.+]] = alloca %class.C*, +// CHECK: store %class.C* [[ARG]], %class.C** [[ADDR]] +// CHECK: [[CADDR:%.+]] = load %class.C*, %class.C** [[ADDR]] +// CHECK: [[CAADDR:%.+]] = getelementptr inbounds %class.C, %class.C* [[CADDR]], i32 0, i32 0 +// CHECK: [[VAL:%[^,]+]] = load i32, i32* [[CAADDR]] +// CHECK: {{.+}} = add nsw i32 [[VAL]], 1 +// CHECK: } + +#endif diff --git a/test/OpenMP/declare_mapper_messages.c b/test/OpenMP/declare_mapper_messages.c index c8e65b2a36..fc8fa9dbda 100644 --- a/test/OpenMP/declare_mapper_messages.c +++ b/test/OpenMP/declare_mapper_messages.c @@ -35,6 +35,21 @@ int fun(int arg) { #pragma omp declare mapper(id: struct vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'id'}} { #pragma omp declare mapper(id: struct vec v) map(v.len) + struct vec vv, v1; +#pragma omp target map(mapper) // expected-error {{use of undeclared identifier 'mapper'}} + {} +#pragma omp target map(mapper:vv) // expected-error {{expected '(' after 'mapper'}} + {} +#pragma omp target map(mapper( :vv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-warning {{implicit declaration of function 'mapper' is invalid in C99}} expected-note {{to match this '('}} + {} +#pragma omp target map(mapper(aa :vv) // expected-error {{use of undeclared identifier 'aa'}} expected-error {{expected ')'}} expected-warning {{implicit declaration of function 'mapper' is invalid in C99}} expected-note {{to match this '('}} + {} +#pragma omp target map(mapper(ab) :vv) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} + {} +#pragma omp target map(mapper(aa) :vv) // expected-error {{missing map type}} + {} +#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1) + {} } } return arg; diff --git a/test/OpenMP/declare_mapper_messages.cpp b/test/OpenMP/declare_mapper_messages.cpp index 29c76ad79f..2031d19877 100644 --- a/test/OpenMP/declare_mapper_messages.cpp +++ b/test/OpenMP/declare_mapper_messages.cpp @@ -63,6 +63,29 @@ int fun(int arg) { #pragma omp declare mapper(id: vec v) map(v.len) // expected-note {{previous definition is here}} { #pragma omp declare mapper(id: vec v) map(v.len) + vec vv, v1; +#pragma omp target map(mapper) // expected-error {{use of undeclared identifier 'mapper'}} + {} +#pragma omp target map(mapper:vv) // expected-error {{expected '(' after 'mapper'}} + {} +#pragma omp target map(mapper( :vv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + {} +#pragma omp target map(mapper(aa :vv) // expected-error {{use of undeclared identifier 'aa'}} expected-error {{expected ')'}} expected-note {{to match this '('}} + {} +#pragma omp target map(mapper(ab) :vv) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} + {} +#pragma omp target map(mapper(N2::) :vv) // expected-error {{use of undeclared identifier 'N2'}} expected-error {{illegal identifier on 'omp declare mapper' directive}} + {} +#pragma omp target map(mapper(N1::) :vv) // expected-error {{illegal identifier on 'omp declare mapper' directive}} + {} +#pragma omp target map(mapper(aa) :vv) // expected-error {{missing map type}} + {} +#pragma omp target map(mapper(N1::aa) alloc:vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}} + {} +#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1) + {} +#pragma omp target map(mapper(N1::stack::id) to:vv) + {} } #pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} } diff --git a/test/OpenMP/target_map_messages.cpp b/test/OpenMP/target_map_messages.cpp index e81e61eaab..e1967d27c9 100644 --- a/test/OpenMP/target_map_messages.cpp +++ b/test/OpenMP/target_map_messages.cpp @@ -110,17 +110,17 @@ struct SA { {} #pragma omp target map( , , : a) // expected-error {{missing map type modifier}} expected-error {{missing map type modifier}} expected-error {{missing map type}} {} - #pragma omp target map( d, f, bf: a) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}} + #pragma omp target map( d, f, bf: a) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}} {} - #pragma omp target map( , f, : a) // expected-error {{missing map type modifier}} expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} + #pragma omp target map( , f, : a) // expected-error {{missing map type modifier}} expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} {} #pragma omp target map(always close: a) // expected-error {{missing map type}} {} #pragma omp target map(always close bf: a) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}} {} - #pragma omp target map(always tofrom close: a) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} + #pragma omp target map(always tofrom close: a) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} {} - #pragma omp target map(tofrom from: a) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} + #pragma omp target map(tofrom from: a) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} {} #pragma omp target map(close bf: a) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}} {} @@ -516,14 +516,14 @@ T tmain(T argc) { #pragma omp target data map(always, tofrom: x) #pragma omp target data map(always: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} #pragma omp target data map(always, tofrom: always, tofrom, x) #pragma omp target map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}} foo(); #pragma omp target data map(close, tofrom: x) #pragma omp target data map(close: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, close: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, close: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} #pragma omp target data map(close, tofrom: close, tofrom, x) foo(); return 0; @@ -613,13 +613,13 @@ int main(int argc, char **argv) { #pragma omp target data map(always, tofrom: x) #pragma omp target data map(always: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} #pragma omp target data map(always, tofrom: always, tofrom, x) #pragma omp target map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}} foo(); #pragma omp target data map(close, tofrom: x) #pragma omp target data map(close: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, close: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, close: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} foo(); #pragma omp target private(j) map(j) // expected-error {{private variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as private}} {} diff --git a/test/OpenMP/target_parallel_for_map_messages.cpp b/test/OpenMP/target_parallel_for_map_messages.cpp index 6d82921603..8521700b5c 100644 --- a/test/OpenMP/target_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_parallel_for_simd_map_messages.cpp index a5135559cc..83259cdd3e 100644 --- a/test/OpenMP/target_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_parallel_map_messages.cpp b/test/OpenMP/target_parallel_map_messages.cpp index 056fd501ac..510595cb0b 100644 --- a/test/OpenMP/target_parallel_map_messages.cpp +++ b/test/OpenMP/target_parallel_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { foo(); #pragma omp target parallel map(always: x) // expected-error {{missing map type}} foo(); -#pragma omp target parallel map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} foo(); #pragma omp target parallel map(always, tofrom: always, tofrom, x) foo(); @@ -270,7 +270,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target parallel map(always: x) // expected-error {{missing map type}} foo(); -#pragma omp target parallel map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target parallel map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} foo(); #pragma omp target parallel map(always, tofrom: always, tofrom, x) foo(); diff --git a/test/OpenMP/target_simd_map_messages.cpp b/test/OpenMP/target_simd_map_messages.cpp index acd6298808..4b76042e45 100644 --- a/test/OpenMP/target_simd_map_messages.cpp +++ b/test/OpenMP/target_simd_map_messages.cpp @@ -159,7 +159,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -263,7 +263,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_map_messages.cpp b/test/OpenMP/target_teams_distribute_map_messages.cpp index bbfa7cde9a..e4c1d0f898 100644 --- a/test/OpenMP/target_teams_distribute_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp index f585d0a1ee..878fac1517 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute parallel for map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp index 5cf0327895..b2da680885 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute parallel for simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp index 99c633a45d..c559bcb410 100644 --- a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp @@ -163,7 +163,7 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); @@ -271,7 +271,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(always: x) // expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target teams distribute simd map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(always, tofrom: always, tofrom, x) for (i = 0; i < argc; ++i) foo(); diff --git a/test/OpenMP/target_teams_map_messages.cpp b/test/OpenMP/target_teams_map_messages.cpp index 4b2629ee33..e59a96c881 100644 --- a/test/OpenMP/target_teams_map_messages.cpp +++ b/test/OpenMP/target_teams_map_messages.cpp @@ -454,7 +454,7 @@ T tmain(T argc) { #pragma omp target data map(always, tofrom: x) #pragma omp target data map(always: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} #pragma omp target data map(always, tofrom: always, tofrom, x) #pragma omp target teams map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}} foo(); @@ -529,7 +529,7 @@ int main(int argc, char **argv) { #pragma omp target data map(always, tofrom: x) #pragma omp target data map(always: x) // expected-error {{missing map type}} -#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always' or 'close'}} expected-error {{missing map type}} +#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always', 'close', or 'mapper'}} expected-error {{missing map type}} #pragma omp target data map(always, tofrom: always, tofrom, x) #pragma omp target teams map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}} foo(); -- cgit v1.2.3 From 349d010d880cff6877e83050c66dda47822ef7c4 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 20 Feb 2019 16:36:22 +0000 Subject: [OPENMP][NVPTX]Use faster teams reduction algorithm. A faster way to reduce the values in teams reductions was found, the codegen is updated to use this faster algorithm and new runtime functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354479 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_teams_reduction_codegen.cpp | 966 +++++++++++++++++++++++++- 1 file changed, 940 insertions(+), 26 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_teams_reduction_codegen.cpp b/test/OpenMP/nvptx_teams_reduction_codegen.cpp index 0de25295a7..d5a275a554 100644 --- a/test/OpenMP/nvptx_teams_reduction_codegen.cpp +++ b/test/OpenMP/nvptx_teams_reduction_codegen.cpp @@ -3,28 +3,32 @@ // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 -// RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 +// RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -fopenmp-cuda-teams-reduction-recs-num=2048 -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 // expected-no-diagnostics #ifndef HEADER #define HEADER -// CHECK: [[MAP_TY:%.+]] = type { [128 x i8] } +// CHECK-DAG: [[TEAM1_REDUCE_TY:%.+]] = type { [{{1024|2048}} x double] } +// CHECK-DAG: [[TEAM2_REDUCE_TY:%.+]] = type { [{{1024|2048}} x i8], [{{1024|2048}} x float] } +// CHECK-DAG: [[TEAM3_REDUCE_TY:%.+]] = type { [{{1024|2048}} x i32], [{{1024|2048}} x i16] } +// CHECK-DAG: [[TEAMS_REDUCE_UNION_TY:%.+]] = type { [[TEAM1_REDUCE_TY]] } +// CHECK-DAG: [[MAP_TY:%.+]] = type { [128 x i8] } // CHECK-DAG: [[KERNEL_PTR:@.+]] = internal addrspace(3) global i8* null // CHECK-DAG: [[KERNEL_SHARED1:@.+]] = internal unnamed_addr constant i16 1 // CHECK-DAG: [[KERNEL_SHARED2:@.+]] = internal unnamed_addr constant i16 1 -// CHECK-DAG: [[KERNEL_SHARED3:@.+]] = internal unnamed_addr constant i16 1 // CHECK-DAG: [[KERNEL_SIZE1:@.+]] = internal unnamed_addr constant i{{64|32}} {{16|8}} // CHECK-DAG: [[KERNEL_SIZE2:@.+]] = internal unnamed_addr constant i{{64|32}} 16 -// CHECK-DAG: [[KERNEL_SIZE3:@.+]] = internal unnamed_addr constant i{{64|32}} 8 // Check for the data transfer medium in shared memory to transfer the reduction list to the first warp. // CHECK-DAG: [[TRANSFER_STORAGE:@.+]] = common addrspace([[SHARED_ADDRSPACE:[0-9]+]]) global [32 x i32] // Check that the execution mode of 2 target regions is set to Non-SPMD and the 3rd is in SPMD. -// CHECK-DAG: {{@__omp_offloading_.+l37}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l43}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l50}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l41}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l47}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l54}}_exec_mode = weak constant i8 0 + +// CHECK-DAG: [[TEAMS_RED_BUFFER:@.+]] = common global [[TEAMS_REDUCE_UNION_TY]] zeroinitializer template tx ftemplate(int n) { @@ -66,9 +70,9 @@ int bar(int n){ return a; } - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l37}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l41}}_worker() - // CHECK: define {{.*}}void [[T1:@__omp_offloading_.+template.+l37]]( + // CHECK: define {{.*}}void [[T1:@__omp_offloading_.+template.+l41]]( // // CHECK: {{call|invoke}} void [[T1]]_worker() // @@ -78,7 +82,11 @@ int bar(int n){ // CHECK: [[EV:%.+]] = load double, double* [[E]], align // CHECK: [[ADD:%.+]] = fadd double [[EV]], 5 // CHECK: store double [[ADD]], double* [[E]], align - // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_simple(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], [8 x i32]* [[LOCK:@.+]]) + // CHECK: [[GEP1:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[BC:%.+]] = bitcast double* [[E]] to i8* + // CHECK: store i8* [[BC]], i8** [[GEP1]], + // CHECK: [[BC_RED_LIST:%.+]] = bitcast [1 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], i8* bitcast ([[TEAMS_REDUCE_UNION_TY]]* [[TEAMS_RED_BUFFER]] to i8*), i32 {{1024|2048}}, i8* [[BC_RED_LIST]], void (i8*, i16, i16, i16)* [[SHUFFLE_AND_REDUCE:@.+]], void (i8*, i32)* [[INTER_WARP_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_RED:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_COPY:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_RED:@.+]]) // CHECK: [[COND:%.+]] = icmp eq i32 [[RET]], 1 // CHECK: br i1 [[COND]], label {{%?}}[[IFLABEL:.+]], label {{%?}}[[EXIT:.+]] // @@ -87,15 +95,250 @@ int bar(int n){ // CHECK: [[EV:%.+]] = load double, double* [[E]], align // CHECK: [[ADD:%.+]] = fadd double [[E_INV]], [[EV]] // CHECK: store double [[ADD]], double* [[E_IN]], align - // CHECK: call void @__kmpc_nvptx_teams_end_reduce_nowait_simple(%struct.ident_t* [[LOC]], i32 [[GTID]], [8 x i32]* [[LOCK]]) + // CHECK: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[GTID]]) // CHECK: br label %[[EXIT]] // // CHECK: [[EXIT]] // CHECK: call void @__kmpc_kernel_deinit( - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l43}}_worker() + // + // Reduction function + // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*) + // CHECK: [[VAR_RHS_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[VAR_RHS_VOID:%.+]] = load i8*, i8** [[VAR_RHS_REF]], + // CHECK: [[VAR_RHS:%.+]] = bitcast i8* [[VAR_RHS_VOID]] to double* + // + // CHECK: [[VAR_LHS_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST_LHS:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[VAR_LHS_VOID:%.+]] = load i8*, i8** [[VAR_LHS_REF]], + // CHECK: [[VAR_LHS:%.+]] = bitcast i8* [[VAR_LHS_VOID]] to double* + // + // CHECK: [[VAR_LHS_VAL:%.+]] = load double, double* [[VAR_LHS]], + // CHECK: [[VAR_RHS_VAL:%.+]] = load double, double* [[VAR_RHS]], + // CHECK: [[RES:%.+]] = fadd double [[VAR_LHS_VAL]], [[VAR_RHS_VAL]] + // CHECK: store double [[RES]], double* [[VAR_LHS]], + // CHECK: ret void + + // + // Shuffle and reduce function + // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}}) + // CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [1 x i8*], align + // CHECK: [[REMOTE_ELT:%.+]] = alloca double + // + // CHECK: [[LANEID:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[LANEOFFSET:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[ALGVER:%.+]] = load i16, i16* {{.+}}, align + // + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[REMOTE_RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to double* + // + // CHECK: [[ELT_CAST:%.+]] = bitcast double* [[ELT]] to i64* + // CHECK: [[REMOTE_ELT_CAST:%.+]] = bitcast double* [[REMOTE_ELT]] to i64* + // CHECK: [[ELT_VAL:%.+]] = load i64, i64* [[ELT_CAST]], align + // CHECK: [[WS32:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() + // CHECK: [[WS:%.+]] = trunc i32 [[WS32]] to i16 + // CHECK: [[REMOTE_ELT_VAL64:%.+]] = call i64 @__kmpc_shuffle_int64(i64 [[ELT_VAL]], i16 [[LANEOFFSET]], i16 [[WS]]) + // + // CHECK: store i64 [[REMOTE_ELT_VAL64]], i64* [[REMOTE_ELT_CAST]], align + // CHECK: [[REMOTE_ELT_VOID:%.+]] = bitcast double* [[REMOTE_ELT]] to i8* + // CHECK: store i8* [[REMOTE_ELT_VOID]], i8** [[REMOTE_ELT_REF]], align + // + // Condition to reduce + // CHECK: [[CONDALG0:%.+]] = icmp eq i16 [[ALGVER]], 0 + // + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp ult i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[CONDALG1:%.+]] = and i1 [[COND1]], [[COND2]] + // + // CHECK: [[COND3:%.+]] = icmp eq i16 [[ALGVER]], 2 + // CHECK: [[COND4:%.+]] = and i16 [[LANEID]], 1 + // CHECK: [[COND5:%.+]] = icmp eq i16 [[COND4]], 0 + // CHECK: [[COND6:%.+]] = and i1 [[COND3]], [[COND5]] + // CHECK: [[COND7:%.+]] = icmp sgt i16 [[LANEOFFSET]], 0 + // CHECK: [[CONDALG2:%.+]] = and i1 [[COND6]], [[COND7]] + // + // CHECK: [[COND8:%.+]] = or i1 [[CONDALG0]], [[CONDALG1]] + // CHECK: [[SHOULD_REDUCE:%.+]] = or i1 [[COND8]], [[CONDALG2]] + // CHECK: br i1 [[SHOULD_REDUCE]], label {{%?}}[[DO_REDUCE:.+]], label {{%?}}[[REDUCE_ELSE:.+]] + // + // CHECK: [[DO_REDUCE]] + // CHECK: [[RED_LIST1_VOID:%.+]] = bitcast [1 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RED_LIST2_VOID:%.+]] = bitcast [1 x i8*]* [[REMOTE_RED_LIST]] to i8* + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RED_LIST1_VOID]], i8* [[RED_LIST2_VOID]]) + // CHECK: br label {{%?}}[[REDUCE_CONT:.+]] + // + // CHECK: [[REDUCE_ELSE]] + // CHECK: br label {{%?}}[[REDUCE_CONT]] + // + // CHECK: [[REDUCE_CONT]] + // Now check if we should just copy over the remote reduction list + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp uge i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[SHOULD_COPY:%.+]] = and i1 [[COND1]], [[COND2]] + // CHECK: br i1 [[SHOULD_COPY]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // CHECK: [[DO_COPY]] + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[REMOTE_RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[REMOTE_ELT_VOID:%.+]] = load i8*, i8** [[REMOTE_ELT_REF]], + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT:%.+]] = bitcast i8* [[REMOTE_ELT_VOID]] to double* + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to double* + // CHECK: [[REMOTE_ELT_VAL:%.+]] = load double, double* [[REMOTE_ELT]], align + // CHECK: store double [[REMOTE_ELT_VAL]], double* [[ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // CHECK: [[COPY_CONT]] + // CHECK: void + + // + // Inter warp copy function + // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32) + // CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31 + // CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5 + // CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [1 x i8*]* + // CHECK: store i32 0, i32* [[CNT_ADDR:%.+]], + // CHECK: br label + // CHECK: [[CNT:%.+]] = load i32, i32* [[CNT_ADDR]], + // CHECK: [[DONE_COPY:%.+]] = icmp ult i32 [[CNT]], 2 + // CHECK: br i1 [[DONE_COPY]], label + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[IS_WARP_MASTER:%.+]] = icmp eq i32 [[LANEID]], 0 + // CHECK: br i1 [[IS_WARP_MASTER]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // [[DO_COPY]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[BASE_ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[ELT:%.+]] = getelementptr i32, i32* [[BASE_ELT]], i32 [[CNT]] + // + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[WARPID]] + // CHECK: [[ELT_VAL:%.+]] = load i32, i32* [[ELT]], + // CHECK: store volatile i32 [[ELT_VAL]], i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // Barrier after copy to shared memory storage medium. + // CHECK: [[COPY_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[ACTIVE_WARPS:%.+]] = load i32, i32* + // + // Read into warp 0. + // CHECK: [[IS_W0_ACTIVE_THREAD:%.+]] = icmp ult i32 [[TID:%.+]], [[ACTIVE_WARPS]] + // CHECK: br i1 [[IS_W0_ACTIVE_THREAD]], label {{%?}}[[DO_READ:.+]], label {{%?}}[[READ_ELSE:.+]] + // + // CHECK: [[DO_READ]] + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[TID]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT_BASE:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[ELT:%.+]] = getelementptr i32, i32* [[ELT_BASE]], i32 [[CNT]] + // CHECK: [[MEDIUM_ELT_VAL:%.+]] = load volatile i32, i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], + // CHECK: store i32 [[MEDIUM_ELT_VAL]], i32* [[ELT]], + // CHECK: br label {{%?}}[[READ_CONT:.+]] + // + // CHECK: [[READ_ELSE]] + // CHECK: br label {{%?}}[[READ_CONT]] + // + // CHECK: [[READ_CONT]] + // CHECK: [[NEXT:%.+]] = add nsw i32 [[CNT]], 1 + // CHECK: store i32 [[NEXT]], i32* [[CNT_ADDR]], + // CHECK: br label + // CHECK: ret + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [1 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM1_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to double* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM1_REDUCE_TY]], [[TEAM1_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x double], [{{1024|2048}} x double]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[LOC_RED1:%.+]] = load double, double* [[RL_RED1]], + // CHECK: store double [[LOC_RED1]], double* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: ret void + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [1 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM1_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM1_REDUCE_TY]], [[TEAM1_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x double], [{{1024|2048}} x double]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast double* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [1 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]]) + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [1 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM1_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to double* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM1_REDUCE_TY]], [[TEAM1_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x double], [{{1024|2048}} x double]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1:%.+]] = load double, double* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: store double [[GLOBAL_RED1]], double* [[RL_RED1]], + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [1 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM1_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM1_REDUCE_TY]], [[TEAM1_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x double], [{{1024|2048}} x double]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast double* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [1 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RL_BC]], i8* [[LOCAL_RL_BC]]) + // CHECK: ret void + + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l47}}_worker() - // CHECK: define {{.*}}void [[T2:@__omp_offloading_.+template.+l43]]( + // CHECK: define {{.*}}void [[T2:@__omp_offloading_.+template.+l47]]( // // CHECK: {{call|invoke}} void [[T2]]_worker() @@ -111,7 +354,13 @@ int bar(int n){ // CHECK: [[DV:%.+]] = load float, float* [[D]], align // CHECK: [[MUL:%.+]] = fmul float [[DV]], {{[0-9e\.\+]+}} // CHECK: store float [[MUL]], float* [[D]], align - // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_simple(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], [8 x i32]* [[LOCK:@.+]]) + // CHECK: [[GEP1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: store i8* [[C]], i8** [[GEP1]], + // CHECK: [[GEP2:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[BC:%.+]] = bitcast float* [[D]] to i8* + // CHECK: store i8* [[BC]], i8** [[GEP2]], + // CHECK: [[BC_RED_LIST:%.+]] = bitcast [2 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], i8* bitcast ([[TEAMS_REDUCE_UNION_TY]]* [[TEAMS_RED_BUFFER]] to i8*), i32 {{1024|2048}}, i8* [[BC_RED_LIST]], void (i8*, i16, i16, i16)* [[SHUFFLE_AND_REDUCE:@.+]], void (i8*, i32)* [[INTER_WARP_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_RED:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_COPY:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_RED:@.+]]) // CHECK: [[COND:%.+]] = icmp eq i32 [[RET]], 1 // CHECK: br i1 [[COND]], label {{%?}}[[IFLABEL:.+]], label {{%?}}[[EXIT:.+]] // @@ -127,25 +376,349 @@ int bar(int n){ // CHECK: [[DV:%.+]] = load float, float* [[D]], align // CHECK: [[MUL:%.+]] = fmul float [[D_INV]], [[DV]] // CHECK: store float [[MUL]], float* [[D_IN]], align - // CHECK: call void @__kmpc_nvptx_teams_end_reduce_nowait_simple(%struct.ident_t* [[LOC]], i32 [[GTID]], [8 x i32]* [[LOCK]]) + // CHECK: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[GTID]]) // CHECK: br label %[[EXIT]] // // CHECK: [[EXIT]] // CHECK: call void @__kmpc_kernel_deinit( - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l50}}( + // + // Reduction function + // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*) + // CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[VAR1_RHS:%.+]] = load i8*, i8** [[VAR1_RHS_REF]], + // + // CHECK: [[VAR1_LHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_LHS:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[VAR1_LHS:%.+]] = load i8*, i8** [[VAR1_LHS_REF]], + // + // CHECK: [[VAR2_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[VAR2_RHS_VOID:%.+]] = load i8*, i8** [[VAR2_RHS_REF]], + // CHECK: [[VAR2_RHS:%.+]] = bitcast i8* [[VAR2_RHS_VOID]] to float* + // + // CHECK: [[VAR2_LHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_LHS]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[VAR2_LHS_VOID:%.+]] = load i8*, i8** [[VAR2_LHS_REF]], + // CHECK: [[VAR2_LHS:%.+]] = bitcast i8* [[VAR2_LHS_VOID]] to float* + // + // CHECK: [[VAR1_LHS_VAL8:%.+]] = load i8, i8* [[VAR1_LHS]], + // CHECK: [[VAR1_LHS_VAL:%.+]] = sext i8 [[VAR1_LHS_VAL8]] to i32 + // CHECK: [[VAR1_RHS_VAL8:%.+]] = load i8, i8* [[VAR1_RHS]], + // CHECK: [[VAR1_RHS_VAL:%.+]] = sext i8 [[VAR1_RHS_VAL8]] to i32 + // CHECK: [[XOR:%.+]] = xor i32 [[VAR1_LHS_VAL]], [[VAR1_RHS_VAL]] + // CHECK: [[RES:%.+]] = trunc i32 [[XOR]] to i8 + // CHECK: store i8 [[RES]], i8* [[VAR1_LHS]], + // + // CHECK: [[VAR2_LHS_VAL:%.+]] = load float, float* [[VAR2_LHS]], + // CHECK: [[VAR2_RHS_VAL:%.+]] = load float, float* [[VAR2_RHS]], + // CHECK: [[RES:%.+]] = fmul float [[VAR2_LHS_VAL]], [[VAR2_RHS_VAL]] + // CHECK: store float [[RES]], float* [[VAR2_LHS]], + // CHECK: ret void + + // + // Shuffle and reduce function + // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}}) + // CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [2 x i8*], align + // CHECK: [[REMOTE_ELT1:%.+]] = alloca i8 + // CHECK: [[REMOTE_ELT2:%.+]] = alloca float + // + // CHECK: [[LANEID:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[LANEOFFSET:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[ALGVER:%.+]] = load i16, i16* {{.+}}, align + // + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VAL:%.+]] = load i8, i8* [[ELT_VOID]], align + // + // CHECK: [[ELT_CAST:%.+]] = sext i8 [[ELT_VAL]] to i32 + // CHECK: [[WS32:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() + // CHECK: [[WS:%.+]] = trunc i32 [[WS32]] to i16 + // CHECK: [[REMOTE_ELT1_VAL32:%.+]] = call i32 @__kmpc_shuffle_int32(i32 [[ELT_CAST]], i16 [[LANEOFFSET]], i16 [[WS]]) + // CHECK: [[REMOTE_ELT1_VAL:%.+]] = trunc i32 [[REMOTE_ELT1_VAL32]] to i8 + // + // CHECK: store i8 [[REMOTE_ELT1_VAL]], i8* [[REMOTE_ELT1]], align + // CHECK: store i8* [[REMOTE_ELT1]], i8** [[REMOTE_ELT_REF]], align + // + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to float* + // + // CHECK: [[ELT_CAST:%.+]] = bitcast float* [[ELT]] to i32* + // CHECK: [[REMOTE_ELT2_CAST:%.+]] = bitcast float* [[REMOTE_ELT2]] to i32* + // CHECK: [[ELT_VAL:%.+]] = load i32, i32* [[ELT_CAST]], align + // CHECK: [[WS32:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() + // CHECK: [[WS:%.+]] = trunc i32 [[WS32]] to i16 + // CHECK: [[REMOTE_ELT2_VAL32:%.+]] = call i32 @__kmpc_shuffle_int32(i32 [[ELT_VAL]], i16 [[LANEOFFSET]], i16 [[WS]]) + // + // CHECK: store i32 [[REMOTE_ELT2_VAL32]], i32* [[REMOTE_ELT2_CAST]], align + // CHECK: [[REMOTE_ELT2C:%.+]] = bitcast float* [[REMOTE_ELT2]] to i8* + // CHECK: store i8* [[REMOTE_ELT2C]], i8** [[REMOTE_ELT_REF]], align + // + // Condition to reduce + // CHECK: [[CONDALG0:%.+]] = icmp eq i16 [[ALGVER]], 0 + // + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp ult i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[CONDALG1:%.+]] = and i1 [[COND1]], [[COND2]] + // + // CHECK: [[COND3:%.+]] = icmp eq i16 [[ALGVER]], 2 + // CHECK: [[COND4:%.+]] = and i16 [[LANEID]], 1 + // CHECK: [[COND5:%.+]] = icmp eq i16 [[COND4]], 0 + // CHECK: [[COND6:%.+]] = and i1 [[COND3]], [[COND5]] + // CHECK: [[COND7:%.+]] = icmp sgt i16 [[LANEOFFSET]], 0 + // CHECK: [[CONDALG2:%.+]] = and i1 [[COND6]], [[COND7]] + // + // CHECK: [[COND8:%.+]] = or i1 [[CONDALG0]], [[CONDALG1]] + // CHECK: [[SHOULD_REDUCE:%.+]] = or i1 [[COND8]], [[CONDALG2]] + // CHECK: br i1 [[SHOULD_REDUCE]], label {{%?}}[[DO_REDUCE:.+]], label {{%?}}[[REDUCE_ELSE:.+]] + // + // CHECK: [[DO_REDUCE]] + // CHECK: [[RED_LIST1_VOID:%.+]] = bitcast [2 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RED_LIST2_VOID:%.+]] = bitcast [2 x i8*]* [[REMOTE_RED_LIST]] to i8* + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RED_LIST1_VOID]], i8* [[RED_LIST2_VOID]]) + // CHECK: br label {{%?}}[[REDUCE_CONT:.+]] + // + // CHECK: [[REDUCE_ELSE]] + // CHECK: br label {{%?}}[[REDUCE_CONT]] + // + // CHECK: [[REDUCE_CONT]] + // Now check if we should just copy over the remote reduction list + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp uge i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[SHOULD_COPY:%.+]] = and i1 [[COND1]], [[COND2]] + // CHECK: br i1 [[SHOULD_COPY]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // CHECK: [[DO_COPY]] + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[REMOTE_ELT_VOID:%.+]] = load i8*, i8** [[REMOTE_ELT_REF]], + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_VAL:%.+]] = load i8, i8* [[REMOTE_ELT_VOID]], align + // CHECK: store i8 [[REMOTE_ELT_VAL]], i8* [[ELT_VOID]], align + // + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[REMOTE_ELT_VOID:%.+]] = load i8*, i8** [[REMOTE_ELT_REF]], + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT:%.+]] = bitcast i8* [[REMOTE_ELT_VOID]] to float* + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to float* + // CHECK: [[REMOTE_ELT_VAL:%.+]] = load float, float* [[REMOTE_ELT]], align + // CHECK: store float [[REMOTE_ELT_VAL]], float* [[ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // CHECK: [[COPY_CONT]] + // CHECK: void + + // + // Inter warp copy function + // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32) + // CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31 + // CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5 + // CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [2 x i8*]* + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[IS_WARP_MASTER:%.+]] = icmp eq i32 [[LANEID]], 0 + // CHECK: br i1 [[IS_WARP_MASTER]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // [[DO_COPY]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // + // CHECK: [[MEDIUM_ELT64:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[WARPID]] + // CHECK: [[MEDIUM_ELT:%.+]] = bitcast i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT64]] to i8 addrspace([[SHARED_ADDRSPACE]])* + // CHECK: [[ELT_VAL:%.+]] = load i8, i8* [[ELT_VOID]], align + // CHECK: store volatile i8 [[ELT_VAL]], i8 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // Barrier after copy to shared memory storage medium. + // CHECK: [[COPY_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[ACTIVE_WARPS:%.+]] = load i32, i32* + // + // Read into warp 0. + // CHECK: [[IS_W0_ACTIVE_THREAD:%.+]] = icmp ult i32 [[TID:%.+]], [[ACTIVE_WARPS]] + // CHECK: br i1 [[IS_W0_ACTIVE_THREAD]], label {{%?}}[[DO_READ:.+]], label {{%?}}[[READ_ELSE:.+]] + // + // CHECK: [[DO_READ]] + // CHECK: [[MEDIUM_ELT32:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[TID]] + // CHECK: [[MEDIUM_ELT:%.+]] = bitcast i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT32]] to i8 addrspace([[SHARED_ADDRSPACE]])* + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[MEDIUM_ELT_VAL:%.+]] = load volatile i8, i8 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: store i8 [[MEDIUM_ELT_VAL]], i8* [[ELT_VOID]], align + // CHECK: br label {{%?}}[[READ_CONT:.+]] + // + // CHECK: [[READ_ELSE]] + // CHECK: br label {{%?}}[[READ_CONT]] + // + // CHECK: [[READ_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[IS_WARP_MASTER:%.+]] = icmp eq i32 [[LANEID]], 0 + // CHECK: br i1 [[IS_WARP_MASTER]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // [[DO_COPY]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[WARPID]] + // CHECK: [[ELT_VAL:%.+]] = load i32, i32* [[ELT]], align + // CHECK: store volatile i32 [[ELT_VAL]], i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // Barrier after copy to shared memory storage medium. + // CHECK: [[COPY_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[ACTIVE_WARPS:%.+]] = load i32, i32* + // + // Read into warp 0. + // CHECK: [[IS_W0_ACTIVE_THREAD:%.+]] = icmp ult i32 [[TID:%.+]], [[ACTIVE_WARPS]] + // CHECK: br i1 [[IS_W0_ACTIVE_THREAD]], label {{%?}}[[DO_READ:.+]], label {{%?}}[[READ_ELSE:.+]] + // + // CHECK: [[DO_READ]] + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[TID]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[MEDIUM_ELT_VAL:%.+]] = load volatile i32, i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: store i32 [[MEDIUM_ELT_VAL]], i32* [[ELT]], align + // CHECK: br label {{%?}}[[READ_CONT:.+]] + // + // CHECK: [[READ_ELSE]] + // CHECK: br label {{%?}}[[READ_CONT]] + // + // CHECK: [[READ_CONT]] + // CHECK: ret + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [2 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM2_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i8], [{{1024|2048}} x i8]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[LOC_RED1:%.+]] = load i8, i8* [[RL_RED1]], + // CHECK: store i8 [[LOC_RED1]], i8* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to float* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x float], [{{1024|2048}} x float]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[LOC_RED1:%.+]] = load float, float* [[RL_RED1]], + // CHECK: store float [[LOC_RED1]], float* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: ret void + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [2 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM2_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i8], [{{1024|2048}} x i8]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x float], [{{1024|2048}} x float]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast float* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [2 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]]) + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [2 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM2_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i8], [{{1024|2048}} x i8]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1:%.+]] = load i8, i8* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: store i8 [[GLOBAL_RED1]], i8* [[RL_RED1]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to float* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x float], [{{1024|2048}} x float]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1:%.+]] = load float, float* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: store float [[GLOBAL_RED1]], float* [[RL_RED1]], + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [2 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM2_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i8], [{{1024|2048}} x i8]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM2_REDUCE_TY]], [[TEAM2_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x float], [{{1024|2048}} x float]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast float* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [2 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RL_BC]], i8* [[LOCAL_RL_BC]]) + // CHECK: ret void + + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l54}}( // // CHECK: call void @__kmpc_spmd_kernel_init( // CHECK: call void @__kmpc_data_sharing_init_stack_spmd() - // CHECK: call void @__kmpc_get_team_static_memory(i16 1, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds ([[MEM_TY:%.+]], %{{.+}} addrspace(3)* [[KERNEL_RD:@.+]], i32 0, i32 0, i32 0) to i8*), i{{64|32}} {{8|16}}, i16 1, i8** addrspacecast (i8* addrspace(3)* [[KERNEL_PTR:@.+]] to i8**)) - // CHECK: [[PTR:%.+]] = load i8*, i8* addrspace(3)* [[KERNEL_PTR]], - // CHECK: [[GLOBAL_REC:%.+]] = bitcast i8* [[PTR]] to [[GLOB_REC_TY:%.+]]* - // CHECK-DAG: [[A_ADDR:%.+]] = getelementptr inbounds [[GLOB_REC_TY]], [[GLOB_REC_TY]]* [[GLOBAL_REC]], i32 0, i32 0 - // CHECK-DAG: [[B_ADDR:%.+]] = getelementptr inbounds [[GLOB_REC_TY]], [[GLOB_REC_TY]]* [[GLOBAL_REC]], i32 0, i32 1 - // CHECK: store i32 0, i32* [[A_ADDR]], - // CHECK: store i16 -32768, i16* [[B_ADDR]], + // CHECK-NOT: call void @__kmpc_get_team_static_memory + // CHECK: store i32 0, + // CHECK: store i32 0, i32* [[A_ADDR:%.+]], align + // CHECK: store i16 -32768, i16* [[B_ADDR:%.+]], align // CHECK: call void [[OUTLINED:@.+]](i32* {{.+}}, i32* {{.+}}, i32* [[A_ADDR]], i16* [[B_ADDR]]) - // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_simple(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], [8 x i32]* [[LOCK:@.+]]) + // CHECK: [[GEP1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[BC:%.+]] = bitcast i32* [[A_ADDR]] to i8* + // CHECK: store i8* [[BC]], i8** [[GEP1]], + // CHECK: [[GEP2:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[BC:%.+]] = bitcast i16* [[B_ADDR]] to i8* + // CHECK: store i8* [[BC]], i8** [[GEP2]], + // CHECK: [[BC_RED_LIST:%.+]] = bitcast [2 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RET:%.+]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* [[LOC:@.+]], i32 [[GTID:%.+]], i8* bitcast ([[TEAMS_REDUCE_UNION_TY]]* [[TEAMS_RED_BUFFER]] to i8*), i32 {{1024|2048}}, i8* [[BC_RED_LIST]], void (i8*, i16, i16, i16)* [[SHUFFLE_AND_REDUCE:@.+]], void (i8*, i32)* [[INTER_WARP_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_COPY:@.+]], void (i8*, i32, i8*)* [[RED_LIST_TO_GLOBAL_RED:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_COPY:@.+]], void (i8*, i32, i8*)* [[GLOBAL_TO_RED_LIST_RED:@.+]]) // CHECK: [[COND:%.+]] = icmp eq i32 [[RET]], 1 // CHECK: br i1 [[COND]], label {{%?}}[[IFLABEL:.+]], label {{%?}}[[EXIT:.+]] // @@ -172,11 +745,10 @@ int bar(int n){ // CHECK: [[MAX_CONT]] // CHECK: [[B_MAX:%.+]] = phi i16 [ [[MAX1]], %[[DO_MAX]] ], [ [[MAX2]], %[[MAX_ELSE]] ] // CHECK: store i16 [[B_MAX]], i16* [[B_IN]], align - // CHECK: call void @__kmpc_nvptx_teams_end_reduce_nowait_simple(%struct.ident_t* [[LOC]], i32 [[GTID]], [8 x i32]* [[LOCK]]) + // CHECK: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[GTID]]) // CHECK: br label %[[EXIT]] // // CHECK: [[EXIT]] - // CHECK: call void @__kmpc_restore_team_static_memory(i16 1, i16 1) // CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: define internal void [[OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable{{.+}}, i16* dereferenceable{{.+}}) @@ -475,4 +1047,346 @@ int bar(int n){ // CHECK: [[READ_CONT]] // CHECK: ret + // + // Reduction function + // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*) + // CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS:%.+]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[VAR1_RHS_VOID:%.+]] = load i8*, i8** [[VAR1_RHS_REF]], + // CHECK: [[VAR1_RHS:%.+]] = bitcast i8* [[VAR1_RHS_VOID]] to i32* + // + // CHECK: [[VAR1_LHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_LHS:%.+]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[VAR1_LHS_VOID:%.+]] = load i8*, i8** [[VAR1_LHS_REF]], + // CHECK: [[VAR1_LHS:%.+]] = bitcast i8* [[VAR1_LHS_VOID]] to i32* + // + // CHECK: [[VAR2_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[VAR2_RHS_VOID:%.+]] = load i8*, i8** [[VAR2_RHS_REF]], + // CHECK: [[VAR2_RHS:%.+]] = bitcast i8* [[VAR2_RHS_VOID]] to i16* + // + // CHECK: [[VAR2_LHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_LHS]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[VAR2_LHS_VOID:%.+]] = load i8*, i8** [[VAR2_LHS_REF]], + // CHECK: [[VAR2_LHS:%.+]] = bitcast i8* [[VAR2_LHS_VOID]] to i16* + // + // CHECK: [[VAR1_LHS_VAL:%.+]] = load i32, i32* [[VAR1_LHS]], + // CHECK: [[VAR1_RHS_VAL:%.+]] = load i32, i32* [[VAR1_RHS]], + // CHECK: [[OR:%.+]] = or i32 [[VAR1_LHS_VAL]], [[VAR1_RHS_VAL]] + // CHECK: store i32 [[OR]], i32* [[VAR1_LHS]], + // + // CHECK: [[VAR2_LHS_VAL16:%.+]] = load i16, i16* [[VAR2_LHS]], + // CHECK: [[VAR2_LHS_VAL:%.+]] = sext i16 [[VAR2_LHS_VAL16]] to i32 + // CHECK: [[VAR2_RHS_VAL16:%.+]] = load i16, i16* [[VAR2_RHS]], + // CHECK: [[VAR2_RHS_VAL:%.+]] = sext i16 [[VAR2_RHS_VAL16]] to i32 + // + // CHECK: [[CMP:%.+]] = icmp sgt i32 [[VAR2_LHS_VAL]], [[VAR2_RHS_VAL]] + // CHECK: br i1 [[CMP]], label {{%?}}[[DO_MAX:.+]], label {{%?}}[[MAX_ELSE:.+]] + // + // CHECK: [[DO_MAX]] + // CHECK: [[MAX1:%.+]] = load i16, i16* [[VAR2_LHS]], align + // CHECK: br label {{%?}}[[MAX_CONT:.+]] + // + // CHECK: [[MAX_ELSE]] + // CHECK: [[MAX2:%.+]] = load i16, i16* [[VAR2_RHS]], align + // CHECK: br label {{%?}}[[MAX_CONT]] + // + // CHECK: [[MAX_CONT]] + // CHECK: [[MAXV:%.+]] = phi i16 [ [[MAX1]], %[[DO_MAX]] ], [ [[MAX2]], %[[MAX_ELSE]] ] + // CHECK: store i16 [[MAXV]], i16* [[VAR2_LHS]], + // CHECK: ret void + + // + // Shuffle and reduce function + // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}}) + // CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [2 x i8*], align + // CHECK: [[REMOTE_ELT1:%.+]] = alloca i32 + // CHECK: [[REMOTE_ELT2:%.+]] = alloca i16 + // + // CHECK: [[LANEID:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[LANEOFFSET:%.+]] = load i16, i16* {{.+}}, align + // CHECK: [[ALGVER:%.+]] = load i16, i16* {{.+}}, align + // + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST:%.+]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST:%.+]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[ELT_VAL:%.+]] = load i32, i32* [[ELT]], align + // + // CHECK: [[WS32:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() + // CHECK: [[WS:%.+]] = trunc i32 [[WS32]] to i16 + // CHECK: [[REMOTE_ELT1_VAL:%.+]] = call i32 @__kmpc_shuffle_int32(i32 [[ELT_VAL]], i16 [[LANEOFFSET]], i16 [[WS]]) + // + // CHECK: store i32 [[REMOTE_ELT1_VAL]], i32* [[REMOTE_ELT1]], align + // CHECK: [[REMOTE_ELT1C:%.+]] = bitcast i32* [[REMOTE_ELT1]] to i8* + // CHECK: store i8* [[REMOTE_ELT1C]], i8** [[REMOTE_ELT_REF]], align + // + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i16* + // CHECK: [[ELT_VAL:%.+]] = load i16, i16* [[ELT]], align + // + // CHECK: [[ELT_CAST:%.+]] = sext i16 [[ELT_VAL]] to i32 + // CHECK: [[WS32:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() + // CHECK: [[WS:%.+]] = trunc i32 [[WS32]] to i16 + // CHECK: [[REMOTE_ELT2_VAL32:%.+]] = call i32 @__kmpc_shuffle_int32(i32 [[ELT_CAST]], i16 [[LANEOFFSET]], i16 [[WS]]) + // CHECK: [[REMOTE_ELT2_VAL:%.+]] = trunc i32 [[REMOTE_ELT2_VAL32]] to i16 + // + // CHECK: store i16 [[REMOTE_ELT2_VAL]], i16* [[REMOTE_ELT2]], align + // CHECK: [[REMOTE_ELT2C:%.+]] = bitcast i16* [[REMOTE_ELT2]] to i8* + // CHECK: store i8* [[REMOTE_ELT2C]], i8** [[REMOTE_ELT_REF]], align + // + // Condition to reduce + // CHECK: [[CONDALG0:%.+]] = icmp eq i16 [[ALGVER]], 0 + // + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp ult i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[CONDALG1:%.+]] = and i1 [[COND1]], [[COND2]] + // + // CHECK: [[COND3:%.+]] = icmp eq i16 [[ALGVER]], 2 + // CHECK: [[COND4:%.+]] = and i16 [[LANEID]], 1 + // CHECK: [[COND5:%.+]] = icmp eq i16 [[COND4]], 0 + // CHECK: [[COND6:%.+]] = and i1 [[COND3]], [[COND5]] + // CHECK: [[COND7:%.+]] = icmp sgt i16 [[LANEOFFSET]], 0 + // CHECK: [[CONDALG2:%.+]] = and i1 [[COND6]], [[COND7]] + // + // CHECK: [[COND8:%.+]] = or i1 [[CONDALG0]], [[CONDALG1]] + // CHECK: [[SHOULD_REDUCE:%.+]] = or i1 [[COND8]], [[CONDALG2]] + // CHECK: br i1 [[SHOULD_REDUCE]], label {{%?}}[[DO_REDUCE:.+]], label {{%?}}[[REDUCE_ELSE:.+]] + // + // CHECK: [[DO_REDUCE]] + // CHECK: [[RED_LIST1_VOID:%.+]] = bitcast [2 x i8*]* [[RED_LIST]] to i8* + // CHECK: [[RED_LIST2_VOID:%.+]] = bitcast [2 x i8*]* [[REMOTE_RED_LIST]] to i8* + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RED_LIST1_VOID]], i8* [[RED_LIST2_VOID]]) + // CHECK: br label {{%?}}[[REDUCE_CONT:.+]] + // + // CHECK: [[REDUCE_ELSE]] + // CHECK: br label {{%?}}[[REDUCE_CONT]] + // + // CHECK: [[REDUCE_CONT]] + // Now check if we should just copy over the remote reduction list + // CHECK: [[COND1:%.+]] = icmp eq i16 [[ALGVER]], 1 + // CHECK: [[COND2:%.+]] = icmp uge i16 [[LANEID]], [[LANEOFFSET]] + // CHECK: [[SHOULD_COPY:%.+]] = and i1 [[COND1]], [[COND2]] + // CHECK: br i1 [[SHOULD_COPY]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // CHECK: [[DO_COPY]] + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[REMOTE_ELT_VOID:%.+]] = load i8*, i8** [[REMOTE_ELT_REF]], + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i[[SZ]] 0, i[[SZ]] 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT:%.+]] = bitcast i8* [[REMOTE_ELT_VOID]] to i32* + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[REMOTE_ELT_VAL:%.+]] = load i32, i32* [[REMOTE_ELT]], align + // CHECK: store i32 [[REMOTE_ELT_VAL]], i32* [[ELT]], align + // + // CHECK: [[REMOTE_ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[REMOTE_RED_LIST]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[REMOTE_ELT_VOID:%.+]] = load i8*, i8** [[REMOTE_ELT_REF]], + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST]], i[[SZ]] 0, i[[SZ]] 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[REMOTE_ELT:%.+]] = bitcast i8* [[REMOTE_ELT_VOID]] to i16* + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i16* + // CHECK: [[REMOTE_ELT_VAL:%.+]] = load i16, i16* [[REMOTE_ELT]], align + // CHECK: store i16 [[REMOTE_ELT_VAL]], i16* [[ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // CHECK: [[COPY_CONT]] + // CHECK: void + + // + // Inter warp copy function + // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32) + // CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31 + // CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5 + // CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]* + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[IS_WARP_MASTER:%.+]] = icmp eq i32 [[LANEID]], 0 + // CHECK: br i1 [[IS_WARP_MASTER]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // [[DO_COPY]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[WARPID]] + // CHECK: [[ELT_VAL:%.+]] = load i32, i32* [[ELT]], align + // CHECK: store volatile i32 [[ELT_VAL]], i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // Barrier after copy to shared memory storage medium. + // CHECK: [[COPY_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[ACTIVE_WARPS:%.+]] = load i32, i32* + // + // Read into warp 0. + // CHECK: [[IS_W0_ACTIVE_THREAD:%.+]] = icmp ult i32 [[TID:%.+]], [[ACTIVE_WARPS]] + // CHECK: br i1 [[IS_W0_ACTIVE_THREAD]], label {{%?}}[[DO_READ:.+]], label {{%?}}[[READ_ELSE:.+]] + // + // CHECK: [[DO_READ]] + // CHECK: [[MEDIUM_ELT:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[TID]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 0 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i32* + // CHECK: [[MEDIUM_ELT_VAL:%.+]] = load volatile i32, i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: store i32 [[MEDIUM_ELT_VAL]], i32* [[ELT]], align + // CHECK: br label {{%?}}[[READ_CONT:.+]] + // + // CHECK: [[READ_ELSE]] + // CHECK: br label {{%?}}[[READ_CONT]] + // + // CHECK: [[READ_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[IS_WARP_MASTER:%.+]] = icmp eq i32 [[LANEID]], 0 + // CHECK: br i1 [[IS_WARP_MASTER]], label {{%?}}[[DO_COPY:.+]], label {{%?}}[[COPY_ELSE:.+]] + // + // [[DO_COPY]] + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i16* + // + // CHECK: [[MEDIUM_ELT32:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[WARPID]] + // CHECK: [[MEDIUM_ELT:%.+]] = bitcast i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT32]] to i16 addrspace([[SHARED_ADDRSPACE]])* + // CHECK: [[ELT_VAL:%.+]] = load i16, i16* [[ELT]], align + // CHECK: store volatile i16 [[ELT_VAL]], i16 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: br label {{%?}}[[COPY_CONT:.+]] + // + // CHECK: [[COPY_ELSE]] + // CHECK: br label {{%?}}[[COPY_CONT]] + // + // Barrier after copy to shared memory storage medium. + // CHECK: [[COPY_CONT]] + // CHECK: call void @__kmpc_barrier(%struct.ident_t* @ + // CHECK: [[ACTIVE_WARPS:%.+]] = load i32, i32* + // + // Read into warp 0. + // CHECK: [[IS_W0_ACTIVE_THREAD:%.+]] = icmp ult i32 [[TID:%.+]], [[ACTIVE_WARPS]] + // CHECK: br i1 [[IS_W0_ACTIVE_THREAD]], label {{%?}}[[DO_READ:.+]], label {{%?}}[[READ_ELSE:.+]] + // + // CHECK: [[DO_READ]] + // CHECK: [[MEDIUM_ELT32:%.+]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace([[SHARED_ADDRSPACE]])* [[TRANSFER_STORAGE]], i64 0, i32 [[TID]] + // CHECK: [[MEDIUM_ELT:%.+]] = bitcast i32 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT32]] to i16 addrspace([[SHARED_ADDRSPACE]])* + // CHECK: [[ELT_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST:%.+]], i{{32|64}} 0, i{{32|64}} 1 + // CHECK: [[ELT_VOID:%.+]] = load i8*, i8** [[ELT_REF]], + // CHECK: [[ELT:%.+]] = bitcast i8* [[ELT_VOID]] to i16* + // CHECK: [[MEDIUM_ELT_VAL:%.+]] = load volatile i16, i16 addrspace([[SHARED_ADDRSPACE]])* [[MEDIUM_ELT]], align + // CHECK: store i16 [[MEDIUM_ELT_VAL]], i16* [[ELT]], align + // CHECK: br label {{%?}}[[READ_CONT:.+]] + // + // CHECK: [[READ_ELSE]] + // CHECK: br label {{%?}}[[READ_CONT]] + // + // CHECK: [[READ_CONT]] + // CHECK: ret + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [2 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM3_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to i32* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i32], [{{1024|2048}} x i32]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[LOC_RED1:%.+]] = load i32, i32* [[RL_RED1]], + // CHECK: store i32 [[LOC_RED1]], i32* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to i16* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i16], [{{1024|2048}} x i16]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[LOC_RED1:%.+]] = load i16, i16* [[RL_RED1]], + // CHECK: store i16 [[LOC_RED1]], i16* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: ret void + + // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [2 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM3_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i32], [{{1024|2048}} x i32]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast i32* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i16], [{{1024|2048}} x i16]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast i16* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [2 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]]) + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: [[RL:%.+]] = bitcast i8* [[RL_BC]] to [2 x i8*]* + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM3_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to i32* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i32], [{{1024|2048}} x i32]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1:%.+]] = load i32, i32* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: store i32 [[GLOBAL_RED1]], i32* [[RL_RED1]], + // CHECK: [[RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[RL_RED1_BC:%.+]] = load i8*, i8** [[RL_RED1_PTR]], + // CHECK: [[RL_RED1:%.+]] = bitcast i8* [[RL_RED1_BC]] to i16* + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i16], [{{1024|2048}} x i16]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1:%.+]] = load i16, i16* [[GLOBAL_RED1_IDX_PTR]], + // CHECK: store i16 [[GLOBAL_RED1]], i16* [[RL_RED1]], + // CHECK: ret void + + // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*) + // CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*, + // CHECK: [[IDX_PTR:%.+]] = alloca i32, + // CHECK: [[RL_PTR:%.+]] = alloca i8*, + // CHECK: [[LOCAL_RL:%.+]] = alloca [2 x i8*], + // CHECK: store i8* %{{.+}}, i8** [[GLOBAL_PTR]], + // CHECK: store i32 %{{.+}}, i32* [[IDX_PTR]], + // CHECK: store i8* %{{.+}}, i8** [[RL_PTR]], + // CHECK: [[GLOBAL_BC:%.+]] = load i8*, i8** [[GLOBAL_PTR]], + // CHECK: [[GLOBAL:%.+]] = bitcast i8* [[GLOBAL_BC]] to [[TEAM3_REDUCE_TY]]* + // CHECK: [[IDX:%.+]] = load i32, i32* [[IDX_PTR]], + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i32], [{{1024|2048}} x i32]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast i32* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_RED1_PTR:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[LOCAL_RL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_PTR:%.+]] = getelementptr inbounds [[TEAM3_REDUCE_TY]], [[TEAM3_REDUCE_TY]]* [[GLOBAL]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[GLOBAL_RED1_IDX_PTR:%.+]] = getelementptr inbounds [{{1024|2048}} x i16], [{{1024|2048}} x i16]* [[GLOBAL_RED1_PTR]], i{{[0-9]+}} 0, i32 [[IDX]] + // CHECK: [[GLOBAL_RED1_IDX_PTR_BC:%.+]] = bitcast i16* [[GLOBAL_RED1_IDX_PTR]] to i8* + // CHECK: store i8* [[GLOBAL_RED1_IDX_PTR_BC]], i8** [[LOCAL_RL_RED1_PTR]] + // CHECK: [[LOCAL_RL_BC:%.+]] = bitcast [2 x i8*]* [[LOCAL_RL]] to i8* + // CHECK: [[RL_BC:%.+]] = load i8*, i8** [[RL_PTR]], + // CHECK: call void [[REDUCTION_FUNC]](i8* [[RL_BC]], i8* [[LOCAL_RL_BC]]) + // CHECK: ret void + #endif -- cgit v1.2.3 From 771c454fcb9a98b83da46bd29eb4cd090092b5da Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 20 Feb 2019 17:42:57 +0000 Subject: [OPENMP] Delay emission of the asm target-specific error messages. Summary: Added the ability to emit target-specific builtin assembler error messages only in case if the function is really is going to be emitted for the device. Reviewers: rjmccall Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58243 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354486 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_asm_delayed_diags.c | 118 ++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 test/OpenMP/nvptx_asm_delayed_diags.c (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_asm_delayed_diags.c b/test/OpenMP/nvptx_asm_delayed_diags.c new file mode 100644 index 0000000000..b3adc8ea00 --- /dev/null +++ b/test/OpenMP/nvptx_asm_delayed_diags.c @@ -0,0 +1,118 @@ +// RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc +// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// REQUIRES: x86-registered-target +// REQUIRES: nvptx-registered-target + +#ifndef DIAGS +// expected-no-diagnostics +#endif // DIAGS + +#ifdef IMMEDIATE +#pragma omp declare target +#endif //IMMEDIATE +void t1(int r) { +#ifdef DIAGS +// expected-error@+4 {{invalid input constraint 'mx' in asm}} +#endif // DIAGS + __asm__("PR3908 %[lf] %[xx] %[li] %[r]" + : [ r ] "+r"(r) + : [ lf ] "mx"(0), [ li ] "mr"(0), [ xx ] "x"((double)(0))); +} + +unsigned t2(signed char input) { + unsigned output; +#ifdef DIAGS +// expected-error@+3 {{invalid output constraint '=a' in asm}} +#endif // DIAGS + __asm__("xyz" + : "=a"(output) + : "0"(input)); + return output; +} + +double t3(double x) { + register long double result; +#ifdef DIAGS +// expected-error@+3 {{invalid output constraint '=t' in asm}} +#endif // DIAGS + __asm __volatile("frndint" + : "=t"(result) + : "0"(x)); + return result; +} + +unsigned char t4(unsigned char a, unsigned char b) { + unsigned int la = a; + unsigned int lb = b; + unsigned int bigres; + unsigned char res; +#ifdef DIAGS +// expected-error@+3 {{invalid output constraint '=la' in asm}} +#endif // DIAGS + __asm__("0:\n1:\n" + : [ bigres ] "=la"(bigres) + : [ la ] "0"(la), [ lb ] "c"(lb) + : "edx", "cc"); + res = bigres; + return res; +} + +void t5(void) { +#ifdef DIAGS +// expected-error@+6 {{unknown register name 'st' in asm}} +#endif // DIAGS + __asm__ __volatile__( + "finit" + : + : + : "st", "st(1)", "st(2)", "st(3)", + "st(4)", "st(5)", "st(6)", "st(7)", + "fpsr", "fpcr"); +} + +typedef long long __m256i __attribute__((__vector_size__(32))); +void t6(__m256i *p) { +#ifdef DIAGS +// expected-error@+3 {{unknown register name 'ymm0' in asm}} +#endif // DIAGS + __asm__ volatile("vmovaps %0, %%ymm0" ::"m"(*(__m256i *)p) + : "ymm0"); +} +#ifdef IMMEDIATE +#pragma omp end declare target +#endif //IMMEDIATE + +int main() { +#ifdef DELAYED +#pragma omp target +#endif // DELAYED + { +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t1(0); +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t2(0); +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t3(0); +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t4(0, 0); +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t5(); +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t6(0); + } + return 0; +} -- cgit v1.2.3 From 6bd887f482ae1b3fd74f7c949aab7a3888fefe03 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Feb 2019 16:49:13 +0000 Subject: [OPENMP] Delayed diagnostics for VLA support. Generalized processing of the deferred diagnostics for OpenMP/CUDA code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354679 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_vla_messages.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_vla_messages.cpp b/test/OpenMP/target_vla_messages.cpp index b744081e98..30a2751724 100644 --- a/test/OpenMP/target_vla_messages.cpp +++ b/test/OpenMP/target_vla_messages.cpp @@ -47,7 +47,7 @@ void target_template(int arg) { #pragma omp target { #ifdef NO_VLA - // expected-error@+2 {{variable length arrays are not supported for the current target}} + // expected-error@+2 2 {{variable length arrays are not supported for the current target}} #endif T vla[arg]; } @@ -73,6 +73,9 @@ void target(int arg) { } } +#ifdef NO_VLA + // expected-note@+2 {{in instantiation of function template specialization 'target_template' requested here}} +#endif target_template(arg); } -- cgit v1.2.3 From e8de81fa9ab388e01151bb232a5c35a8a30d32a2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Feb 2019 17:16:50 +0000 Subject: Revert "[OPENMP] Delayed diagnostics for VLA support." This reverts commit r354679 to fix the problem with the Windows buildbots git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354680 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_vla_messages.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_vla_messages.cpp b/test/OpenMP/target_vla_messages.cpp index 30a2751724..b744081e98 100644 --- a/test/OpenMP/target_vla_messages.cpp +++ b/test/OpenMP/target_vla_messages.cpp @@ -47,7 +47,7 @@ void target_template(int arg) { #pragma omp target { #ifdef NO_VLA - // expected-error@+2 2 {{variable length arrays are not supported for the current target}} + // expected-error@+2 {{variable length arrays are not supported for the current target}} #endif T vla[arg]; } @@ -73,9 +73,6 @@ void target(int arg) { } } -#ifdef NO_VLA - // expected-note@+2 {{in instantiation of function template specialization 'target_template' requested here}} -#endif target_template(arg); } -- cgit v1.2.3 From a41469a23c44af02ae43941e9534ebc5b3dde54b Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Feb 2019 20:36:10 +0000 Subject: [OPENMP] Delayed diagnostics for VLA support. Generalized processing of the deferred diagnostics for OpenMP/CUDA code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354690 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_vla_messages.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_vla_messages.cpp b/test/OpenMP/target_vla_messages.cpp index b744081e98..30a2751724 100644 --- a/test/OpenMP/target_vla_messages.cpp +++ b/test/OpenMP/target_vla_messages.cpp @@ -47,7 +47,7 @@ void target_template(int arg) { #pragma omp target { #ifdef NO_VLA - // expected-error@+2 {{variable length arrays are not supported for the current target}} + // expected-error@+2 2 {{variable length arrays are not supported for the current target}} #endif T vla[arg]; } @@ -73,6 +73,9 @@ void target(int arg) { } } +#ifdef NO_VLA + // expected-note@+2 {{in instantiation of function template specialization 'target_template' requested here}} +#endif target_template(arg); } -- cgit v1.2.3 From 8130704f582967dffaa0e99c1fe23889c2b6a0ba Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 22 Feb 2019 22:29:42 +0000 Subject: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier. This patch implements the parsing and sema support for OpenMP to clause with potential user-defined mappers attached. User defined mapper is a new feature in OpenMP 5.0. A to/from clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update to(mapper(id): ss) // use the mapper with name 'id' to map ss to device Contributed-by: Differential Revision: https://reviews.llvm.org/D58523 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354698 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_mapper_ast_print.c | 2 ++ test/OpenMP/declare_mapper_ast_print.cpp | 12 ++++++++++++ test/OpenMP/declare_mapper_codegen.cpp | 21 +++++++++++++++++---- test/OpenMP/declare_mapper_messages.c | 10 +++++++++- test/OpenMP/declare_mapper_messages.cpp | 19 ++++++++++++++++--- 5 files changed, 56 insertions(+), 8 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_mapper_ast_print.c b/test/OpenMP/declare_mapper_ast_print.c index 6023fc5f17..f053044a09 100644 --- a/test/OpenMP/declare_mapper_ast_print.c +++ b/test/OpenMP/declare_mapper_ast_print.c @@ -48,6 +48,8 @@ int main() { #pragma omp target map(mapper(default), from: dd[0:10]) // CHECK: #pragma omp target map(mapper(default),from: dd[0:10]) { dd[0].i++; } +#pragma omp target update to(mapper(id): vv) +// CHECK: #pragma omp target update to(mapper(id): vv) } return 0; } diff --git a/test/OpenMP/declare_mapper_ast_print.cpp b/test/OpenMP/declare_mapper_ast_print.cpp index c6baec3971..1e05fe5469 100644 --- a/test/OpenMP/declare_mapper_ast_print.cpp +++ b/test/OpenMP/declare_mapper_ast_print.cpp @@ -81,6 +81,8 @@ T foo(T a) { { fd.a++; } #pragma omp target map(mapper(idd) alloc: fd.b) { fd.b.k++; } +#pragma omp target update to(mapper(id): fd) +#pragma omp target update to(mapper(idd): fd.b) return 0; } @@ -93,6 +95,8 @@ T foo(T a) { // CHECK: } // CHECK: #pragma omp target map(mapper(id),alloc: fd) // CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) +// CHECK: #pragma omp target update to(mapper(id): fd) +// CHECK: #pragma omp target update to(mapper(idd): fd.b) // CHECK: } // CHECK: template<> int foo(int a) { // CHECK: #pragma omp declare mapper (id : struct foodat v) map(tofrom: v.a) @@ -103,6 +107,8 @@ T foo(T a) { // CHECK: } // CHECK: #pragma omp target map(mapper(id),alloc: fd) // CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) +// CHECK: #pragma omp target update to(mapper(id): fd) +// CHECK: #pragma omp target update to(mapper(idd): fd.b) // CHECK: } // CHECK: int main() { @@ -119,6 +125,12 @@ int main() { #pragma omp target map(mapper(default) tofrom: dd) // CHECK: #pragma omp target map(mapper(default),tofrom: dd) { dd.d++; } + +#pragma omp target update to(mapper(N1::id) : vc) +// CHECK: #pragma omp target update to(mapper(N1::id): vc) +#pragma omp target update to(mapper(dat::id): vvv) +// CHECK: #pragma omp target update to(mapper(dat::id): vvv) + #pragma omp declare mapper(id: N1::vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) { diff --git a/test/OpenMP/declare_mapper_codegen.cpp b/test/OpenMP/declare_mapper_codegen.cpp index 3f80b7eb19..4946ab2cce 100644 --- a/test/OpenMP/declare_mapper_codegen.cpp +++ b/test/OpenMP/declare_mapper_codegen.cpp @@ -26,10 +26,12 @@ public: #pragma omp declare mapper(id: C s) map(s.a) -// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l49.region_id = weak constant i8 0 +// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l52.region_id = weak constant i8 0 -// CHECK-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i{{64|32}}] [i{{64|32}} 4] -// CHECK-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35] +// CHECK: [[SIZES:@.+]] = {{.+}}constant [1 x i[[sz:64|32]]] [i{{64|32}} 4] +// CHECK: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35] +// CHECK: [[TSIZES:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] 4] +// CHECK: [[TTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 33] // CHECK-LABEL: foo{{.*}}( void foo(int a){ @@ -46,11 +48,22 @@ void foo(int a){ // CHECK-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to %class.C** // CHECK-DAG: store %class.C* [[VAL:%[^,]+]], %class.C** [[CBP1]] // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[CP1]] + // CHECK: call void [[KERNEL:@.+]](%class.C* [[VAL]]) #pragma omp target map(mapper(id),tofrom: c) { ++c.a; } - // CHECK: call void [[KERNEL:@.+]](%class.C* [[VAL]]) + + // CHECK-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[TGEPBP:%.+]], i8** [[TGEPP:%.+]], i[[sz]]* getelementptr {{.+}}[1 x i[[sz]]]* [[TSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[TTYPES]]{{.+}}) + // CHECK-DAG: [[TGEPBP]] = getelementptr inbounds {{.+}}[[TBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[TGEPP]] = getelementptr inbounds {{.+}}[[TP:%[^,]+]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[TBP0:%.+]] = getelementptr inbounds {{.+}}[[TBP]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[TP0:%.+]] = getelementptr inbounds {{.+}}[[TP]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[TCBP0:%.+]] = bitcast i8** [[TBP0]] to %class.C** + // CHECK-DAG: [[TCP0:%.+]] = bitcast i8** [[TP0]] to %class.C** + // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCBP0]] + // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCP0]] + #pragma omp target update to(mapper(id): c) } diff --git a/test/OpenMP/declare_mapper_messages.c b/test/OpenMP/declare_mapper_messages.c index fc8fa9dbda..95014b0d8f 100644 --- a/test/OpenMP/declare_mapper_messages.c +++ b/test/OpenMP/declare_mapper_messages.c @@ -22,7 +22,7 @@ struct vec { // expec #pragma omp declare mapper(bb:struct vec v) private(v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} // expected-error {{unexpected OpenMP clause 'private' in directive '#pragma omp declare mapper'}} #pragma omp declare mapper(cc:struct vec v) map(v) ( // expected-warning {{extra tokens at the end of '#pragma omp declare mapper' are ignored}} -#pragma omp declare mapper(++: struct vec v) map(v.len) // expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp declare mapper(++: struct vec v) map(v.len) // expected-error {{illegal OpenMP user-defined mapper identifier}} #pragma omp declare mapper(id1: struct vec v) map(v.len, temp) // expected-error {{only variable v is allowed in map clauses of this 'omp declare mapper' directive}} #pragma omp declare mapper(default : struct vec kk) map(kk.data[0:2]) // expected-note {{previous definition is here}} #pragma omp declare mapper(struct vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'default'}} @@ -50,6 +50,14 @@ int fun(int arg) { {} #pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1) {} + +#pragma omp target update to(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper() // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper:vv) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(aa):vv) } } return arg; diff --git a/test/OpenMP/declare_mapper_messages.cpp b/test/OpenMP/declare_mapper_messages.cpp index 2031d19877..d7aa073da9 100644 --- a/test/OpenMP/declare_mapper_messages.cpp +++ b/test/OpenMP/declare_mapper_messages.cpp @@ -29,7 +29,7 @@ public: #pragma omp declare mapper(bb: vec v) private(v) // expected-error {{expected at least one clause on '#pragma omp declare mapper' directive}} // expected-error {{unexpected OpenMP clause 'private' in directive '#pragma omp declare mapper'}} #pragma omp declare mapper(cc: vec v) map(v) ( // expected-warning {{extra tokens at the end of '#pragma omp declare mapper' are ignored}} -#pragma omp declare mapper(++: vec v) map(v.len) // expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp declare mapper(++: vec v) map(v.len) // expected-error {{illegal OpenMP user-defined mapper identifier}} #pragma omp declare mapper(id1: vec v) map(v.len, temp) // expected-error {{only variable v is allowed in map clauses of this 'omp declare mapper' directive}} #pragma omp declare mapper(default : vec kk) map(kk.data[0:2]) // expected-note {{previous definition is here}} #pragma omp declare mapper(vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'default'}} @@ -74,9 +74,9 @@ int fun(int arg) { {} #pragma omp target map(mapper(ab) :vv) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} {} -#pragma omp target map(mapper(N2::) :vv) // expected-error {{use of undeclared identifier 'N2'}} expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp target map(mapper(N2::) :vv) // expected-error {{use of undeclared identifier 'N2'}} expected-error {{illegal OpenMP user-defined mapper identifier}} {} -#pragma omp target map(mapper(N1::) :vv) // expected-error {{illegal identifier on 'omp declare mapper' directive}} +#pragma omp target map(mapper(N1::) :vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} {} #pragma omp target map(mapper(aa) :vv) // expected-error {{missing map type}} {} @@ -86,6 +86,19 @@ int fun(int arg) { {} #pragma omp target map(mapper(N1::stack::id) to:vv) {} + +#pragma omp target update to(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper() // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper:vv) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(N2:: :vv) // expected-error {{use of undeclared identifier 'N2'}} expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(N1:: :vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(N1::aa) :vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}} +#pragma omp target update to(mapper(aa):vv) +#pragma omp target update to(mapper(N1::stack::id) :vv) } #pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} } -- cgit v1.2.3 From 01e162c2965d114aa4e21c91b6341454210ad8fb Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Mon, 25 Feb 2019 20:34:15 +0000 Subject: [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier. This patch implements the parsing and sema support for the OpenMP 'from'-clause with potential user-defined mappers attached. User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device Contributed-by: Lingda Li Differential Revision: https://reviews.llvm.org/D58638 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354817 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_mapper_ast_print.c | 4 ++-- test/OpenMP/declare_mapper_ast_print.cpp | 11 +++++++++++ test/OpenMP/declare_mapper_codegen.cpp | 15 ++++++++++++++- test/OpenMP/declare_mapper_messages.c | 9 +++++++++ test/OpenMP/declare_mapper_messages.cpp | 13 +++++++++++++ 5 files changed, 49 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_mapper_ast_print.c b/test/OpenMP/declare_mapper_ast_print.c index f053044a09..e82bc4c2d3 100644 --- a/test/OpenMP/declare_mapper_ast_print.c +++ b/test/OpenMP/declare_mapper_ast_print.c @@ -48,8 +48,8 @@ int main() { #pragma omp target map(mapper(default), from: dd[0:10]) // CHECK: #pragma omp target map(mapper(default),from: dd[0:10]) { dd[0].i++; } -#pragma omp target update to(mapper(id): vv) -// CHECK: #pragma omp target update to(mapper(id): vv) +#pragma omp target update to(mapper(id): vv) from(mapper(default): dd[0:10]) +// CHECK: #pragma omp target update to(mapper(id): vv) from(mapper(default): dd[0:10]) } return 0; } diff --git a/test/OpenMP/declare_mapper_ast_print.cpp b/test/OpenMP/declare_mapper_ast_print.cpp index 1e05fe5469..6462fa38d8 100644 --- a/test/OpenMP/declare_mapper_ast_print.cpp +++ b/test/OpenMP/declare_mapper_ast_print.cpp @@ -83,6 +83,8 @@ T foo(T a) { { fd.b.k++; } #pragma omp target update to(mapper(id): fd) #pragma omp target update to(mapper(idd): fd.b) +#pragma omp target update from(mapper(id): fd) +#pragma omp target update from(mapper(idd): fd.b) return 0; } @@ -97,6 +99,8 @@ T foo(T a) { // CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) // CHECK: #pragma omp target update to(mapper(id): fd) // CHECK: #pragma omp target update to(mapper(idd): fd.b) +// CHECK: #pragma omp target update from(mapper(id): fd) +// CHECK: #pragma omp target update from(mapper(idd): fd.b) // CHECK: } // CHECK: template<> int foo(int a) { // CHECK: #pragma omp declare mapper (id : struct foodat v) map(tofrom: v.a) @@ -109,6 +113,8 @@ T foo(T a) { // CHECK: #pragma omp target map(mapper(idd),alloc: fd.b) // CHECK: #pragma omp target update to(mapper(id): fd) // CHECK: #pragma omp target update to(mapper(idd): fd.b) +// CHECK: #pragma omp target update from(mapper(id): fd) +// CHECK: #pragma omp target update from(mapper(idd): fd.b) // CHECK: } // CHECK: int main() { @@ -131,6 +137,11 @@ int main() { #pragma omp target update to(mapper(dat::id): vvv) // CHECK: #pragma omp target update to(mapper(dat::id): vvv) +#pragma omp target update from(mapper(N1::id) : vc) +// CHECK: #pragma omp target update from(mapper(N1::id): vc) +#pragma omp target update from(mapper(dat::id): vvv) +// CHECK: #pragma omp target update from(mapper(dat::id): vvv) + #pragma omp declare mapper(id: N1::vec v) map(v.len) // CHECK: #pragma omp declare mapper (id : N1::vec v) map(tofrom: v.len) { diff --git a/test/OpenMP/declare_mapper_codegen.cpp b/test/OpenMP/declare_mapper_codegen.cpp index 4946ab2cce..6f1d6ec8fd 100644 --- a/test/OpenMP/declare_mapper_codegen.cpp +++ b/test/OpenMP/declare_mapper_codegen.cpp @@ -26,12 +26,14 @@ public: #pragma omp declare mapper(id: C s) map(s.a) -// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l52.region_id = weak constant i8 0 +// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l54.region_id = weak constant i8 0 // CHECK: [[SIZES:@.+]] = {{.+}}constant [1 x i[[sz:64|32]]] [i{{64|32}} 4] // CHECK: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35] // CHECK: [[TSIZES:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] 4] // CHECK: [[TTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 33] +// CHECK: [[FSIZES:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] 4] +// CHECK: [[FTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 34] // CHECK-LABEL: foo{{.*}}( void foo(int a){ @@ -64,6 +66,17 @@ void foo(int a){ // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCBP0]] // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCP0]] #pragma omp target update to(mapper(id): c) + + // CHECK-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[FGEPBP:%.+]], i8** [[FGEPP:%.+]], i[[sz]]* getelementptr {{.+}}[1 x i[[sz]]]* [[FSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[FTYPES]]{{.+}}) + // CHECK-DAG: [[FGEPBP]] = getelementptr inbounds {{.+}}[[FBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[FGEPP]] = getelementptr inbounds {{.+}}[[FP:%[^,]+]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[FBP0:%.+]] = getelementptr inbounds {{.+}}[[FBP]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[FP0:%.+]] = getelementptr inbounds {{.+}}[[FP]], i{{.+}} 0, i{{.+}} 0 + // CHECK-DAG: [[FCBP0:%.+]] = bitcast i8** [[FBP0]] to %class.C** + // CHECK-DAG: [[FCP0:%.+]] = bitcast i8** [[FP0]] to %class.C** + // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[FCBP0]] + // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[FCP0]] + #pragma omp target update from(mapper(id): c) } diff --git a/test/OpenMP/declare_mapper_messages.c b/test/OpenMP/declare_mapper_messages.c index 95014b0d8f..4df14b62d5 100644 --- a/test/OpenMP/declare_mapper_messages.c +++ b/test/OpenMP/declare_mapper_messages.c @@ -58,6 +58,15 @@ int fun(int arg) { #pragma omp target update to(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(mapper(aa):vv) + +#pragma omp target update from(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper() // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper:vv) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}} +#pragma omp target update from(mapper(aa):vv) } } return arg; diff --git a/test/OpenMP/declare_mapper_messages.cpp b/test/OpenMP/declare_mapper_messages.cpp index d7aa073da9..bcb5ac463a 100644 --- a/test/OpenMP/declare_mapper_messages.cpp +++ b/test/OpenMP/declare_mapper_messages.cpp @@ -99,6 +99,19 @@ int fun(int arg) { #pragma omp target update to(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}} #pragma omp target update to(mapper(aa):vv) #pragma omp target update to(mapper(N1::stack::id) :vv) + +#pragma omp target update from(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper() // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper:vv) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(N2:: :vv) // expected-error {{use of undeclared identifier 'N2'}} expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(N1:: :vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(N1::aa) :vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update from(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}} +#pragma omp target update from(mapper(aa):vv) +#pragma omp target update from(mapper(N1::stack::id) :vv) } #pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}} } -- cgit v1.2.3 From 899d0c734e82ec065643a26db3b8aab1f3216d60 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 26 Feb 2019 20:52:16 +0000 Subject: [OPENMP]Delay emission for unsupported va_arg expression. If the OpenMP device is NVPTX and va_arg is used, delay emission of the error for va_arg unless it is used in the device code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354925 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_va_arg_delayed_diags.c | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/OpenMP/nvptx_va_arg_delayed_diags.c (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_va_arg_delayed_diags.c b/test/OpenMP/nvptx_va_arg_delayed_diags.c new file mode 100644 index 0000000000..3420884d97 --- /dev/null +++ b/test/OpenMP/nvptx_va_arg_delayed_diags.c @@ -0,0 +1,40 @@ +// RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc +// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// REQUIRES: x86-registered-target +// REQUIRES: nvptx-registered-target + +#ifndef DIAGS +// expected-no-diagnostics +#endif // DIAGS + +#ifdef IMMEDIATE +#pragma omp declare target +#endif //IMMEDIATE +void t1(int r, ...) { +#ifdef DIAGS +// expected-error@+4 {{CUDA device code does not support va_arg}} +#endif // DIAGS + __builtin_va_list list; + __builtin_va_start(list, r); + (void)__builtin_va_arg(list, int); + __builtin_va_end(list); +} + +#ifdef IMMEDIATE +#pragma omp end declare target +#endif //IMMEDIATE + +int main() { +#ifdef DELAYED +#pragma omp target +#endif // DELAYED + { +#ifdef DELAYED +// expected-note@+2 {{called by 'main'}} +#endif // DELAYED + t1(0); + } + return 0; +} -- cgit v1.2.3 From 08cea3e530404ebabce2dc1a8fff6b865cf9acf9 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 26 Feb 2019 21:51:16 +0000 Subject: [OPENMP][CUDA]Do not emit warnings for variables in late-reported asm statements. If the assembler instruction is not generated and the delayed diagnostic is emitted, we may end up with extra warning message for variables used in the asm statement. Since the asm statement is not built, the variables may be left non-referenced and it may produce a warning about a use of the non-initialized variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354928 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_asm_delayed_diags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_asm_delayed_diags.c b/test/OpenMP/nvptx_asm_delayed_diags.c index b3adc8ea00..fa6128b60b 100644 --- a/test/OpenMP/nvptx_asm_delayed_diags.c +++ b/test/OpenMP/nvptx_asm_delayed_diags.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc -// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -// RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -// RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only +// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized +// RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized +// RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized // REQUIRES: x86-registered-target // REQUIRES: nvptx-registered-target -- cgit v1.2.3 From 138b8635bbf9070cd26ce7afc92048507a5fd66b Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 27 Feb 2019 20:29:45 +0000 Subject: [OPENMP]Delay emission of the error for unsupported types. If the type is unsupported on the device side, it still must be emitted, but we should emit errors for operations with such types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355027 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_unsupported_type_codegen.cpp | 64 +++++++++++++++++++++++++ test/OpenMP/nvptx_unsupported_type_messages.cpp | 47 ++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 test/OpenMP/nvptx_unsupported_type_codegen.cpp create mode 100644 test/OpenMP/nvptx_unsupported_type_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_unsupported_type_codegen.cpp b/test/OpenMP/nvptx_unsupported_type_codegen.cpp new file mode 100644 index 0000000000..61accc3c72 --- /dev/null +++ b/test/OpenMP/nvptx_unsupported_type_codegen.cpp @@ -0,0 +1,64 @@ +// Test target codegen - host bc file has to be created first. +// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc +// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - | FileCheck %s +// expected-no-diagnostics + +// CHECK-DAG: [[T:%.+]] = type {{.+}}, fp128, +// CHECK-DAG: [[T1:%.+]] = type {{.+}}, i128, i128, + +struct T { + char a; + __float128 f; + char c; + T() : a(12), f(15) {} + T &operator+(T &b) { f += b.a; return *this;} +}; + +struct T1 { + char a; + __int128 f; + __int128 f1; + char c; + T1() : a(12), f(15) {} + T1 &operator+(T1 &b) { f += b.a; return *this;} +}; + +#pragma omp declare target +T a = T(); +T f = a; +// CHECK: define void @{{.+}}foo{{.+}}([[T]]* byval align {{.+}}) +void foo(T a = T()) { + return; +} +// CHECK: define [6 x i64] @{{.+}}bar{{.+}}() +T bar() { +// CHECK: bitcast [[T]]* %{{.+}} to [6 x i64]* +// CHECK-NEXT: load [6 x i64], [6 x i64]* %{{.+}}, +// CHECK-NEXT: ret [6 x i64] + return T(); +} +// CHECK: define void @{{.+}}baz{{.+}}() +void baz() { +// CHECK: call [6 x i64] @{{.+}}bar{{.+}}() +// CHECK-NEXT: bitcast [[T]]* %{{.+}} to [6 x i64]* +// CHECK-NEXT: store [6 x i64] %{{.+}}, [6 x i64]* %{{.+}}, + T t = bar(); +} +T1 a1 = T1(); +T1 f1 = a1; +// CHECK: define void @{{.+}}foo1{{.+}}([[T1]]* byval align {{.+}}) +void foo1(T1 a = T1()) { + return; +} +// CHECK: define [[T1]] @{{.+}}bar1{{.+}}() +T1 bar1() { +// CHECK: load [[T1]], [[T1]]* +// CHECK-NEXT: ret [[T1]] + return T1(); +} +// CHECK: define void @{{.+}}baz1{{.+}}() +void baz1() { +// CHECK: call [[T1]] @{{.+}}bar1{{.+}}() + T1 t = bar1(); +} +#pragma omp end declare target diff --git a/test/OpenMP/nvptx_unsupported_type_messages.cpp b/test/OpenMP/nvptx_unsupported_type_messages.cpp new file mode 100644 index 0000000000..6e0fa3b1d5 --- /dev/null +++ b/test/OpenMP/nvptx_unsupported_type_messages.cpp @@ -0,0 +1,47 @@ +// Test target codegen - host bc file has to be created first. +// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-host.bc +// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -fsyntax-only + +struct T { + char a; + __float128 f; + char c; + T() : a(12), f(15) {} + T &operator+(T &b) { f += b.a; return *this;} // expected-error {{'__float128' is not supported on this target}} +}; + +struct T1 { + char a; + __int128 f; + __int128 f1; + char c; + T1() : a(12), f(15) {} + T1 &operator/(T1 &b) { f /= b.a; return *this;} +}; + +#pragma omp declare target +T a = T(); +T f = a; +void foo(T a = T()) { + a = a + f; // expected-note {{called by 'foo'}} + return; +} +T bar() { + return T(); +} +void baz() { + T t = bar(); +} +T1 a1 = T1(); +T1 f1 = a1; +void foo1(T1 a = T1()) { + a = a / f1; + return; +} +T1 bar1() { + return T1(); +} +void baz1() { + T1 t = bar1(); +} +#pragma omp end declare target -- cgit v1.2.3 From 8650dc5d838e74671340f7bca62beedf75ae8a54 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 5 Mar 2019 17:47:18 +0000 Subject: [OPENMP]Target region: emit const firstprivates as globals with constant memory. If the variable with the constant non-scalar type is firstprivatized in the target region, the local copy is created with the data copying. Instead, we allocate the copy in the constant memory and avoid extra copying in the outlined target regions. This global copy is used in the target regions without loss of the performance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355418 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_firstprivate_codegen.cpp | 18 ++-- test/OpenMP/target_firstprivate_codegen.cpp | 114 ++++++++++++---------- 2 files changed, 73 insertions(+), 59 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp index 8ffc08294a..c99b43c27f 100644 --- a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp +++ b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp @@ -13,9 +13,11 @@ struct TT { ty Y; }; -// TCHECK: [[TT:%.+]] = type { i64, i8 } -// TCHECK: [[S1:%.+]] = type { double } +// TCHECK-DAG: [[TT:%.+]] = type { i64, i8 } +// TCHECK-DAG: [[TTII:%.+]] = type { i32, i32 } +// TCHECK-DAG: [[S1:%.+]] = type { double } +// TCHECK: @__omp_offloading_firstprivate__{{.+}}_e_l28 = internal addrspace(4) global [[TTII]] zeroinitializer // TCHECK: @{{.*}}_$_{{.*}} = common global i32 0, !dbg !{{[0-9]+}} int foo(int n, double *ptr) { int a = 0; @@ -23,16 +25,20 @@ int foo(int n, double *ptr) { float b[10]; double c[5][10]; TT d; + const TT e = {n, n}; -#pragma omp target firstprivate(a) map(tofrom \ - : b) +#pragma omp target firstprivate(a, e) map(tofrom \ + : b) { b[a] = a; + b[a] += e.X; } - // TCHECK: define {{.*}}void @__omp_offloading_{{.+}}([10 x float] addrspace(1)* noalias [[B_IN:%.+]], i{{[0-9]+}} [[A_IN:%.+]]) + // TCHECK: define {{.*}}void @__omp_offloading_{{.+}}([10 x float] addrspace(1)* noalias [[B_IN:%.+]], i{{[0-9]+}} [[A_IN:%.+]], [[TTII]]* noalias [[E_IN:%.+]]) + // TCHECK-NOT: alloca [[TTII]], // TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}}, - // TCHECK-NOT: alloca i{{[0-9]+}}, + // TCHECK-NOT: alloca [[TTII]], + // TCHECK-NOT: alloca i{{[0-9]+}}, // TCHECK-64: call void @llvm.dbg.declare(metadata [10 x float] addrspace(1)** %{{.+}}, metadata !{{[0-9]+}}, metadata !DIExpression()) // TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]], // TCHECK: ret void diff --git a/test/OpenMP/target_firstprivate_codegen.cpp b/test/OpenMP/target_firstprivate_codegen.cpp index 4a2837b3c8..e1d5019a2b 100644 --- a/test/OpenMP/target_firstprivate_codegen.cpp +++ b/test/OpenMP/target_firstprivate_codegen.cpp @@ -38,30 +38,32 @@ #ifndef HEADER #define HEADER -template -struct TT{ +template +struct TT { tx X; ty Y; }; -// CHECK: [[TT:%.+]] = type { i64, i8 } -// CHECK: [[S1:%.+]] = type { double } +// CHECK-DAG: [[TT:%.+]] = type { i64, i8 } +// CHECK-DAG: [[TTII:%.+]] = type { i32, i32 } +// CHECK-DAG: [[S1:%.+]] = type { double } -// TCHECK: [[TT:%.+]] = type { i64, i8 } -// TCHECK: [[S1:%.+]] = type { double } +// TCHECK-DAG: [[TT:%.+]] = type { i64, i8 } +// TCHECK-DAG: [[TTII:%.+]] = type { i32, i32 } +// TCHECK-DAG: [[S1:%.+]] = type { double } +// CHECK-DAG: [[FP_E:@__omp_offloading_firstprivate_.+_e_l76]] = internal global [[TTII]] zeroinitializer // CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [1 x i{{32|64}}] [i[[SZ:32|64]] 4] -// CHECK: [[MAPT:@.+]] = private unnamed_addr constant [1 x i64] [i64 800] +// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [1 x i64] [i64 800] // CHECK-DAG: [[MAPT2:@.+]] = private unnamed_addr constant [9 x i64] [i64 800, i64 673, i64 288, i64 673, i64 673, i64 288, i64 288, i64 673, i64 673] -// CHECK-DAG: [[SIZET3:@.+]] = private unnamed_addr constant [1 x i{{32|64}}] zeroinitializer -// CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [1 x i64] [i64 544] +// CHECK-DAG: [[SIZET3:@.+]] = private unnamed_addr constant [2 x i{{32|64}}] [i{{32|64}} 0, i{{32|64}} 8] +// CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 549] // CHECK-DAG: [[MAPT4:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 288, i64 288, i64 673] // CHECK-DAG: [[SIZET5:@.+]] = private unnamed_addr constant [3 x i{{32|64}}] [i[[SZ]] 4, i[[SZ]] 1, i[[SZ]] 40] // CHECK-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [3 x i64] [i64 800, i64 800, i64 673] // CHECK-DAG: [[SIZET6:@.+]] = private unnamed_addr constant [2 x i{{32|64}}] [i[[SZ]] 4, i[[SZ]] 40] // CHECK-DAG: [[MAPT6:@.+]] = private unnamed_addr constant [2 x i64] [i64 800, i64 673] - // CHECK: define {{.*}}[[FOO:@.+]]( int foo(int n, double *ptr) { int a = 0; @@ -71,8 +73,9 @@ int foo(int n, double *ptr) { double c[5][10]; double cn[5][n]; TT d; - - #pragma omp target firstprivate(a) + const TT e = {n, n}; + +#pragma omp target firstprivate(a) { } @@ -92,14 +95,14 @@ int foo(int n, double *ptr) { // CHECK: [[BASE_PTR_ARR2:%.+]] = alloca [9 x i8*], // CHECK: [[PTR_ARR2:%.+]] = alloca [9 x i8*], // CHECK: [[SIZET2:%.+]] = alloca [9 x i{{[0-9]+}}], - // CHECK: [[BASE_PTR_ARR3:%.+]] = alloca [1 x i8*], - // CHECK: [[PTR_ARR3:%.+]] = alloca [1 x i8*], + // CHECK: [[BASE_PTR_ARR3:%.+]] = alloca [2 x i8*], + // CHECK: [[PTR_ARR3:%.+]] = alloca [2 x i8*], // CHECK: [[N_ADDR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[N_ADDR]], // CHECK-64: [[N_EXT:%.+]] = zext i{{[0-9]+}} [[N_ADDR_VAL]] to i{{[0-9]+}} // CHECK: [[SSAVE_RET:%.+]] = call i8* @llvm.stacksave() // CHECK: store i8* [[SSAVE_RET]], i8** [[SSTACK]], // CHECK-64: [[BN_VLA:%.+]] = alloca float, i{{[0-9]+}} [[N_EXT]], - // CHECK-32: [[BN_VLA:%.+]] = alloca float, i{{[0-9]+}} [[N_ADDR_VAL]], + // CHECK-32: [[BN_VLA:%.+]] = alloca float, i{{[0-9]+}} [[N_ADDR_VAL]], // CHECK: [[N_ADDR_VAL2:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[N_ADDR]], // CHECK-64: [[N_EXT2:%.+]] = zext i{{[0-9]+}} [[N_ADDR_VAL2]] to i{{[0-9]+}} // CHECK-64: [[CN_SIZE:%.+]] = mul{{.+}} i{{[0-9]+}} 5, [[N_EXT2]] @@ -119,15 +122,15 @@ int foo(int n, double *ptr) { // CHECK: [[BASE_PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 1, i8** [[BASE_PTR_GEP_ARG]], i8** [[PTR_GEP_ARG]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPT]], i32 0, i32 0)) - + // TCHECK: define weak void @__omp_offloading_{{.+}}(i{{[0-9]+}} [[A_IN:%.+]]) // TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}}, // TCHECK-NOT: alloca i{{[0-9]+}}, // TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]], // TCHECK-NOT: store i{{[0-9]+}} % - // TCHECK: ret void + // TCHECK: ret void -#pragma omp target firstprivate(aa,b,bn,c,cn,d) +#pragma omp target firstprivate(aa, b, bn, c, cn, d) { aa += 1; b[2] = 1.0; @@ -135,7 +138,7 @@ int foo(int n, double *ptr) { c[1][2] = 1.0; cn[1][3] = 1.0; d.X = 1; - d.Y = 1; + d.Y = 1; } // CHECK: [[A2VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A2]], @@ -143,7 +146,7 @@ int foo(int n, double *ptr) { // CHECK: store i{{[0-9]+}} [[A2VAL]], i{{[0-9]+}}* [[A2CASTCONV]], // CHECK: [[A2CAST_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A2CAST]], // CHECK-64: [[BN_SIZE:%.+]] = mul{{.+}} i{{[0-9]+}} [[N_EXT]], 4 - // CHECK-32: [[BN_SIZE:%.+]] = mul{{.+}} i{{[0-9]+}} [[N_ADDR_VAL]], 4 + // CHECK-32: [[BN_SIZE:%.+]] = mul{{.+}} i{{[0-9]+}} [[N_ADDR_VAL]], 4 // CHECK-64: [[CN_SIZE_1:%.+]] = mul{{.+}} i{{[0-9]+}} 5, [[N_EXT2]] // CHECK-32: [[CN_SIZE_1:%.+]] = mul{{.+}} i{{[0-9]+}} 5, [[N_ADDR_VAL2]] // CHECK: [[CN_SIZE_2:%.+]] = mul{{.+}} i{{[0-9]+}} [[CN_SIZE_1]], 8 @@ -184,7 +187,7 @@ int foo(int n, double *ptr) { // CHECK: store float* [[BN_VLA]], float** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPBN_3:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 // CHECK: store i{{[0-9]+}} [[BN_SIZE]], i{{[0-9]+}}* [[SIZE_GEPBN_3]] - + // firstprivate(c): base_ptr = &c[0], ptr = &c[0], size = 400 (5*10*sizeof(double)) // CHECK: [[BASE_PTR_GEP2_4:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_4]] to [5 x [10 x double]]** @@ -194,7 +197,7 @@ int foo(int n, double *ptr) { // CHECK: store [5 x [10 x double]]* [[C]], [5 x [10 x double]]** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPC_4:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 // CHECK: store i{{[0-9]+}} 400, i{{[0-9]+}}* [[SIZE_GEPC_4]], - + // firstprivate(cn), 3 entries, 5, n, cn: (1) base_ptr = 5, ptr = 5, size = 8; (2) (1) base_ptr = n, ptr = n, size = 8; (3) base_ptr = &cn[0], ptr = &cn[0], size = 5*n*sizeof(double) // CHECK: [[BASE_PTR_GEP2_5:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 5 // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_5]] to i{{[0-9]+}}* @@ -222,8 +225,8 @@ int foo(int n, double *ptr) { // CHECK: store double* [[CN_VLA]], double** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_7:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 7 // CHECK: store i{{[0-9]+}} [[CN_SIZE_2]], i{{[0-9]+}}* [[SIZE_GEPCN_7]], - - // firstprivate(d): base_ptr = &d, ptr = &d, size = 16 + + // firstprivate(d): base_ptr = &d, ptr = &d, size = 16 // CHECK: [[BASE_PTR_GEP2_8:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 8 // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_8]] to [[TT]]** // CHECK: store [[TT]]* [[D]], [[TT]]** [[BCAST_TOPTR]], @@ -232,13 +235,12 @@ int foo(int n, double *ptr) { // CHECK: store [[TT]]* [[D]], [[TT]]** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_8:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 8 // CHECK: store i{{[0-9]+}} {{[0-9]+}}, i{{[0-9]+}}* [[SIZE_GEPCN_8]], - - + // CHECK: [[BASE_PTR_GEP_ARG2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[PTR_GEP_ARG2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[SIZES_ARG2:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 9, i8** [[BASE_PTR_GEP_ARG2]], i8** [[PTR_GEP_ARG2]], i[[SZ]]* [[SIZES_ARG2]], i64* getelementptr inbounds ([9 x i64], [9 x i64]* [[MAPT2]], i32 0, i32 0)) - + // make sure that firstprivate variables are generated in all cases and that we use those instances for operations inside the // target region // TCHECK: define {{.*}}void @__omp_offloading_{{.+}}(i{{[0-9]+}} [[A2_IN:%.+]], [10 x float]* {{.+}} [[B_IN:%.+]], i{{[0-9]+}} [[BN_SZ:%.+]], float* {{.+}} [[BN_IN:%.+]], [5 x [10 x double]]* {{.+}} [[C_IN:%.+]], i{{[0-9]+}} [[CN_SZ1:%.+]], i{{[0-9]+}} [[CN_SZ2:%.+]], double* {{.+}} [[CN_IN:%.+]], [[TT]]* {{.+}} [[D_IN:%.+]]) @@ -297,7 +299,7 @@ int foo(int n, double *ptr) { // TCHECK: [[C_PRIV_BCAST:%.+]] = bitcast [5 x [10 x double]]* [[C_PRIV]] to i8* // TCHECK: [[C_IN_BCAST:%.+]] = bitcast [5 x [10 x double]]* [[C_ADDR_REF]] to i8* // TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[C_PRIV_BCAST]], i8* align {{[0-9]+}} [[C_IN_BCAST]],{{.+}}) - + // firstprivate(cn) // TCHECK: [[CN_SZ:%.+]] = mul{{.+}} i{{[0-9]+}} [[CN_SZ1_VAL]], [[CN_SZ2_VAL]] // TCHECK: [[CN_PRIV:%.+]] = alloca double, i{{[0-9]+}} [[CN_SZ]], @@ -306,32 +308,43 @@ int foo(int n, double *ptr) { // TCHECK: [[CN_PRIV_BCAST:%.+]] = bitcast double* [[CN_PRIV]] to i8* // TCHECK: [[CN_IN_BCAST:%.+]] = bitcast double* [[CN_ADDR_REF]] to i8* // TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[CN_PRIV_BCAST]], i8* align {{[0-9]+}} [[CN_IN_BCAST]], i{{[0-9]+}} [[CN_SZ2_CPY]],{{.+}}) - + // firstprivate(d) // TCHECK: [[D_PRIV_BCAST:%.+]] = bitcast [[TT]]* [[D_PRIV]] to i8* // TCHECK: [[D_IN_BCAST:%.+]] = bitcast [[TT]]* [[D_ADDR_REF]] to i8* // TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[D_PRIV_BCAST]], i8* align {{[0-9]+}} [[D_IN_BCAST]],{{.+}}) - - #pragma omp target firstprivate(ptr) +#pragma omp target firstprivate(ptr, e) { + ptr[0] = e.X; ptr[0]++; } // CHECK: [[PTR_ADDR_REF:%.+]] = load double*, double** [[PTR_ADDR]], - // CHECK: [[BASE_PTR_GEP3_0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[FP_E_BC:%.+]] = bitcast [[TTII]]* [[FP_E]] to i8* + // CHECK: [[E_BC:%.+]] = bitcast [[TTII]]* [[E:%.+]] to i8* + // CHECK: call void @llvm.memcpy.p0i8.p0i8.i{{64|32}}(i8* {{.*}} [[FP_E_BC]], i8* {{.*}} [[E_BC]], i{{64|32}} 8, i1 false) + // CHECK: [[BASE_PTR_GEP3_0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP3_0]] to double** // CHECK: store double* [[PTR_ADDR_REF]], double** [[BCAST_TOPTR]], - // CHECK: [[PTR_GEP3_0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[PTR_GEP3_0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP3_0]] to double** // CHECK: store double* [[PTR_ADDR_REF]], double** [[BCAST_TOPTR]], - - // CHECK: [[BASE_PTR_GEP_ARG3:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: [[PTR_GEP_ARG3:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 1, i8** [[BASE_PTR_GEP_ARG3]], i8** [[PTR_GEP_ARG3]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPT3]], i32 0, i32 0)) - - // TCHECK: define weak void @__omp_offloading_{{.+}}(double* [[PTR_IN:%.+]]) + // CHECK: [[BASE_PTR_GEP3_1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP3_1]] to [[TTII]]** + // CHECK: store [[TTII]]* [[FP_E]], [[TTII]]** [[BCAST_TOPTR]], + // CHECK: [[PTR_GEP3_1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP3_1]] to [[TTII]]** + // CHECK: store [[TTII]]* [[FP_E]], [[TTII]]** [[BCAST_TOPTR]], + + // CHECK: [[BASE_PTR_GEP_ARG3:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[PTR_GEP_ARG3:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 2, i8** [[BASE_PTR_GEP_ARG3]], i8** [[PTR_GEP_ARG3]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0)) + + // TCHECK: define weak void @__omp_offloading_{{.+}}(double* [[PTR_IN:%.+]], [[TTII]]* dereferenceable{{.+}} [[E:%.+]]) + // TCHECK-NOT: alloca [[TTII]], // TCHECK: [[PTR_ADDR:%.+]] = alloca double*, + // TCHECK-NOT: alloca [[TTII]], // TCHECK-NOT: alloca double*, // TCHECK: store double* [[PTR_IN]], double** [[PTR_ADDR]], // TCHECK-NOT: store double* % @@ -339,13 +352,12 @@ int foo(int n, double *ptr) { return a; } - -template +template tx ftemplate(int n) { tx a = 0; tx b[10]; -#pragma omp target firstprivate(a,b) +#pragma omp target firstprivate(a, b) { a += 1; b[2] += 1; @@ -354,13 +366,12 @@ tx ftemplate(int n) { return a; } -static -int fstatic(int n) { +static int fstatic(int n) { int a = 0; char aaa = 0; int b[10]; -#pragma omp target firstprivate(a,aaa,b) +#pragma omp target firstprivate(a, aaa, b) { a += 1; aaa += 1; @@ -398,11 +409,11 @@ int fstatic(int n) { struct S1 { double a; - int r1(int n){ - int b = n+1; + int r1(int n) { + int b = n + 1; short int c[2][n]; -#pragma omp target firstprivate(b,c) +#pragma omp target firstprivate(b, c) { this->a = (double)b + 1.5; c[1][1] = ++a; @@ -499,7 +510,7 @@ struct S1 { // firstprivate(b) // TCHECK-NOT: store i{{[0-9]+}} % - + // TCHECK: [[RET_STACK:%.+]] = call i8* @llvm.stacksave() // TCHECK: store i8* [[RET_STACK:%.+]], i8** [[SSTACK]], @@ -517,7 +528,6 @@ struct S1 { // TCHECK: call void @llvm.stackrestore(i8* [[RELOAD_SSTACK]]) // TCHECK: ret void - // static host function // CHECK: define{{.+}} i32 {{.+}}(i{{[0-9]+}} {{.+}}) // CHECK: [[BASE_PTRS5:%.+]] = alloca [3 x i8*], @@ -551,9 +561,7 @@ struct S1 { // CHECK: call i32 @__tgt_target(i64 -1, {{.+}}, i32 3, i8** {{.+}}, i8** {{.+}}, i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET5]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT5]], i32 0, i32 0)) }; - - -int bar(int n, double *ptr){ +int bar(int n, double *ptr) { int a = 0; a += foo(n, ptr); S1 S; -- cgit v1.2.3 From 3fbbfdb3b66a8cfc4dc51bb9f1aa677fbe2d46af Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 7 Mar 2019 17:54:44 +0000 Subject: [OPENMP 5.0]Add initial support for 'allocate' directive. Added parsing/sema analysis/serialization/deserialization support for 'allocate' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355614 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_ast_print.cpp | 79 ++++++++++++++++++++ test/OpenMP/allocate_messages.cpp | 149 +++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 test/OpenMP/allocate_ast_print.cpp create mode 100644 test/OpenMP/allocate_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_ast_print.cpp b/test/OpenMP/allocate_ast_print.cpp new file mode 100644 index 0000000000..bd0a7e8994 --- /dev/null +++ b/test/OpenMP/allocate_ast_print.cpp @@ -0,0 +1,79 @@ +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print + +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +struct St{ + int a; +}; + +struct St1{ + int a; + static int b; +// CHECK: static int b; +#pragma omp allocate(b) +// CHECK-NEXT: #pragma omp allocate(St1::b){{$}} +} d; + +int a, b; +// CHECK: int a; +// CHECK: int b; +#pragma omp allocate(a) +#pragma omp allocate(a) +// CHECK-NEXT: #pragma omp allocate(a) +// CHECK-NEXT: #pragma omp allocate(a) +#pragma omp allocate(d, b) +// CHECK-NEXT: #pragma omp allocate(d,b) + +template +struct ST { + static T m; + #pragma omp allocate(m) +}; + +template T foo() { + T v; + #pragma omp allocate(v) + v = ST::m; + return v; +} +//CHECK: template T foo() { +//CHECK-NEXT: T v; +//CHECK-NEXT: #pragma omp allocate(v) +//CHECK: template<> int foo() { +//CHECK-NEXT: int v; +//CHECK-NEXT: #pragma omp allocate(v) + +namespace ns{ + int a; +} +// CHECK: namespace ns { +// CHECK-NEXT: int a; +// CHECK-NEXT: } +#pragma omp allocate(ns::a) +// CHECK-NEXT: #pragma omp allocate(ns::a) + +int main () { + static int a; +// CHECK: static int a; +#pragma omp allocate(a) +// CHECK-NEXT: #pragma omp allocate(a) + a=2; + return (foo()); +} + +extern template int ST::m; +#endif diff --git a/test/OpenMP/allocate_messages.cpp b/test/OpenMP/allocate_messages.cpp new file mode 100644 index 0000000000..2d40f792d1 --- /dev/null +++ b/test/OpenMP/allocate_messages.cpp @@ -0,0 +1,149 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fnoopenmp-use-tls -ferror-limit 100 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -emit-llvm -o - %s + +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -emit-llvm -o - %s + +#pragma omp allocate // expected-error {{expected '(' after 'allocate'}} +#pragma omp allocate( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp allocate() // expected-error {{expected identifier}} +#pragma omp allocate(1) // expected-error {{expected unqualified-id}} +struct CompleteSt { + int a; +}; + +struct CompleteSt1 { +#pragma omp allocate(1) // expected-error {{expected unqualified-id}} + int a; +} d; // expected-note {{'d' defined here}} + +int a; // expected-note {{'a' defined here}} + +#pragma omp allocate(a) +#pragma omp allocate(u) // expected-error {{use of undeclared identifier 'u'}} +#pragma omp allocate(d, a) +int foo() { // expected-note {{declared here}} + static int l; +#pragma omp allocate(l)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} + return (a); +} + +#pragma omp allocate(a)( +// expected-warning@-1 {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a)[ // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a) { // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a)] // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a) } // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate a // expected-error {{expected '(' after 'allocate'}} +#pragma omp allocate(d // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp allocate(d)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +int x, y; +#pragma omp allocate(x)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(y)), +// expected-warning@-1 {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(a, d) +#pragma omp allocate(d.a) // expected-error {{expected identifier}} +#pragma omp allocate((float)a) // expected-error {{expected unqualified-id}} +int foa; // expected-note {{'foa' declared here}} +#pragma omp allocate(faa) // expected-error {{use of undeclared identifier 'faa'; did you mean 'foa'?}} +#pragma omp allocate(foo) // expected-error {{'foo' is not a global variable, static local variable or static data member}} +#pragma omp allocate(int a = 2) // expected-error {{expected unqualified-id}} + +struct IncompleteSt; + +extern IncompleteSt e; +#pragma omp allocate(e) + +int &f = a; +#pragma omp allocate(f) + +class TestClass { +private: + int a; // expected-note {{declared here}} + static int b; // expected-note {{'b' declared here}} + TestClass() : a(0) {} + +public: + TestClass(int aaa) : a(aaa) {} +#pragma omp allocate(b, a) // expected-error {{'a' is not a global variable, static local variable or static data member}} +} g(10); +#pragma omp allocate(b) // expected-error {{use of undeclared identifier 'b'}} +#pragma omp allocate(TestClass::b) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'TestClass::b' variable declaration}} +#pragma omp allocate(g) + +namespace ns { +int m; +#pragma omp allocate(m, m) +} // namespace ns +#pragma omp allocate(m) // expected-error {{use of undeclared identifier 'm'}} +#pragma omp allocate(ns::m) +#pragma omp allocate(ns \ + : m) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}} + +const int h = 12; +const volatile int i = 10; +#pragma omp allocate(h, i) + +template +class TempClass { +private: + T a; + TempClass() : a() {} + +public: + TempClass(T aaa) : a(aaa) {} + static T s; +#pragma omp allocate(s) +}; +#pragma omp allocate(s) // expected-error {{use of undeclared identifier 's'}} + +static __thread int t; +#pragma omp allocate(t) + +// Register "0" is currently an invalid register for global register variables. +// Use "esp" instead of "0". +// register int reg0 __asm__("0"); +register int reg0 __asm__("esp"); +#pragma omp allocate(reg0) + +int o; // expected-note {{candidate found by name lookup is 'o'}} +#pragma omp allocate(o) +namespace { +int o; // expected-note {{candidate found by name lookup is '(anonymous namespace)::o'}} +#pragma omp allocate(o) +#pragma omp allocate(o) +} // namespace +#pragma omp allocate(o) // expected-error {{reference to 'o' is ambiguous}} +#pragma omp allocate(::o) + +int main(int argc, char **argv) { + + int x, y = argc; + static double d1; + static double d2; + static double d3; // expected-note {{'d3' defined here}} + static double d4; + static TestClass LocalClass(y); +#pragma omp allocate(LocalClass) + + d.a = a; + d2++; + ; +#pragma omp allocate(argc + y) // expected-error {{expected identifier}} +#pragma omp allocate(argc, y) +#pragma omp allocate(d2) +#pragma omp allocate(d1) + { + ++a; + d2 = 0; +#pragma omp allocate(d3) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'd3' variable declaration}} + } +#pragma omp allocate(d3) +label: +#pragma omp allocate(d4) // expected-error {{'#pragma omp allocate' cannot be an immediate substatement}} + +#pragma omp allocate(a) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'a' variable declaration}} + return (y); +#pragma omp allocate(d) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'd' variable declaration}} +} -- cgit v1.2.3 From 6fed035e2464957903d3656ce105fa906fb2a2ac Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 8 Mar 2019 20:48:54 +0000 Subject: [OPENMP]Remove debug service variable. Removed not required service variable for the debug info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355729 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_firstprivate_codegen.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp index c99b43c27f..2c15eb6780 100644 --- a/test/OpenMP/nvptx_target_firstprivate_codegen.cpp +++ b/test/OpenMP/nvptx_target_firstprivate_codegen.cpp @@ -17,8 +17,7 @@ struct TT { // TCHECK-DAG: [[TTII:%.+]] = type { i32, i32 } // TCHECK-DAG: [[S1:%.+]] = type { double } -// TCHECK: @__omp_offloading_firstprivate__{{.+}}_e_l28 = internal addrspace(4) global [[TTII]] zeroinitializer -// TCHECK: @{{.*}}_$_{{.*}} = common global i32 0, !dbg !{{[0-9]+}} +// TCHECK: @__omp_offloading_firstprivate__{{.+}}_e_l27 = internal addrspace(4) global [[TTII]] zeroinitializer int foo(int n, double *ptr) { int a = 0; short aa = 0; -- cgit v1.2.3 From a695513ed785db7b96306d5979b3eb7bdd385998 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 11 Mar 2019 19:51:42 +0000 Subject: [OPENMP]Fix codegen for declare target link in target regions. If the declare target link global is used in the target region indirectly (used in the inner parallel, teams, etc. regions), we may miss this variable and it leads to incorrect codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355858 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_target_link_codegen.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_target_link_codegen.cpp b/test/OpenMP/declare_target_link_codegen.cpp index 564581c259..36c295b2de 100644 --- a/test/OpenMP/declare_target_link_codegen.cpp +++ b/test/OpenMP/declare_target_link_codegen.cpp @@ -37,10 +37,13 @@ int maini1() { { a = c; } +#pragma omp target +#pragma omp teams + c = a; return 0; } -// DEVICE: define weak void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-7]](i32* dereferenceable{{[^,]*}} +// DEVICE: define weak void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-10]](i32* dereferenceable{{[^,]*}} // DEVICE: [[C_REF:%.+]] = load i32*, i32** @c_decl_tgt_link_ptr, // DEVICE: [[C:%.+]] = load i32, i32* [[C_REF]], // DEVICE: store i32 [[C]], i32* % @@ -59,9 +62,10 @@ int maini1() { // HOST: [[BP0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // HOST: [[P0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // HOST: call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BP0]], i8** [[P0]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[SIZES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPTYPES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0)) -// HOST: call void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-26]](i32* %{{[^,]+}}) +// HOST: call void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-29]](i32* %{{[^,]+}}) +// HOST: call i32 @__tgt_target_teams(i64 -1, i8* @.__omp_offloading_{{.+}}_l40.region_id, i32 2, {{.+}}) -// HOST: define internal void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-28]](i32* dereferenceable{{.*}}) +// HOST: define internal void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-32]](i32* dereferenceable{{.*}}) // HOST: [[C:%.*]] = load i32, i32* @c, // HOST: store i32 [[C]], i32* % -- cgit v1.2.3 From 457ce20d09c5fedf7e606d6a49bba9fa81f8caea Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 12 Mar 2019 18:52:33 +0000 Subject: [OPENMP 5.0]Initial support for 'allocator' clause. Added parsing/sema analysis/serialization/deserialization for the 'allocator' clause of the 'allocate' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355952 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_ast_print.cpp | 89 ++++++++++++++++++++++++++++ test/OpenMP/allocate_allocator_messages.cpp | 27 +++++++++ 2 files changed, 116 insertions(+) create mode 100644 test/OpenMP/allocate_allocator_ast_print.cpp create mode 100644 test/OpenMP/allocate_allocator_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_ast_print.cpp b/test/OpenMP/allocate_allocator_ast_print.cpp new file mode 100644 index 0000000000..7a42dda2c5 --- /dev/null +++ b/test/OpenMP/allocate_allocator_ast_print.cpp @@ -0,0 +1,89 @@ +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print + +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + +struct St{ + int a; +}; + +struct St1{ + int a; + static int b; +// CHECK: static int b; +#pragma omp allocate(b) allocator(omp_default_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(St1::b) allocator(omp_default_mem_alloc){{$}} +} d; + +int a, b; +// CHECK: int a; +// CHECK: int b; +#pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) +#pragma omp allocate(a) allocator(omp_const_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(a) allocator(omp_const_mem_alloc) +#pragma omp allocate(d, b) allocator(omp_high_bw_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(d,b) allocator(omp_high_bw_mem_alloc) + +template +struct ST { + static T m; + #pragma omp allocate(m) allocator(omp_low_lat_mem_alloc) +}; + +template T foo() { + T v; + #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) + v = ST::m; + return v; +} +//CHECK: template T foo() { +//CHECK-NEXT: T v; +//CHECK-NEXT: #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) +//CHECK: template<> int foo() { +//CHECK-NEXT: int v; +//CHECK-NEXT: #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) + +namespace ns{ + int a; +} +// CHECK: namespace ns { +// CHECK-NEXT: int a; +// CHECK-NEXT: } +#pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) + +int main () { + static int a; +// CHECK: static int a; +#pragma omp allocate(a) allocator(omp_thread_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(a) allocator(omp_thread_mem_alloc) + a=2; + return (foo()); +} + +extern template int ST::m; +#endif diff --git a/test/OpenMP/allocate_allocator_messages.cpp b/test/OpenMP/allocate_allocator_messages.cpp new file mode 100644 index 0000000000..0f616dfb7e --- /dev/null +++ b/test/OpenMP/allocate_allocator_messages.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s + +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s + +struct St{ + int a; +}; + +int sss; +#pragma omp allocate(sss) allocate // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(sss) allocator // expected-error {{expected '(' after 'allocator'}} +#pragma omp allocate(sss) allocator(0, // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} +#pragma omp allocate(sss) allocator(0,sss // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} +#pragma omp allocate(sss) allocator(0,sss) // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} +#pragma omp allocate(sss) allocator(sss) // expected-error {{omp_allocator_handle_t type not found; include }} + +typedef void *omp_allocator_handle_t; + +struct St1{ + int a; + static int b; +#pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'omp_allocator_handle_t' (aka 'void *') with an expression of incompatible type 'int'}} +} d; + +#pragma omp allocate(d) allocator(nullptr) +extern void *allocator; +#pragma omp allocate(d) allocator(allocator) -- cgit v1.2.3 From 75f1e8f006eeba5eb29f7976bfe0af66d32e8874 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 12 Mar 2019 20:05:17 +0000 Subject: [OPENMP]Allow to redefine entry for the variables definitions. If the variable was declared and marked as declare target, a new offload entry with size 0 is created. But if later a definition is created and marked as declare target, this definition is not added to the entry set and the definition remains not mapped to the target. Patch fixes this problem allowing to redefine the size and linkage for previously registered declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355960 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_target_codegen.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_target_codegen.cpp b/test/OpenMP/declare_target_codegen.cpp index cc7525a44b..933af34d84 100644 --- a/test/OpenMP/declare_target_codegen.cpp +++ b/test/OpenMP/declare_target_codegen.cpp @@ -17,6 +17,7 @@ // CHECK-NOT: @{{hhh|ggg|fff|eee}} = // CHECK-DAG: @aaa = external global i32, // CHECK-DAG: @bbb = global i32 0, +// CHECK-DAG: weak constant %struct.__tgt_offload_entry { i8* bitcast (i32* @bbb to i8*), // CHECK-DAG: @ccc = external global i32, // CHECK-DAG: @ddd = global i32 0, // CHECK-DAG: @hhh_decl_tgt_link_ptr = common global i32* null @@ -31,17 +32,24 @@ // CHECK-DAG: [[STAT:@.+stat]] = internal global %struct.S zeroinitializer, // CHECK-DAG: [[STAT_REF:@.+]] = internal constant %struct.S* [[STAT]] // CHECK-DAG: @out_decl_target = global i32 0, -// CHECK-DAG: @llvm.used = appending global [6 x i8*] [i8* bitcast (void ()* @__omp_offloading__{{.+}}_globals_l[[@LINE+69]]_ctor to i8*), i8* bitcast (void ()* @__omp_offloading__{{.+}}_stat_l[[@LINE+70]]_ctor to i8*), +// CHECK-DAG: @llvm.used = appending global [6 x i8*] [i8* bitcast (void ()* @__omp_offloading__{{.+}}_globals_l[[@LINE+80]]_ctor to i8*), i8* bitcast (void ()* @__omp_offloading__{{.+}}_stat_l[[@LINE+81]]_ctor to i8*), // CHECK-DAG: @llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (%struct.S** [[STAT_REF]] to i8*)], // CHECK-DAG: define {{.*}}i32 @{{.*}}{{foo|bar|baz2|baz3|FA|f_method}}{{.*}}() // CHECK-DAG: define {{.*}}void @{{.*}}TemplateClass{{.*}}(%class.TemplateClass* %{{.*}}) // CHECK-DAG: define {{.*}}i32 @{{.*}}TemplateClass{{.*}}f_method{{.*}}(%class.TemplateClass* %{{.*}}) -// CHECK-DAG: define {{.*}}void @__omp_offloading__{{.*}}_globals_l[[@LINE+63]]_ctor() +// CHECK-DAG: define {{.*}}void @__omp_offloading__{{.*}}_globals_l[[@LINE+74]]_ctor() #ifndef HEADER #define HEADER +#pragma omp declare target +extern int bbb; +#pragma omp end declare target +#pragma omp declare target +extern int bbb; +#pragma omp end declare target + #pragma omp declare target extern int aaa; int bbb = 0; @@ -49,6 +57,10 @@ extern int ccc; int ddd = 0; #pragma omp end declare target +#pragma omp declare target +extern int bbb; +#pragma omp end declare target + extern int eee; int fff = 0; extern int ggg; -- cgit v1.2.3 From d6626f448a2bcb40cc1a318971abdc98c9072ec2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 13 Mar 2019 18:21:10 +0000 Subject: [OPENMP][NVPTX]Fix PR40893: Size doesn't match for '_openmp_teams_reductions_buffer_$_. nvlink does not handle weak linkage correctly, same symbols with the different sizes are reported as erroneous though the largest size must be chosen instead. Patch fixes this problem by using Internal linkage instead of the Common. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356072 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_teams_reduction_codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_teams_reduction_codegen.cpp b/test/OpenMP/nvptx_teams_reduction_codegen.cpp index d5a275a554..a8e22d82b2 100644 --- a/test/OpenMP/nvptx_teams_reduction_codegen.cpp +++ b/test/OpenMP/nvptx_teams_reduction_codegen.cpp @@ -28,7 +28,7 @@ // CHECK-DAG: {{@__omp_offloading_.+l47}}_exec_mode = weak constant i8 1 // CHECK-DAG: {{@__omp_offloading_.+l54}}_exec_mode = weak constant i8 0 -// CHECK-DAG: [[TEAMS_RED_BUFFER:@.+]] = common global [[TEAMS_REDUCE_UNION_TY]] zeroinitializer +// CHECK-DAG: [[TEAMS_RED_BUFFER:@.+]] = internal global [[TEAMS_REDUCE_UNION_TY]] zeroinitializer template tx ftemplate(int n) { -- cgit v1.2.3 From 05277972dbf13464c071398827ea5ea16a50f1dc Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 13 Mar 2019 19:31:34 +0000 Subject: [OPENMP]Disable ADL in C for user-defined reductions. C does not support ADL, disable it for C to prevent compiler crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356089 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_reduction_messages.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_reduction_messages.c b/test/OpenMP/declare_reduction_messages.c index 39387c795a..27e9e6e2e2 100644 --- a/test/OpenMP/declare_reduction_messages.c +++ b/test/OpenMP/declare_reduction_messages.c @@ -41,7 +41,17 @@ int temp; // expected-note 6 {{'temp' declared here}} #pragma omp declare reduction(fun8 : long : omp_out += omp_in) initializer(omp_priv = 23)) // expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}} expected-error {{redefinition of user-defined reduction for type 'long'}} #pragma omp declare reduction(fun9 : long : omp_out += omp_in) initializer(omp_priv = ) // expected-error {{expected expression}} +struct S { + int s; +}; +#pragma omp declare reduction(+: struct S: omp_out.s += omp_in.s) // initializer(omp_priv = { .s = 0 }) + int fun(int arg) { + struct S s;// expected-note {{'s' defined here}} + s.s = 0; +#pragma omp parallel for reduction(+ : s) // expected-error {{list item of type 'struct S' is not valid for specified reduction operation: unable to provide default initialization value}} + for (arg = 0; arg < 10; ++arg) + s.s += arg; #pragma omp declare reduction(red : int : omp_out++) { #pragma omp declare reduction(red : int : omp_out++) // expected-note {{previous definition is here}} -- cgit v1.2.3 From 6371f3f160439dcaa0e384e6871a0b984a74f3fe Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 13 Mar 2019 20:46:28 +0000 Subject: [OPENMP]Fix PR37283: Assertion failure on openmp task with by reference array. If the firstprivate variable is a reference, we may incorrectly classify the kind of the private copy. Use the type of the private copy instead of the original shared variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356098 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/task_firstprivate_codegen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/task_firstprivate_codegen.cpp b/test/OpenMP/task_firstprivate_codegen.cpp index 09b1deabde..dc0ba8ac67 100644 --- a/test/OpenMP/task_firstprivate_codegen.cpp +++ b/test/OpenMP/task_firstprivate_codegen.cpp @@ -473,12 +473,13 @@ struct St { ~St() {} }; -void array_func(int n, float a[n], St s[2]) { +void array_func(int n, float a[n], St s[2], int(& p)[1]) { // ARRAY: call i8* @__kmpc_omp_task_alloc( // ARRAY: call i32 @__kmpc_omp_task( // ARRAY: store float** %{{.+}}, float*** %{{.+}}, // ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}}, -#pragma omp task firstprivate(a, s) +// ARRAY: store [1 x i32]* %{{.+}}, [1 x i32]** %{{.+}}, +#pragma omp task firstprivate(a, s, p) ; } #endif -- cgit v1.2.3 From bb8bb54e3357f85510e22cebf5cb21e89a57ffb1 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 14 Mar 2019 20:36:00 +0000 Subject: [OPENMP]Fix crash for the ordered(n) clause. If the doacross lop construct is used and the loop counter is declare outside of the loop, the compiler might crash trying to get the address of the loop counter. Patch fixes this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356198 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/ordered_doacross_codegen.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/ordered_doacross_codegen.cpp b/test/OpenMP/ordered_doacross_codegen.cpp index 2f19e9c2d5..a3abf248d7 100644 --- a/test/OpenMP/ordered_doacross_codegen.cpp +++ b/test/OpenMP/ordered_doacross_codegen.cpp @@ -16,6 +16,17 @@ extern int n; int a[10], b[10], c[10], d[10]; void foo(); +// CHECK-LABEL:bar +void bar() { + int i,j; +// CHECK: call void @__kmpc_doacross_init( +// CHECK: call void @__kmpc_doacross_fini( +#pragma omp parallel for ordered(2) + for (i = 0; i < n; ++i) + for (j = 0; j < n; ++j) + a[i] = b[i] + 1; +} + // CHECK-LABEL: @main() int main() { int i; @@ -35,7 +46,7 @@ int main() { // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 1, i8* [[CAST]]) // CHECK: call void @__kmpc_for_static_init_4( #pragma omp for ordered(1) - for (i = 0; i < n; ++i) { + for (int i = 0; i < n; ++i) { a[i] = b[i] + 1; foo(); // CHECK: invoke void [[FOO:.+]]( -- cgit v1.2.3 From 2bc6178db36348e53054ce2f5b7816da1bae580e Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 18 Mar 2019 18:40:00 +0000 Subject: [OPENMP] Set scheduling for doacross loops as schedule, 1. The default scheduling for doacross loops is changed from static to static, 1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356388 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/ordered_doacross_codegen.c | 2 +- test/OpenMP/ordered_doacross_codegen.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/ordered_doacross_codegen.c b/test/OpenMP/ordered_doacross_codegen.c index a6cd4fe48b..734d97a439 100644 --- a/test/OpenMP/ordered_doacross_codegen.c +++ b/test/OpenMP/ordered_doacross_codegen.c @@ -33,7 +33,7 @@ int main() { // CHECK: [[DIM:%.+]] = getelementptr inbounds [1 x [[KMP_DIM]]], [1 x [[KMP_DIM]]]* [[DIMS]], i64 0, i64 0 // CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIM]] to i8* // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 1, i8* [[CAST]]) -// CHECK: call void @__kmpc_for_static_init_4( +// CHECK: call void @__kmpc_for_static_init_4(%struct.ident_t* @{{.+}}, i32 [[GTID]], i32 33, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) #pragma omp for ordered(1) for (i = 0; i < n; ++i) { a[i] = b[i] + 1; diff --git a/test/OpenMP/ordered_doacross_codegen.cpp b/test/OpenMP/ordered_doacross_codegen.cpp index a3abf248d7..2b610a270d 100644 --- a/test/OpenMP/ordered_doacross_codegen.cpp +++ b/test/OpenMP/ordered_doacross_codegen.cpp @@ -44,7 +44,7 @@ int main() { // CHECK: [[DIM:%.+]] = getelementptr inbounds [1 x [[KMP_DIM]]], [1 x [[KMP_DIM]]]* [[DIMS]], i64 0, i64 0 // CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIM]] to i8* // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 1, i8* [[CAST]]) -// CHECK: call void @__kmpc_for_static_init_4( +// CHECK: call void @__kmpc_for_static_init_4(%struct.ident_t* @{{.+}}, i32 [[GTID]], i32 33, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) #pragma omp for ordered(1) for (int i = 0; i < n; ++i) { a[i] = b[i] + 1; @@ -113,7 +113,7 @@ struct TestStruct { // CHECK: [[DIM:%.+]] = getelementptr inbounds [2 x [[KMP_DIM]]], [2 x [[KMP_DIM]]]* [[DIMS]], i64 0, i64 0 // CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIM]] to i8* // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 2, i8* [[CAST]]) -// CHECK: call void @__kmpc_for_static_init_4( +// CHECK: call void @__kmpc_for_static_init_4(%struct.ident_t* @{{.+}}, i32 [[GTID]], i32 33, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) #pragma omp for ordered(2) for (T j = 0; j < M; j++) for (i = 0; i < n; i += 2) { -- cgit v1.2.3 From eaba54eacac4dc55ecd5a5bd8b32d3cc679542e6 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 19 Mar 2019 16:41:16 +0000 Subject: [OPENMP] Codegen for local variables with the allocate pragma. Added initial codegen for the local variables with the #pragma omp allocate directive. Instead of allocating the variables on the stack, __kmpc_alloc|__kmpc_free functions are used for memory (de-)allocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356472 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_ast_print.cpp | 20 +++--- test/OpenMP/allocate_codegen.cpp | 102 +++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 test/OpenMP/allocate_codegen.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_ast_print.cpp b/test/OpenMP/allocate_allocator_ast_print.cpp index 7a42dda2c5..a9e838dc7c 100644 --- a/test/OpenMP/allocate_allocator_ast_print.cpp +++ b/test/OpenMP/allocate_allocator_ast_print.cpp @@ -1,16 +1,16 @@ -// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -ast-print %s -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -ast-print %s -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -o - | FileCheck %s -// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -ast-print %s -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -ast-print %s -o - | FileCheck %s // RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -o - | FileCheck %s // expected-no-diagnostics #ifndef HEADER @@ -82,6 +82,10 @@ int main () { #pragma omp allocate(a) allocator(omp_thread_mem_alloc) // CHECK-NEXT: #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; + int b = 3; +// CHECK: int b = 3; +#pragma omp allocate(b) +// CHECK-NEXT: #pragma omp allocate(b) return (foo()); } diff --git a/test/OpenMP/allocate_codegen.cpp b/test/OpenMP/allocate_codegen.cpp new file mode 100644 index 0000000000..eac2b9f388 --- /dev/null +++ b/test/OpenMP/allocate_codegen.cpp @@ -0,0 +1,102 @@ +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s + +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -emit-llvm -o - %s | FileCheck --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -triple x86_64-apple-darwin10.6.0 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck --check-prefix SIMD-ONLY0 %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp-simd -fnoopenmp-use-tls -triple x86_64-unknown-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s +// SIMD-ONLY0-NOT: {{__kmpc|__tgt}} +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + +struct St{ + int a; +}; + +struct St1{ + int a; + static int b; +#pragma omp allocate(b) allocator(omp_default_mem_alloc) +} d; + +int a, b; +#pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) +#pragma omp allocate(a) allocator(omp_const_mem_alloc) +#pragma omp allocate(d, b) allocator(omp_high_bw_mem_alloc) + +template +struct ST { + static T m; + #pragma omp allocate(m) allocator(omp_low_lat_mem_alloc) +}; + +template T foo() { + T v; + #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) + v = ST::m; + return v; +} + +namespace ns{ + int a; +} +#pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) + +// CHECK-NOT: call {{.+}} {{__kmpc_alloc|__kmpc_free}} + +// CHECK-LABEL: @main +int main () { + static int a; +#pragma omp allocate(a) allocator(omp_thread_mem_alloc) + a=2; + // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) + // CHECK-NEXT: [[B_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 8, i8** null) + // CHECK-NEXT: [[B_ADDR:%.+]] = bitcast i8* [[B_VOID_ADDR]] to double* + // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} + // CHECK: store double 3.000000e+00, double* [[B_ADDR]], + // CHECK: [[RES:%.+]] = call i32 [[FOO:@.+]]() + // CHECK: store i32 [[RES]], i32* [[RET:%.+]], + // CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[B_VOID_ADDR]], i8** null) + // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} + double b = 3; +#pragma omp allocate(b) + // CHECK: [[RETVAL:%.+]] = load i32, i32* [[RET]], + // CHECK: ret i32 [[RETVAL]] + return (foo()); +} + +// CHECK-NOT: call {{.+}} {{__kmpc_alloc|__kmpc_free}} + +// CHECK: define {{.*}}i32 [[FOO]]() +// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) +// CHECK-NEXT: [[OMP_CGROUP_MEM_ALLOC:%.+]] = load i8**, i8*** @omp_cgroup_mem_alloc, +// CHECK-NEXT: [[V_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[OMP_CGROUP_MEM_ALLOC]]) +// CHECK-NEXT: [[V_ADDR:%.+]] = bitcast i8* [[V_VOID_ADDR]] to i32* +// CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} +// CHECK: store i32 %{{.+}}, i32* [[V_ADDR]], +// CHECK-NEXT: [[V_VAL:%.+]] = load i32, i32* [[V_ADDR]], +// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[V_VOID_ADDR]], i8** [[OMP_CGROUP_MEM_ALLOC]]) +// CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} +// CHECK: ret i32 [[V_VAL]] + +// CHECK-NOT: call {{.+}} {{__kmpc_alloc|__kmpc_free}} +extern template int ST::m; +#endif -- cgit v1.2.3 From 23e5d23710c537c358580c137a3f1ea10c425b9c Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 19 Mar 2019 18:39:11 +0000 Subject: [OPENMP]Check that global vars require predefined allocator. According to OpenMP, 2.11.3 allocate Directive, Restrictions, C / C++, if a list item has a static storage type, the allocator expression in the allocator clause must be a constant expression that evaluates to one of the predefined memory allocator values. Added check for this restriction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356496 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_messages.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_messages.cpp b/test/OpenMP/allocate_allocator_messages.cpp index 0f616dfb7e..b5af2b5f71 100644 --- a/test/OpenMP/allocate_allocator_messages.cpp +++ b/test/OpenMP/allocate_allocator_messages.cpp @@ -20,8 +20,10 @@ struct St1{ int a; static int b; #pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'omp_allocator_handle_t' (aka 'void *') with an expression of incompatible type 'int'}} -} d; +} d; // expected-note 2 {{'d' defined here}} +// expected-error@+1 {{expected one of the predefined allocators for the variables with the static storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', 'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'}} #pragma omp allocate(d) allocator(nullptr) extern void *allocator; +// expected-error@+1 {{expected one of the predefined allocators for the variables with the static storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', 'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'}} #pragma omp allocate(d) allocator(allocator) -- cgit v1.2.3 From c96f4c0bde7858f97b310c87ea824c458301e169 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 19 Mar 2019 20:33:44 +0000 Subject: [OPENMP]Warn if the different allocator is used for the variable. If the allocator was specified for the variable and next one is found with the different allocator, the warning is emitted, and the allocator is ignored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356513 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_ast_print.cpp | 11 ++++++----- test/OpenMP/allocate_allocator_messages.cpp | 17 ++++++++++++++--- test/OpenMP/allocate_codegen.cpp | 6 +++--- 3 files changed, 23 insertions(+), 11 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_ast_print.cpp b/test/OpenMP/allocate_allocator_ast_print.cpp index a9e838dc7c..02c669e157 100644 --- a/test/OpenMP/allocate_allocator_ast_print.cpp +++ b/test/OpenMP/allocate_allocator_ast_print.cpp @@ -38,15 +38,16 @@ struct St1{ // CHECK-NEXT: #pragma omp allocate(St1::b) allocator(omp_default_mem_alloc){{$}} } d; -int a, b; +int a, b, c; // CHECK: int a; // CHECK: int b; +// CHECK: int c; #pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) -#pragma omp allocate(a) allocator(omp_const_mem_alloc) +#pragma omp allocate(b) allocator(omp_const_mem_alloc) // CHECK-NEXT: #pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) -// CHECK-NEXT: #pragma omp allocate(a) allocator(omp_const_mem_alloc) -#pragma omp allocate(d, b) allocator(omp_high_bw_mem_alloc) -// CHECK-NEXT: #pragma omp allocate(d,b) allocator(omp_high_bw_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(b) allocator(omp_const_mem_alloc) +#pragma omp allocate(c, d) allocator(omp_high_bw_mem_alloc) +// CHECK-NEXT: #pragma omp allocate(c,d) allocator(omp_high_bw_mem_alloc) template struct ST { diff --git a/test/OpenMP/allocate_allocator_messages.cpp b/test/OpenMP/allocate_allocator_messages.cpp index b5af2b5f71..db7d53d2f2 100644 --- a/test/OpenMP/allocate_allocator_messages.cpp +++ b/test/OpenMP/allocate_allocator_messages.cpp @@ -14,16 +14,27 @@ int sss; #pragma omp allocate(sss) allocator(0,sss) // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} #pragma omp allocate(sss) allocator(sss) // expected-error {{omp_allocator_handle_t type not found; include }} -typedef void *omp_allocator_handle_t; +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_thread_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; struct St1{ int a; static int b; -#pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'omp_allocator_handle_t' (aka 'void *') with an expression of incompatible type 'int'}} +#pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'omp_allocator_handle_t' (aka 'void **') with an expression of incompatible type 'int'}} expected-note {{previous allocator is specified here}} +#pragma omp allocate(b) +#pragma omp allocate(b) allocator(omp_thread_mem_alloc) // expected-warning {{allocate directive specifies 'omp_thread_mem_alloc' allocator while previously used default}} } d; // expected-note 2 {{'d' defined here}} // expected-error@+1 {{expected one of the predefined allocators for the variables with the static storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', 'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'}} #pragma omp allocate(d) allocator(nullptr) -extern void *allocator; +extern void **allocator; // expected-error@+1 {{expected one of the predefined allocators for the variables with the static storage: 'omp_default_mem_alloc', 'omp_large_cap_mem_alloc', 'omp_const_mem_alloc', 'omp_high_bw_mem_alloc', 'omp_low_lat_mem_alloc', 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc' or 'omp_thread_mem_alloc'}} #pragma omp allocate(d) allocator(allocator) +#pragma omp allocate(d) allocator(omp_thread_mem_alloc) // expected-note {{previous allocator is specified here}} +#pragma omp allocate(d) // expected-warning {{allocate directive specifies default allocator while previously used 'omp_thread_mem_alloc'}} + +int c; +#pragma omp allocate(c) allocator(omp_thread_mem_alloc) // expected-note {{previous allocator is specified here}} +#pragma omp allocate(c) allocator(omp_high_bw_mem_alloc) // expected-warning {{allocate directive specifies 'omp_high_bw_mem_alloc' allocator while previously used 'omp_thread_mem_alloc'}} + diff --git a/test/OpenMP/allocate_codegen.cpp b/test/OpenMP/allocate_codegen.cpp index eac2b9f388..6239ded455 100644 --- a/test/OpenMP/allocate_codegen.cpp +++ b/test/OpenMP/allocate_codegen.cpp @@ -37,10 +37,10 @@ struct St1{ #pragma omp allocate(b) allocator(omp_default_mem_alloc) } d; -int a, b; +int a, b, c; #pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) -#pragma omp allocate(a) allocator(omp_const_mem_alloc) -#pragma omp allocate(d, b) allocator(omp_high_bw_mem_alloc) +#pragma omp allocate(b) allocator(omp_const_mem_alloc) +#pragma omp allocate(d, c) allocator(omp_high_bw_mem_alloc) template struct ST { -- cgit v1.2.3 From da1812dcb198a84f6c45919e4ba7e0cf035238c8 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 20 Mar 2019 20:14:22 +0000 Subject: [OPENMP]Improve detection of omp_allocator_handle_t type and predefined allocators. It is better to deduce omp_allocator_handle_t type from the predefined allocators, because omp.h header might not define it explicitly. Plus, it allows to identify the predefined allocators correctly when trying to build the allcoator for the global variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356607 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_messages.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_messages.cpp b/test/OpenMP/allocate_allocator_messages.cpp index db7d53d2f2..97f5d6f564 100644 --- a/test/OpenMP/allocate_allocator_messages.cpp +++ b/test/OpenMP/allocate_allocator_messages.cpp @@ -15,13 +15,19 @@ int sss; #pragma omp allocate(sss) allocator(sss) // expected-error {{omp_allocator_handle_t type not found; include }} typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +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 St1{ int a; static int b; -#pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'omp_allocator_handle_t' (aka 'void **') with an expression of incompatible type 'int'}} expected-note {{previous allocator is specified here}} +#pragma omp allocate(b) allocator(sss) // expected-error {{initializing 'const omp_allocator_handle_t' (aka 'void **const') with an expression of incompatible type 'int'}} expected-note {{previous allocator is specified here}} #pragma omp allocate(b) #pragma omp allocate(b) allocator(omp_thread_mem_alloc) // expected-warning {{allocate directive specifies 'omp_thread_mem_alloc' allocator while previously used default}} } d; // expected-note 2 {{'d' defined here}} -- cgit v1.2.3 From bf77be7a1ebf54d2f3b6260bb905ed04e9314049 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 21 Mar 2019 19:35:27 +0000 Subject: [OPENMP]Codegen support for allocate directive on global variables. For the global variables the allocate directive must specify only the predefined allocator. This allocator must be translated into the correct form of the address space for the targets that support different address spaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356702 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_allocate_codegen.cpp | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 test/OpenMP/nvptx_allocate_codegen.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_allocate_codegen.cpp b/test/OpenMP/nvptx_allocate_codegen.cpp new file mode 100644 index 0000000000..e9b9509334 --- /dev/null +++ b/test/OpenMP/nvptx_allocate_codegen.cpp @@ -0,0 +1,71 @@ +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc -o %t-host.bc %s +// RUN: %clang_cc1 -verify -fopenmp -triple nvptx64-nvidia-cuda -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +#pragma omp declare target +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; + +// CHECK-DAG: @{{.+}}St1{{.+}}b{{.+}} = external global i32, +// CHECK-DAG: @a = global i32 0, +// CHECK-DAG: @b = addrspace(4) global i32 0, +// CHECK-DAG: @c = global i32 0, +// CHECK-DAG: @d = global %struct.St1 zeroinitializer, +// CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} = addrspace(3) global i32 0, +// CHECK-DAG: @{{.+}}main{{.+}}a{{.*}} = internal global i32 0, +// CHECK-DAG: @{{.+}}ST{{.+}}m{{.+}} = external global i32, +struct St{ + int a; +}; + +struct St1{ + int a; + static int b; +#pragma omp allocate(b) allocator(omp_default_mem_alloc) +} d; + +int a, b, c; +#pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) +#pragma omp allocate(b) allocator(omp_const_mem_alloc) +#pragma omp allocate(d, c) allocator(omp_high_bw_mem_alloc) + +template +struct ST { + static T m; + #pragma omp allocate(m) allocator(omp_low_lat_mem_alloc) +}; + +template T foo() { + T v; + #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) + v = ST::m; + return v; +} + +namespace ns{ + int a; +} +#pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) + +int main () { + static int a; +#pragma omp allocate(a) allocator(omp_thread_mem_alloc) + a=2; + double b = 3; +#pragma omp allocate(b) + return (foo()); +} + +extern template int ST::m; +#pragma omp end declare target +#endif -- cgit v1.2.3 From a91bba1be08af6be68b577cd0e2a237c728f1a03 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 21 Mar 2019 20:36:16 +0000 Subject: [OPENMP] Simplify codegen for allocate directive on local variables. Simplified codegen for the allocate directive for local variables, initial implementation of the codegen for NVPTX target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356710 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_codegen.cpp | 14 ++------------ test/OpenMP/nvptx_allocate_codegen.cpp | 5 +++++ 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_codegen.cpp b/test/OpenMP/allocate_codegen.cpp index 6239ded455..daad935336 100644 --- a/test/OpenMP/allocate_codegen.cpp +++ b/test/OpenMP/allocate_codegen.cpp @@ -67,25 +67,15 @@ int main () { static int a; #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; - // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) - // CHECK-NEXT: [[B_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 8, i8** null) - // CHECK-NEXT: [[B_ADDR:%.+]] = bitcast i8* [[B_VOID_ADDR]] to double* // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} - // CHECK: store double 3.000000e+00, double* [[B_ADDR]], - // CHECK: [[RES:%.+]] = call i32 [[FOO:@.+]]() - // CHECK: store i32 [[RES]], i32* [[RET:%.+]], - // CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[B_VOID_ADDR]], i8** null) + // CHECK: alloca double, // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} double b = 3; #pragma omp allocate(b) - // CHECK: [[RETVAL:%.+]] = load i32, i32* [[RET]], - // CHECK: ret i32 [[RETVAL]] return (foo()); } -// CHECK-NOT: call {{.+}} {{__kmpc_alloc|__kmpc_free}} - -// CHECK: define {{.*}}i32 [[FOO]]() +// CHECK: define {{.*}}i32 @{{.+}}foo{{.+}}() // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) // CHECK-NEXT: [[OMP_CGROUP_MEM_ALLOC:%.+]] = load i8**, i8*** @omp_cgroup_mem_alloc, // CHECK-NEXT: [[V_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[OMP_CGROUP_MEM_ALLOC]]) diff --git a/test/OpenMP/nvptx_allocate_codegen.cpp b/test/OpenMP/nvptx_allocate_codegen.cpp index e9b9509334..df6a727c7a 100644 --- a/test/OpenMP/nvptx_allocate_codegen.cpp +++ b/test/OpenMP/nvptx_allocate_codegen.cpp @@ -57,7 +57,9 @@ namespace ns{ } #pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) +// CHECK-LABEL: @main int main () { + // CHECK: alloca double, static int a; #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; @@ -66,6 +68,9 @@ int main () { return (foo()); } +// CHECK: define {{.*}}i32 @{{.+}}foo{{.+}}() +// CHECK: alloca i32, + extern template int ST::m; #pragma omp end declare target #endif -- cgit v1.2.3 From c1e4e8b66b8cc9ef54bc6484cb724e664798ae57 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Mar 2019 14:41:39 +0000 Subject: [OPENMP]Emit error message for allocate directive without allocator clause in target region. According to the OpenMP 5.0, 2.11.3 allocate Directive, Restrictions, allocate directives that appear in a target region must specify an allocator clause unless a requires directive with the dynamic_allocators clause is present in the same compilation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356752 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_allocate_codegen.cpp | 2 +- test/OpenMP/nvptx_allocate_messages.cpp | 80 +++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 test/OpenMP/nvptx_allocate_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_allocate_codegen.cpp b/test/OpenMP/nvptx_allocate_codegen.cpp index df6a727c7a..ec1faff426 100644 --- a/test/OpenMP/nvptx_allocate_codegen.cpp +++ b/test/OpenMP/nvptx_allocate_codegen.cpp @@ -64,7 +64,7 @@ int main () { #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; double b = 3; -#pragma omp allocate(b) +#pragma omp allocate(b) allocator(omp_default_mem_alloc) return (foo()); } diff --git a/test/OpenMP/nvptx_allocate_messages.cpp b/test/OpenMP/nvptx_allocate_messages.cpp new file mode 100644 index 0000000000..99aef4338d --- /dev/null +++ b/test/OpenMP/nvptx_allocate_messages.cpp @@ -0,0 +1,80 @@ +// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc -o %t-host.bc %s +// RUN: %clang_cc1 -verify -DDEVICE -fopenmp -triple nvptx64-nvidia-cuda -fopenmp-targets=nvptx64-nvidia-cuda -fsyntax-only %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc +#ifndef DEVICE +// expected-no-diagnostics +#endif // DEVICE + +#ifndef HEADER +#define HEADER + +int bar() { + int res = 0; +#ifdef DEVICE +// expected-error@+2 {{expected an 'allocator' clause inside of the target region; provide an 'allocator' clause or use 'requires' directive with the 'dynamic_allocators' clause}} +#endif // DEVICE +#pragma omp allocate(res) + return 0; +} + +#pragma omp declare target +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 St{ + int a; +}; + +struct St1{ + int a; + static int b; +#pragma omp allocate(b) allocator(omp_default_mem_alloc) +} d; + +int a, b, c; +#pragma omp allocate(a) allocator(omp_large_cap_mem_alloc) +#pragma omp allocate(b) allocator(omp_const_mem_alloc) +#pragma omp allocate(d, c) allocator(omp_high_bw_mem_alloc) + +template +struct ST { + static T m; + #pragma omp allocate(m) allocator(omp_low_lat_mem_alloc) +}; + +template T foo() { + T v; + #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) + v = ST::m; + return v; +} + +namespace ns{ + int a; +} +#pragma omp allocate(ns::a) allocator(omp_pteam_mem_alloc) + +int main () { + static int a; +#pragma omp allocate(a) allocator(omp_thread_mem_alloc) + a=2; + double b = 3; +#ifdef DEVICE +// expected-error@+2 {{expected an 'allocator' clause inside of the target region; provide an 'allocator' clause or use 'requires' directive with the 'dynamic_allocators' clause}} +#endif // DEVICE +#pragma omp allocate(b) +#ifdef DEVICE +// expected-note@+2 {{called by 'main'}} +#endif // DEVICE + return (foo() + bar()); +} + +extern template int ST::m; +#pragma omp end declare target +#endif -- cgit v1.2.3 From 2bfaf970c6ec8691877d16a7e7a83b41bd7282c9 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Mar 2019 15:25:12 +0000 Subject: [OPENMP]Allow no allocator clause in target regions with requires dynamic_allocators. According to the OpenMP 5.0, 2.11.3 allocate Directive, Restrictions, allocate directives that appear in a target region must specify an allocator clause unless a requires directive with the dynamic_allocators clause is present in the same compilation unit. Patch adds a check for a presence of the requires directive with the dynamic_allocators clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356758 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_allocate_messages.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_allocate_messages.cpp b/test/OpenMP/nvptx_allocate_messages.cpp index 99aef4338d..5bb9422227 100644 --- a/test/OpenMP/nvptx_allocate_messages.cpp +++ b/test/OpenMP/nvptx_allocate_messages.cpp @@ -1,17 +1,22 @@ // RUN: %clang_cc1 -verify -fopenmp -triple x86_64-apple-darwin10.6.0 -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc -o %t-host.bc %s // RUN: %clang_cc1 -verify -DDEVICE -fopenmp -triple nvptx64-nvidia-cuda -fopenmp-targets=nvptx64-nvidia-cuda -fsyntax-only %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -#ifndef DEVICE +// RUN: %clang_cc1 -verify -DDEVICE -DREQUIRES -fopenmp -triple nvptx64-nvidia-cuda -fopenmp-targets=nvptx64-nvidia-cuda -fsyntax-only %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc +#if !defined(DEVICE) || defined(REQUIRES) // expected-no-diagnostics #endif // DEVICE #ifndef HEADER #define HEADER +#if defined(REQUIRES) && defined(DEVICE) +#pragma omp requires dynamic_allocators +#endif // REQUIRES && DEVICE + int bar() { int res = 0; -#ifdef DEVICE +#if defined(DEVICE) && !defined(REQUIRES) // expected-error@+2 {{expected an 'allocator' clause inside of the target region; provide an 'allocator' clause or use 'requires' directive with the 'dynamic_allocators' clause}} -#endif // DEVICE +#endif // DEVICE && !REQUIRES #pragma omp allocate(res) return 0; } @@ -65,13 +70,13 @@ int main () { #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; double b = 3; -#ifdef DEVICE +#if defined(DEVICE) && !defined(REQUIRES) // expected-error@+2 {{expected an 'allocator' clause inside of the target region; provide an 'allocator' clause or use 'requires' directive with the 'dynamic_allocators' clause}} -#endif // DEVICE +#endif // DEVICE && !REQUIRES #pragma omp allocate(b) -#ifdef DEVICE +#if defined(DEVICE) && !defined(REQUIRES) // expected-note@+2 {{called by 'main'}} -#endif // DEVICE +#endif // DEVICE && !REQUIRES return (foo() + bar()); } -- cgit v1.2.3 From 18917301298ad6df9e989983ed1e22cb0f9dff29 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 27 Mar 2019 14:14:31 +0000 Subject: [OPENMP]Initial support for 'allocate' clause. Added parsing/sema analysis of the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357068 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_allocator_messages.cpp | 3 ++- test/OpenMP/atomic_messages.c | 4 ++-- test/OpenMP/barrier_messages.cpp | 1 + test/OpenMP/cancel_messages.cpp | 2 +- test/OpenMP/cancellation_point_messages.cpp | 2 +- test/OpenMP/critical_messages.cpp | 2 +- test/OpenMP/declare_mapper_messages.c | 2 +- test/OpenMP/declare_reduction_messages.cpp | 2 +- test/OpenMP/declare_simd_messages.cpp | 4 ++-- test/OpenMP/declare_target_messages.cpp | 2 +- test/OpenMP/distribute_ast_print.cpp | 10 +++++----- test/OpenMP/distribute_firstprivate_messages.cpp | 4 +++- test/OpenMP/distribute_parallel_for_ast_print.cpp | 8 ++++---- .../distribute_parallel_for_firstprivate_messages.cpp | 3 ++- .../distribute_parallel_for_lastprivate_messages.cpp | 4 ++-- test/OpenMP/distribute_parallel_for_private_messages.cpp | 3 ++- .../distribute_parallel_for_reduction_messages.cpp | 3 ++- test/OpenMP/distribute_parallel_for_simd_ast_print.cpp | 8 ++++---- ...istribute_parallel_for_simd_firstprivate_messages.cpp | 3 ++- ...distribute_parallel_for_simd_lastprivate_messages.cpp | 3 ++- .../distribute_parallel_for_simd_linear_messages.cpp | 3 ++- .../distribute_parallel_for_simd_private_messages.cpp | 3 ++- .../distribute_parallel_for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/distribute_private_messages.cpp | 3 ++- test/OpenMP/distribute_simd_ast_print.cpp | 10 +++++----- test/OpenMP/distribute_simd_firstprivate_messages.cpp | 3 ++- test/OpenMP/distribute_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/distribute_simd_linear_messages.cpp | 3 ++- test/OpenMP/distribute_simd_private_messages.cpp | 3 ++- test/OpenMP/distribute_simd_reduction_messages.cpp | 3 ++- test/OpenMP/flush_messages.cpp | 2 +- test/OpenMP/for_ast_print.cpp | 8 ++++---- test/OpenMP/for_firstprivate_messages.cpp | 3 ++- test/OpenMP/for_lastprivate_messages.cpp | 3 ++- test/OpenMP/for_linear_messages.cpp | 3 ++- test/OpenMP/for_private_messages.cpp | 3 ++- test/OpenMP/for_reduction_messages.cpp | 3 ++- test/OpenMP/for_simd_ast_print.cpp | 6 +++--- test/OpenMP/for_simd_firstprivate_messages.cpp | 3 ++- test/OpenMP/for_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/for_simd_linear_messages.cpp | 3 ++- test/OpenMP/for_simd_private_messages.cpp | 3 ++- test/OpenMP/for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/master_messages.cpp | 2 +- test/OpenMP/ordered_messages.cpp | 2 +- test/OpenMP/parallel_ast_print.cpp | 8 ++++---- test/OpenMP/parallel_firstprivate_messages.cpp | 3 ++- test/OpenMP/parallel_for_ast_print.cpp | 8 ++++---- test/OpenMP/parallel_for_firstprivate_messages.cpp | 3 ++- test/OpenMP/parallel_for_lastprivate_messages.cpp | 3 ++- test/OpenMP/parallel_for_linear_messages.cpp | 3 ++- test/OpenMP/parallel_for_private_messages.cpp | 3 ++- test/OpenMP/parallel_for_reduction_messages.cpp | 3 ++- test/OpenMP/parallel_for_simd_ast_print.cpp | 8 ++++---- test/OpenMP/parallel_for_simd_firstprivate_messages.cpp | 3 ++- test/OpenMP/parallel_for_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/parallel_for_simd_linear_messages.cpp | 3 ++- test/OpenMP/parallel_for_simd_private_messages.cpp | 3 ++- test/OpenMP/parallel_for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/parallel_private_messages.cpp | 3 ++- test/OpenMP/parallel_reduction_messages.cpp | 3 ++- test/OpenMP/parallel_sections_ast_print.cpp | 16 ++++++++-------- test/OpenMP/parallel_sections_firstprivate_messages.cpp | 3 ++- test/OpenMP/parallel_sections_lastprivate_messages.cpp | 3 ++- test/OpenMP/parallel_sections_private_messages.cpp | 3 ++- test/OpenMP/parallel_sections_reduction_messages.cpp | 3 ++- test/OpenMP/requires_messages.cpp | 3 ++- test/OpenMP/sections_ast_print.cpp | 8 ++++---- test/OpenMP/sections_firstprivate_messages.cpp | 3 ++- test/OpenMP/sections_lastprivate_messages.cpp | 3 ++- test/OpenMP/sections_private_messages.cpp | 3 ++- test/OpenMP/sections_reduction_messages.cpp | 5 +++-- test/OpenMP/simd_ast_print.cpp | 8 ++++---- test/OpenMP/simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/simd_linear_messages.cpp | 3 ++- test/OpenMP/simd_private_messages.cpp | 3 ++- test/OpenMP/simd_reduction_messages.cpp | 3 ++- test/OpenMP/single_ast_print.cpp | 8 ++++---- test/OpenMP/single_firstprivate_messages.cpp | 3 ++- test/OpenMP/single_private_messages.cpp | 3 ++- test/OpenMP/target_data_messages.c | 2 +- test/OpenMP/target_enter_data_map_messages.c | 2 +- test/OpenMP/target_exit_data_map_messages.c | 2 +- test/OpenMP/target_firstprivate_messages.cpp | 3 ++- test/OpenMP/target_parallel_ast_print.cpp | 16 ++++++++-------- test/OpenMP/target_parallel_firstprivate_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_ast_print.cpp | 8 ++++---- .../OpenMP/target_parallel_for_firstprivate_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_lastprivate_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_linear_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_private_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_reduction_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_simd_ast_print.cpp | 8 ++++---- .../target_parallel_for_simd_firstprivate_messages.cpp | 3 ++- .../target_parallel_for_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/target_parallel_for_simd_linear_messages.cpp | 3 ++- .../OpenMP/target_parallel_for_simd_private_messages.cpp | 3 ++- .../target_parallel_for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/target_parallel_private_messages.cpp | 3 ++- test/OpenMP/target_parallel_reduction_messages.cpp | 3 ++- test/OpenMP/target_private_messages.cpp | 3 ++- test/OpenMP/target_reduction_messages.cpp | 3 ++- test/OpenMP/target_simd_ast_print.cpp | 8 ++++---- test/OpenMP/target_simd_firstprivate_messages.cpp | 3 ++- test/OpenMP/target_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/target_simd_linear_messages.cpp | 3 ++- test/OpenMP/target_simd_private_messages.cpp | 3 ++- test/OpenMP/target_simd_reduction_messages.cpp | 3 ++- test/OpenMP/target_teams_ast_print.cpp | 16 ++++++++-------- test/OpenMP/target_teams_distribute_ast_print.cpp | 6 +++--- .../target_teams_distribute_firstprivate_messages.cpp | 3 ++- .../target_teams_distribute_lastprivate_messages.cpp | 3 ++- .../target_teams_distribute_parallel_for_ast_print.cpp | 4 ++-- ...ams_distribute_parallel_for_firstprivate_messages.cpp | 3 ++- ...eams_distribute_parallel_for_lastprivate_messages.cpp | 3 ++- ...et_teams_distribute_parallel_for_private_messages.cpp | 3 ++- ..._teams_distribute_parallel_for_reduction_messages.cpp | 3 ++- ...rget_teams_distribute_parallel_for_simd_ast_print.cpp | 4 ++-- ...istribute_parallel_for_simd_firstprivate_messages.cpp | 3 ++- ...distribute_parallel_for_simd_lastprivate_messages.cpp | 3 ++- ...eams_distribute_parallel_for_simd_linear_messages.cpp | 3 ++- ...ams_distribute_parallel_for_simd_private_messages.cpp | 3 ++- ...s_distribute_parallel_for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/target_teams_distribute_private_messages.cpp | 3 ++- .../target_teams_distribute_reduction_messages.cpp | 3 ++- test/OpenMP/target_teams_distribute_simd_ast_print.cpp | 4 ++-- ...arget_teams_distribute_simd_firstprivate_messages.cpp | 3 ++- ...target_teams_distribute_simd_lastprivate_messages.cpp | 3 ++- .../target_teams_distribute_simd_linear_messages.cpp | 3 ++- .../target_teams_distribute_simd_private_messages.cpp | 3 ++- .../target_teams_distribute_simd_reduction_messages.cpp | 3 ++- test/OpenMP/target_teams_firstprivate_messages.cpp | 3 ++- test/OpenMP/target_teams_private_messages.cpp | 3 ++- test/OpenMP/target_teams_reduction_messages.cpp | 3 ++- test/OpenMP/target_update_messages.cpp | 2 +- test/OpenMP/task_ast_print.cpp | 8 ++++---- test/OpenMP/task_firstprivate_messages.cpp | 3 ++- test/OpenMP/task_in_reduction_message.cpp | 3 ++- test/OpenMP/task_private_messages.cpp | 3 ++- test/OpenMP/taskgroup_task_reduction_messages.cpp | 3 ++- test/OpenMP/taskloop_ast_print.cpp | 8 ++++---- test/OpenMP/taskloop_firstprivate_messages.cpp | 3 ++- test/OpenMP/taskloop_in_reduction_messages.cpp | 3 ++- test/OpenMP/taskloop_lastprivate_messages.cpp | 3 ++- test/OpenMP/taskloop_private_messages.cpp | 3 ++- test/OpenMP/taskloop_reduction_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_ast_print.cpp | 8 ++++---- test/OpenMP/taskloop_simd_firstprivate_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_in_reduction_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_linear_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_private_messages.cpp | 3 ++- test/OpenMP/taskloop_simd_reduction_messages.cpp | 3 ++- test/OpenMP/taskwait_messages.cpp | 2 +- test/OpenMP/taskyield_messages.cpp | 2 +- test/OpenMP/teams_distribute_ast_print.cpp | 14 ++++++++++++-- test/OpenMP/teams_distribute_firstprivate_messages.cpp | 3 ++- test/OpenMP/teams_distribute_lastprivate_messages.cpp | 3 ++- test/OpenMP/teams_distribute_parallel_for_ast_print.cpp | 4 ++-- ...ams_distribute_parallel_for_firstprivate_messages.cpp | 3 ++- ...eams_distribute_parallel_for_lastprivate_messages.cpp | 3 ++- .../teams_distribute_parallel_for_private_messages.cpp | 3 ++- .../teams_distribute_parallel_for_reduction_messages.cpp | 3 ++- .../teams_distribute_parallel_for_simd_ast_print.cpp | 4 ++-- ...istribute_parallel_for_simd_firstprivate_messages.cpp | 3 ++- ...distribute_parallel_for_simd_lastprivate_messages.cpp | 3 ++- ...eams_distribute_parallel_for_simd_linear_messages.cpp | 3 ++- ...ams_distribute_parallel_for_simd_private_messages.cpp | 3 ++- ...s_distribute_parallel_for_simd_reduction_messages.cpp | 3 ++- test/OpenMP/teams_distribute_private_messages.cpp | 3 ++- test/OpenMP/teams_distribute_reduction_messages.cpp | 3 ++- test/OpenMP/teams_distribute_simd_ast_print.cpp | 4 ++-- .../teams_distribute_simd_firstprivate_messages.cpp | 3 ++- .../teams_distribute_simd_lastprivate_messages.cpp | 3 ++- test/OpenMP/teams_distribute_simd_linear_messages.cpp | 3 ++- test/OpenMP/teams_distribute_simd_private_messages.cpp | 3 ++- test/OpenMP/teams_distribute_simd_reduction_messages.cpp | 3 ++- test/OpenMP/teams_firstprivate_messages.cpp | 3 ++- test/OpenMP/teams_private_messages.cpp | 3 ++- test/OpenMP/teams_reduction_messages.cpp | 3 ++- test/OpenMP/threadprivate_messages.cpp | 2 +- 181 files changed, 413 insertions(+), 269 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_allocator_messages.cpp b/test/OpenMP/allocate_allocator_messages.cpp index 97f5d6f564..5ba4f2a506 100644 --- a/test/OpenMP/allocate_allocator_messages.cpp +++ b/test/OpenMP/allocate_allocator_messages.cpp @@ -7,7 +7,8 @@ struct St{ }; int sss; -#pragma omp allocate(sss) allocate // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(sss) allocat // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}} +#pragma omp allocate(sss) allocate(sss) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp allocate'}} #pragma omp allocate(sss) allocator // expected-error {{expected '(' after 'allocator'}} #pragma omp allocate(sss) allocator(0, // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} #pragma omp allocate(sss) allocator(0,sss // expected-error {{expected ')'}} expected-error {{omp_allocator_handle_t type not found; include }} expected-note {{to match this '('}} diff --git a/test/OpenMP/atomic_messages.c b/test/OpenMP/atomic_messages.c index 1234e8580c..92b7cd5b6a 100644 --- a/test/OpenMP/atomic_messages.c +++ b/test/OpenMP/atomic_messages.c @@ -59,8 +59,8 @@ int readint() { int readS() { struct S a, b; - // expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'read' clause}} -#pragma omp atomic read read + // expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'read' clause}} expected-error@+1 {{unexpected OpenMP clause 'allocate' in directive '#pragma omp atomic'}} +#pragma omp atomic read read allocate(a) // expected-error@+2 {{the statement for 'atomic read' must be an expression statement of form 'v = x;', where v and x are both lvalue expressions with scalar type}} // expected-note@+1 {{expected expression of scalar type}} a = b; diff --git a/test/OpenMP/barrier_messages.cpp b/test/OpenMP/barrier_messages.cpp index 42edc9f46a..589b9c711a 100644 --- a/test/OpenMP/barrier_messages.cpp +++ b/test/OpenMP/barrier_messages.cpp @@ -6,6 +6,7 @@ template T tmain(T argc) { #pragma omp barrier ; +#pragma omp barrier allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp barrier'}} #pragma omp barrier untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp barrier'}} #pragma omp barrier unknown // expected-warning {{extra tokens at the end of '#pragma omp barrier' are ignored}} if (argc) diff --git a/test/OpenMP/cancel_messages.cpp b/test/OpenMP/cancel_messages.cpp index f78b28c1cb..df6dcdf2ff 100644 --- a/test/OpenMP/cancel_messages.cpp +++ b/test/OpenMP/cancel_messages.cpp @@ -45,7 +45,7 @@ int main(int argc, char **argv) { } #pragma omp sections { -#pragma omp cancel parallel // expected-error {{region cannot be closely nested inside 'sections' region}} +#pragma omp cancel parallel allocate(argc) // expected-error {{region cannot be closely nested inside 'sections' region}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp cancel'}} } while (argc) #pragma omp cancel for // expected-error {{'#pragma omp cancel' cannot be an immediate substatement}} expected-error {{orphaned 'omp cancel' directives are prohibited; perhaps you forget to enclose the directive into a region?}} diff --git a/test/OpenMP/cancellation_point_messages.cpp b/test/OpenMP/cancellation_point_messages.cpp index 058818df71..268cab2d80 100644 --- a/test/OpenMP/cancellation_point_messages.cpp +++ b/test/OpenMP/cancellation_point_messages.cpp @@ -10,7 +10,7 @@ int main(int argc, char **argv) { { #pragma omp cancellation point // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}} } -#pragma omp cancellation point parallel untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp cancellation point'}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} +#pragma omp cancellation point parallel untied allocate(argc) // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp cancellation point'}} expected-error {{orphaned 'omp cancellation point' directives are prohibited; perhaps you forget to enclose the directive into a region?}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp cancellation point'}} #pragma omp cancellation point unknown // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}} #pragma omp parallel { diff --git a/test/OpenMP/critical_messages.cpp b/test/OpenMP/critical_messages.cpp index a04d2e5223..9222233d4a 100644 --- a/test/OpenMP/critical_messages.cpp +++ b/test/OpenMP/critical_messages.cpp @@ -8,7 +8,7 @@ template int tmain(int argc, char **argv) { // expected-note {{declared here}} #pragma omp critical ; - #pragma omp critical untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp critical'}} + #pragma omp critical untied allocate(argc) // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp critical'}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp critical'}} #pragma omp critical unknown // expected-warning {{extra tokens at the end of '#pragma omp critical' are ignored}} #pragma omp critical ( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp critical ( + // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}} diff --git a/test/OpenMP/declare_mapper_messages.c b/test/OpenMP/declare_mapper_messages.c index 4df14b62d5..51b761e224 100644 --- a/test/OpenMP/declare_mapper_messages.c +++ b/test/OpenMP/declare_mapper_messages.c @@ -34,7 +34,7 @@ int fun(int arg) { #pragma omp declare mapper(id: struct vec v) map(v.len) // expected-note {{previous definition is here}} #pragma omp declare mapper(id: struct vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'struct vec' with name 'id'}} { -#pragma omp declare mapper(id: struct vec v) map(v.len) +#pragma omp declare mapper(id: struct vec v) map(v.len) allocate(v) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp declare mapper'}} struct vec vv, v1; #pragma omp target map(mapper) // expected-error {{use of undeclared identifier 'mapper'}} {} diff --git a/test/OpenMP/declare_reduction_messages.cpp b/test/OpenMP/declare_reduction_messages.cpp index 21c03fac22..0a79d6a0a6 100644 --- a/test/OpenMP/declare_reduction_messages.cpp +++ b/test/OpenMP/declare_reduction_messages.cpp @@ -147,7 +147,7 @@ struct A { int A_TEST() { A test; -#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A()) +#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A()) allocate(test) // expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}} #pragma omp parallel reduction(+ : test) {} return 0; diff --git a/test/OpenMP/declare_simd_messages.cpp b/test/OpenMP/declare_simd_messages.cpp index dab7d054e7..d5451aba4f 100644 --- a/test/OpenMP/declare_simd_messages.cpp +++ b/test/OpenMP/declare_simd_messages.cpp @@ -195,8 +195,8 @@ void test() { #pragma omp declare simd linear(uval(b)) // expected-error@+1 {{variable of non-reference type 'int *' can be used only with 'val' modifier, but used with 'ref'}} #pragma omp declare simd linear(ref(b)) -// expected-error@+1 {{expected one of 'ref', val' or 'uval' modifiers}} -#pragma omp declare simd linear(uref(b)) +// expected-error@+1 {{expected one of 'ref', val' or 'uval' modifiers}} expected-warning@+1 {{extra tokens at the end of '#pragma omp declare simd' are ignored}} +#pragma omp declare simd linear(uref(b)) allocate(b) void bar(int a, int *b); template diff --git a/test/OpenMP/declare_target_messages.cpp b/test/OpenMP/declare_target_messages.cpp index 0c001d265f..642d3e8727 100644 --- a/test/OpenMP/declare_target_messages.cpp +++ b/test/OpenMP/declare_target_messages.cpp @@ -23,7 +23,7 @@ void c(); void func() {} // expected-note {{'func' defined here}} -#pragma omp declare target link(func) // expected-error {{function name is not allowed in 'link' clause}} +#pragma omp declare target link(func) allocate(a) // expected-error {{function name is not allowed in 'link' clause}} expected-error {{unexpected 'allocate' clause, only 'to' or 'link' clauses expected}} extern int b; diff --git a/test/OpenMP/distribute_ast_print.cpp b/test/OpenMP/distribute_ast_print.cpp index 1bd0a41662..560e227653 100644 --- a/test/OpenMP/distribute_ast_print.cpp +++ b/test/OpenMP/distribute_ast_print.cpp @@ -29,14 +29,14 @@ public: S7(typename T::type v) : a(v) { #pragma omp target #pragma omp teams -#pragma omp distribute private(a) private(this->a) private(T::a) +#pragma omp distribute private(a) private(this->a) private(T::a) allocate(a) for (int k = 0; k < a.a; ++k) ++this->a.a; } S7 &operator=(S7 &s) { #pragma omp target #pragma omp teams -#pragma omp distribute private(a) private(this->a) +#pragma omp distribute allocate(a) private(a) private(this->a) for (int k = 0; k < s.a.a; ++k) ++s.a.a; return *this; @@ -45,13 +45,13 @@ public: // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(T::a) +// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(T::a) allocate(this->a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) +// CHECK-NEXT: #pragma omp distribute allocate(this->a) private(this->a) private(this->a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a) +// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a) allocate(this->a) class S8 : public S7 { S8() {} diff --git a/test/OpenMP/distribute_firstprivate_messages.cpp b/test/OpenMP/distribute_firstprivate_messages.cpp index 8acc6b643f..e6dfd71c55 100644 --- a/test/OpenMP/distribute_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_firstprivate_messages.cpp @@ -54,6 +54,8 @@ public: S6() : a(0) { } }; +extern int omp_default_mem_alloc; + S3 h; #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} @@ -85,7 +87,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target #pragma omp teams - #pragma omp distribute firstprivate (argc) + #pragma omp distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target #pragma omp teams diff --git a/test/OpenMP/distribute_parallel_for_ast_print.cpp b/test/OpenMP/distribute_parallel_for_ast_print.cpp index 5cfc081737..56bae3965b 100644 --- a/test/OpenMP/distribute_parallel_for_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_ast_print.cpp @@ -78,15 +78,15 @@ T tmain(T argc) { #pragma omp threadprivate(g) #pragma omp target #pragma omp teams -#pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) - // CHECK: #pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) +#pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a) + // CHECK: #pragma omp distribute parallel for dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) +#pragma omp distribute parallel for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -98,7 +98,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) a++; - // CHECK: #pragma omp distribute parallel for private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) + // CHECK: #pragma omp distribute parallel for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp index 35579d3537..3cebf0cd67 100644 --- a/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp @@ -8,6 +8,7 @@ void foo() { bool foobool(int argc) { return argc; } +extern int omp_default_mem_alloc; struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}} extern S1 a; @@ -100,7 +101,7 @@ int foomain(int argc, char **argv) { ++k; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for firstprivate(argc) +#pragma omp distribute parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp index 8d93fbbee6..4039982ef5 100644 --- a/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp @@ -8,7 +8,7 @@ void foo() { bool foobool(int argc) { return argc; } - +extern int omp_default_mem_alloc; struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}} extern S1 a; class S2 { @@ -102,7 +102,7 @@ int foomain(int argc, char **argv) { ++k; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for lastprivate(argc) +#pragma omp distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_private_messages.cpp b/test/OpenMP/distribute_parallel_for_private_messages.cpp index 63d89a8c7c..6fadc12442 100644 --- a/test/OpenMP/distribute_parallel_for_private_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -34,7 +35,7 @@ public: S4(int v) : a(v) { #pragma omp target #pragma omp teams -#pragma omp distribute parallel for private(a) private(this->a) +#pragma omp distribute parallel for private(a) private(this->a) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: a, allocate(omp_default_mem_alloc: a), allocate(a) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < v; ++k) ++this->a; } diff --git a/test/OpenMP/distribute_parallel_for_reduction_messages.cpp b/test/OpenMP/distribute_parallel_for_reduction_messages.cpp index e6be867f15..99f928a345 100644 --- a/test/OpenMP/distribute_parallel_for_reduction_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -150,7 +151,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for reduction(&& : argc) +#pragma omp distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp index 4ff0a49290..db3300ed29 100644 --- a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -79,15 +79,15 @@ T tmain(T argc) { #pragma omp threadprivate(g) #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) - // CHECK: #pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) +#pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a) + // CHECK: #pragma omp distribute parallel for simd dist_schedule(static, a) schedule(dynamic) default(none) copyin(g) firstprivate(a) allocate(a) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) +#pragma omp distribute parallel for simd allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -99,7 +99,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) a++; - // CHECK: #pragma omp distribute parallel for simd private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) + // CHECK: #pragma omp distribute parallel for simd allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp index e1b0f1466c..f574335baf 100644 --- a/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -222,7 +223,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd firstprivate(argc) +#pragma omp distribute parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp index e7f2b7da3f..71658a6650 100644 --- a/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -211,7 +212,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(argc) +#pragma omp distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp index 6fb5944d2c..8f2df4215b 100644 --- a/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -283,7 +284,7 @@ int main(int argc, char **argv) { // expected-error@+3 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd linear (argc) +#pragma omp distribute parallel for simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp index 419e735f45..50a7fb5ac9 100644 --- a/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -142,7 +143,7 @@ int foomain(I argc, C **argv) { ++k; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd private(argc) +#pragma omp distribute parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp index 046cce59dd..150f50171a 100644 --- a/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -334,7 +335,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd reduction(&& : argc) +#pragma omp distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/distribute_private_messages.cpp b/test/OpenMP/distribute_private_messages.cpp index 55c13a00bb..fe5c0257a9 100644 --- a/test/OpenMP/distribute_private_messages.cpp +++ b/test/OpenMP/distribute_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -63,7 +64,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp distribute private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp distribute private (argc) + #pragma omp distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp distribute private (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/distribute_simd_ast_print.cpp b/test/OpenMP/distribute_simd_ast_print.cpp index 092c5cfd78..528f8da826 100644 --- a/test/OpenMP/distribute_simd_ast_print.cpp +++ b/test/OpenMP/distribute_simd_ast_print.cpp @@ -27,23 +27,23 @@ public: S7(typename T::type v) : a(v) { #pragma omp target #pragma omp teams -#pragma omp distribute simd private(a) private(this->a) private(T::a) +#pragma omp distribute simd private(a) private(this->a) private(T::a) allocate(T::a) for (int k = 0; k < a.a; ++k) ++this->a.a; } S7 &operator=(S7 &s) { #pragma omp target #pragma omp teams -#pragma omp distribute simd private(a) private(this->a) +#pragma omp distribute simd allocate(a) private(a) private(this->a) for (int k = 0; k < s.a.a; ++k) ++s.a.a; return *this; } }; -// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(T::a){{$}} -// CHECK: #pragma omp distribute simd private(this->a) private(this->a) -// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a) +// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(T::a) allocate(T::a){{$}} +// CHECK: #pragma omp distribute simd allocate(this->a) private(this->a) private(this->a) +// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a) allocate(this->S::a) class S8 : public S7 { S8() {} diff --git a/test/OpenMP/distribute_simd_firstprivate_messages.cpp b/test/OpenMP/distribute_simd_firstprivate_messages.cpp index 1cfc273256..6059415582 100644 --- a/test/OpenMP/distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -100,7 +101,7 @@ int foomain(int argc, char **argv) { ++k; #pragma omp target #pragma omp teams -#pragma omp distribute simd firstprivate(argc) +#pragma omp distribute simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_simd_lastprivate_messages.cpp b/test/OpenMP/distribute_simd_lastprivate_messages.cpp index 875210ed49..6037551c5b 100644 --- a/test/OpenMP/distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -211,7 +212,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(argc) +#pragma omp distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/distribute_simd_linear_messages.cpp b/test/OpenMP/distribute_simd_linear_messages.cpp index 631b43a120..e5c2aceea8 100644 --- a/test/OpenMP/distribute_simd_linear_messages.cpp +++ b/test/OpenMP/distribute_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -272,7 +273,7 @@ int main(int argc, char **argv) { // expected-error@+3 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target #pragma omp teams -#pragma omp distribute simd linear (argc) +#pragma omp distribute simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_simd_private_messages.cpp b/test/OpenMP/distribute_simd_private_messages.cpp index 1fdb97dceb..47b1b0c74f 100644 --- a/test/OpenMP/distribute_simd_private_messages.cpp +++ b/test/OpenMP/distribute_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -142,7 +143,7 @@ int foomain(I argc, C **argv) { ++k; #pragma omp target #pragma omp teams -#pragma omp distribute simd private(argc) +#pragma omp distribute simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/distribute_simd_reduction_messages.cpp b/test/OpenMP/distribute_simd_reduction_messages.cpp index f960b18319..b1fe7f684d 100644 --- a/test/OpenMP/distribute_simd_reduction_messages.cpp +++ b/test/OpenMP/distribute_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -150,7 +151,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute simd reduction(&& : argc) +#pragma omp distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/flush_messages.cpp b/test/OpenMP/flush_messages.cpp index f4456489a9..36a8ef6d49 100644 --- a/test/OpenMP/flush_messages.cpp +++ b/test/OpenMP/flush_messages.cpp @@ -8,7 +8,7 @@ struct S1 { // expected-note 2 {{declared here}} template T tmain(T argc) { -#pragma omp flush +#pragma omp flush allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp flush'}} ; #pragma omp flush untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp flush'}} #pragma omp flush unknown // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}} diff --git a/test/OpenMP/for_ast_print.cpp b/test/OpenMP/for_ast_print.cpp index 760d44c1cf..cdbe9aaffd 100644 --- a/test/OpenMP/for_ast_print.cpp +++ b/test/OpenMP/for_ast_print.cpp @@ -105,14 +105,14 @@ T tmain(T argc) { T b = argc, c, d, e, f, g; static T a; // CHECK: static T a; -#pragma omp for schedule(dynamic) linear(a) - // CHECK-NEXT: #pragma omp for schedule(dynamic) linear(a) +#pragma omp for schedule(dynamic) linear(a) allocate(a) + // CHECK-NEXT: #pragma omp for schedule(dynamic) linear(a) allocate(a) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#pragma omp for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) nowait +#pragma omp for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) nowait for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -125,7 +125,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) foo(); // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) nowait + // CHECK-NEXT: #pragma omp for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) nowait // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/for_firstprivate_messages.cpp b/test/OpenMP/for_firstprivate_messages.cpp index c34c918d12..22b034e0f2 100644 --- a/test/OpenMP/for_firstprivate_messages.cpp +++ b/test/OpenMP/for_firstprivate_messages.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -verify -fopenmp %s // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -92,7 +93,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp for firstprivate(argc) +#pragma omp for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/for_lastprivate_messages.cpp b/test/OpenMP/for_lastprivate_messages.cpp index 1777335c9a..40222c1f5e 100644 --- a/test/OpenMP/for_lastprivate_messages.cpp +++ b/test/OpenMP/for_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp for lastprivate(argc) +#pragma omp for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/for_linear_messages.cpp b/test/OpenMP/for_linear_messages.cpp index f35e5343c3..c984aa5a9f 100644 --- a/test/OpenMP/for_linear_messages.cpp +++ b/test/OpenMP/for_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -117,7 +118,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp for linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp for linear (argc : 5) + #pragma omp for linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp for linear (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/for_private_messages.cpp b/test/OpenMP/for_private_messages.cpp index 5b0b562869..44a05f709f 100644 --- a/test/OpenMP/for_private_messages.cpp +++ b/test/OpenMP/for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp for private(argc) +#pragma omp for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp for private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_reduction_messages.cpp b/test/OpenMP/for_reduction_messages.cpp index f575ee463d..397e54f1fc 100644 --- a/test/OpenMP/for_reduction_messages.cpp +++ b/test/OpenMP/for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -295,7 +296,7 @@ int main(int argc, char **argv) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(&& : argc) +#pragma omp for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel diff --git a/test/OpenMP/for_simd_ast_print.cpp b/test/OpenMP/for_simd_ast_print.cpp index 13e82b4647..d626994bf8 100644 --- a/test/OpenMP/for_simd_ast_print.cpp +++ b/test/OpenMP/for_simd_ast_print.cpp @@ -90,7 +90,7 @@ template struct S { // CHECK: T res; // CHECK: T val; // CHECK: T lin = 0; - #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) + #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res) // CHECK-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) for (T i = 7; i < m_a; ++i) { val = v[i-7] + m_a; @@ -117,7 +117,7 @@ template struct S { template struct S2 { static void func(int n, float *a, float *b, float *c) { int k1 = 0, k2 = 0; -#pragma omp for simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) +#pragma omp for simd allocate(k1) safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) for(int i = 0; i < n; i++) { c[i] = a[i] + b[i]; c[k1] = a[k1] + b[k1]; @@ -132,7 +132,7 @@ template struct S2 { // CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; -// CHECK-NEXT: #pragma omp for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) +// CHECK-NEXT: #pragma omp for simd allocate(k1) safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) // CHECK-NEXT: for (int i = 0; i < n; i++) { // CHECK-NEXT: c[i] = a[i] + b[i]; // CHECK-NEXT: c[k1] = a[k1] + b[k1]; diff --git a/test/OpenMP/for_simd_firstprivate_messages.cpp b/test/OpenMP/for_simd_firstprivate_messages.cpp index ceacdb6a53..b6b51d8686 100644 --- a/test/OpenMP/for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -93,7 +94,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp for simd firstprivate(argc) +#pragma omp for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/for_simd_lastprivate_messages.cpp b/test/OpenMP/for_simd_lastprivate_messages.cpp index a4bed93365..b3589d90d7 100644 --- a/test/OpenMP/for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp for simd lastprivate(argc) +#pragma omp for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/for_simd_linear_messages.cpp b/test/OpenMP/for_simd_linear_messages.cpp index a87b1ab115..ffa2233b55 100644 --- a/test/OpenMP/for_simd_linear_messages.cpp +++ b/test/OpenMP/for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -117,7 +118,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp for simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp for simd linear (argc : 5) + #pragma omp for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp for simd linear (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/for_simd_private_messages.cpp b/test/OpenMP/for_simd_private_messages.cpp index 8fe6d7b721..ff3249e64c 100644 --- a/test/OpenMP/for_simd_private_messages.cpp +++ b/test/OpenMP/for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp for simd private(argc) +#pragma omp for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp for simd private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_simd_reduction_messages.cpp b/test/OpenMP/for_simd_reduction_messages.cpp index 12368efccf..c4bed65d98 100644 --- a/test/OpenMP/for_simd_reduction_messages.cpp +++ b/test/OpenMP/for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -137,7 +138,7 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for simd reduction(&& : argc) +#pragma omp for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel diff --git a/test/OpenMP/master_messages.cpp b/test/OpenMP/master_messages.cpp index 26d6bc8e9f..702da24b63 100644 --- a/test/OpenMP/master_messages.cpp +++ b/test/OpenMP/master_messages.cpp @@ -28,7 +28,7 @@ int main() { #pragma omp single for (int i = 0; i < 10; ++i) { foo(); - #pragma omp master // expected-error {{region cannot be closely nested inside 'single' region}} + #pragma omp master allocate(i) // expected-error {{region cannot be closely nested inside 'single' region}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp master'}} foo(); } #pragma omp master diff --git a/test/OpenMP/ordered_messages.cpp b/test/OpenMP/ordered_messages.cpp index 43ac40efe6..294e7455af 100644 --- a/test/OpenMP/ordered_messages.cpp +++ b/test/OpenMP/ordered_messages.cpp @@ -262,7 +262,7 @@ int k; #pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}} #pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}} #pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} -#pragma omp ordered depend(sink : i, j) +#pragma omp ordered depend(sink : i, j) allocate(i) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp ordered'}} #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} diff --git a/test/OpenMP/parallel_ast_print.cpp b/test/OpenMP/parallel_ast_print.cpp index 19ebb70483..fa96dfce67 100644 --- a/test/OpenMP/parallel_ast_print.cpp +++ b/test/OpenMP/parallel_ast_print.cpp @@ -205,13 +205,13 @@ int main (int argc, char **argv) { // CHECK-NEXT: #pragma omp parallel a=2; // CHECK-NEXT: a = 2; -#pragma omp parallel default(none), private(argc,b) firstprivate(argv) if (parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(| : c, d, arr1[argc]) reduction(* : e, arr[:10][0:argc]) -// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) if(parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(|: c,d,arr1[argc]) reduction(*: e,arr[:10][0:argc]) +#pragma omp parallel default(none), private(argc,b) firstprivate(argv) if (parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(| : c, d, arr1[argc]) reduction(* : e, arr[:10][0:argc]) allocate(e) +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) if(parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(|: c,d,arr1[argc]) reduction(*: e,arr[:10][0:argc]) allocate(e) foo(); // CHECK-NEXT: foo(); -// CHECK-NEXT: #pragma omp parallel if(b) num_threads(c) proc_bind(close) reduction(^: e,f) reduction(&&: g,arr[0:argc][:10]) +// CHECK-NEXT: #pragma omp parallel allocate(e) if(b) num_threads(c) proc_bind(close) reduction(^: e,f) reduction(&&: g,arr[0:argc][:10]) // CHECK-NEXT: foo() -#pragma omp parallel if (b) num_threads(c) proc_bind(close) reduction(^:e, f) reduction(&& : g, arr[0:argc][:10]) +#pragma omp parallel allocate(e) if (b) num_threads(c) proc_bind(close) reduction(^:e, f) reduction(&& : g, arr[0:argc][:10]) foo(); return tmain(b, &b) + tmain(x, &x); } diff --git a/test/OpenMP/parallel_firstprivate_messages.cpp b/test/OpenMP/parallel_firstprivate_messages.cpp index 7de268fb3b..6c5a41c589 100644 --- a/test/OpenMP/parallel_firstprivate_messages.cpp +++ b/test/OpenMP/parallel_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -71,7 +72,7 @@ int main(int argc, char **argv) { #pragma omp parallel firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp parallel firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} - #pragma omp parallel firstprivate (argc) + #pragma omp parallel firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} #pragma omp parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}} #pragma omp parallel firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} #pragma omp parallel firstprivate (d) diff --git a/test/OpenMP/parallel_for_ast_print.cpp b/test/OpenMP/parallel_for_ast_print.cpp index 036279030c..8e02ec40c2 100644 --- a/test/OpenMP/parallel_for_ast_print.cpp +++ b/test/OpenMP/parallel_for_ast_print.cpp @@ -70,13 +70,13 @@ T tmain(T argc) { // CHECK: static T a; static T g; #pragma omp threadprivate(g) -#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) - // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) +#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) + // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; -#pragma omp parallel for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) +#pragma omp parallel for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -88,7 +88,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) foo(); - // CHECK-NEXT: #pragma omp parallel for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) + // CHECK-NEXT: #pragma omp parallel for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/parallel_for_firstprivate_messages.cpp b/test/OpenMP/parallel_for_firstprivate_messages.cpp index 19b1ced757..752d0325e6 100644 --- a/test/OpenMP/parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/parallel_for_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -86,7 +87,7 @@ int foomain(int argc, char **argv) { #pragma omp parallel for firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for firstprivate(argc) +#pragma omp parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_lastprivate_messages.cpp b/test/OpenMP/parallel_for_lastprivate_messages.cpp index ae635f3421..5c782a5637 100644 --- a/test/OpenMP/parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/parallel_for_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for lastprivate(argc) +#pragma omp parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_linear_messages.cpp b/test/OpenMP/parallel_for_linear_messages.cpp index 6596814de6..0dfdb3d96f 100644 --- a/test/OpenMP/parallel_for_linear_messages.cpp +++ b/test/OpenMP/parallel_for_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -42,7 +43,7 @@ void test_linear_colons() { #pragma omp parallel for linear(B, ::z, X::x) for (int i = 0; i < 10; ++i) ; -#pragma omp parallel for linear(::z) +#pragma omp parallel for linear(::z) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) ; // expected-error@+1 {{expected variable name}} diff --git a/test/OpenMP/parallel_for_private_messages.cpp b/test/OpenMP/parallel_for_private_messages.cpp index 7efc6eeac8..4591043bbf 100644 --- a/test/OpenMP/parallel_for_private_messages.cpp +++ b/test/OpenMP/parallel_for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for private(argc) +#pragma omp parallel for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_reduction_messages.cpp b/test/OpenMP/parallel_for_reduction_messages.cpp index c44ee676d6..87a5027f69 100644 --- a/test/OpenMP/parallel_for_reduction_messages.cpp +++ b/test/OpenMP/parallel_for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -130,7 +131,7 @@ T tmain(T argc) { #pragma omp parallel for reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel for reduction(&& : argc) +#pragma omp parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_ast_print.cpp b/test/OpenMP/parallel_for_simd_ast_print.cpp index 597e66d22e..7ffecce30d 100644 --- a/test/OpenMP/parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/parallel_for_simd_ast_print.cpp @@ -91,8 +91,8 @@ template struct S { // CHECK: T res; // CHECK: T val; // CHECK: T lin = 0; - #pragma omp parallel for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) if(7) -// CHECK-NEXT: #pragma omp parallel for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) if(7) + #pragma omp parallel for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) if(7) allocate(lin) +// CHECK-NEXT: #pragma omp parallel for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) if(7) allocate(lin) for (T i = 7; i < m_a; ++i) { val = v[i-7] + m_a; res = val; @@ -118,7 +118,7 @@ template struct S { template struct S2 { static void func(int n, float *a, float *b, float *c) { int k1 = 0, k2 = 0; -#pragma omp parallel for simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) +#pragma omp parallel for simd allocate(k1) safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) for(int i = 0; i < n; i++) { c[i] = a[i] + b[i]; c[k1] = a[k1] + b[k1]; @@ -133,7 +133,7 @@ template struct S2 { // CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; -// CHECK-NEXT: #pragma omp parallel for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) +// CHECK-NEXT: #pragma omp parallel for simd allocate(k1) safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) // CHECK-NEXT: for (int i = 0; i < n; i++) { // CHECK-NEXT: c[i] = a[i] + b[i]; // CHECK-NEXT: c[k1] = a[k1] + b[k1]; diff --git a/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp index e1e01aa661..ef3743bc79 100644 --- a/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -86,7 +87,7 @@ int foomain(int argc, char **argv) { #pragma omp parallel for simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for simd firstprivate(argc) +#pragma omp parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp index 5759e835b2..45cc26b074 100644 --- a/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -87,7 +88,7 @@ int foomain(int argc, char **argv) { #pragma omp parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for simd lastprivate(argc) +#pragma omp parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_linear_messages.cpp b/test/OpenMP/parallel_for_simd_linear_messages.cpp index 792978e631..cf207f021a 100644 --- a/test/OpenMP/parallel_for_simd_linear_messages.cpp +++ b/test/OpenMP/parallel_for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -117,7 +118,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp parallel for simd linear (argc : 5) + #pragma omp parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/parallel_for_simd_private_messages.cpp b/test/OpenMP/parallel_for_simd_private_messages.cpp index 5d263d6cc2..c5f853fc5d 100644 --- a/test/OpenMP/parallel_for_simd_private_messages.cpp +++ b/test/OpenMP/parallel_for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for simd private(argc) +#pragma omp parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_reduction_messages.cpp b/test/OpenMP/parallel_for_simd_reduction_messages.cpp index 5be42461f0..5586a8b864 100644 --- a/test/OpenMP/parallel_for_simd_reduction_messages.cpp +++ b/test/OpenMP/parallel_for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -124,7 +125,7 @@ T tmain(T argc) { #pragma omp parallel for simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel for simd reduction(&& : argc) +#pragma omp parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/parallel_private_messages.cpp b/test/OpenMP/parallel_private_messages.cpp index e8fd70d2ff..e210493741 100644 --- a/test/OpenMP/parallel_private_messages.cpp +++ b/test/OpenMP/parallel_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -68,7 +69,7 @@ int main(int argc, char **argv) { #pragma omp parallel private (S1) // expected-error {{'S1' does not refer to a value}} #pragma omp parallel private (a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}} #pragma omp parallel private (argv[1]) // expected-error {{expected variable name}} - #pragma omp parallel private(ba) + #pragma omp parallel private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} #pragma omp parallel private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}} #pragma omp parallel private(da) // expected-error {{const-qualified variable cannot be private}} #pragma omp parallel private(S2::S2s) // expected-error {{shared variable cannot be private}} diff --git a/test/OpenMP/parallel_reduction_messages.cpp b/test/OpenMP/parallel_reduction_messages.cpp index f520d4a0fa..2e90b63e0d 100644 --- a/test/OpenMP/parallel_reduction_messages.cpp +++ b/test/OpenMP/parallel_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -112,7 +113,7 @@ T tmain(T argc) { foo(); #pragma omp parallel reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} foo(); -#pragma omp parallel reduction(&& : argc) +#pragma omp parallel reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}} foo(); diff --git a/test/OpenMP/parallel_sections_ast_print.cpp b/test/OpenMP/parallel_sections_ast_print.cpp index 8c0bd0bae5..5692881634 100644 --- a/test/OpenMP/parallel_sections_ast_print.cpp +++ b/test/OpenMP/parallel_sections_ast_print.cpp @@ -41,11 +41,11 @@ T tmain(T argc, T *argv) { { a = 2; } -#pragma omp parallel sections default(none), private(argc, b) firstprivate(argv) shared(d) if (parallel: argc > 0) num_threads(C) copyin(S < T > ::TS) proc_bind(master) reduction(+ : c) reduction(max : e) +#pragma omp parallel sections default(none), private(argc, b) firstprivate(argv) shared(d) if (parallel: argc > 0) num_threads(C) copyin(S < T > ::TS) proc_bind(master) reduction(+ : c) reduction(max : e) allocate(e) { foo(); } -#pragma omp parallel sections if (C) num_threads(s) proc_bind(close) reduction(^ : e, f) reduction(&& : g) lastprivate(b, c) +#pragma omp parallel sections allocate(b) if (C) num_threads(s) proc_bind(close) reduction(^ : e, f) reduction(&& : g) lastprivate(b, c) { foo(); #pragma omp section @@ -62,11 +62,11 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section @@ -80,11 +80,11 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section @@ -98,11 +98,11 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) allocate(e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections allocate(b) if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section diff --git a/test/OpenMP/parallel_sections_firstprivate_messages.cpp b/test/OpenMP/parallel_sections_firstprivate_messages.cpp index f8370f26b4..c161e6f747 100644 --- a/test/OpenMP/parallel_sections_firstprivate_messages.cpp +++ b/test/OpenMP/parallel_sections_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -92,7 +93,7 @@ int foomain(int argc, char **argv) { { foo(); } -#pragma omp parallel sections firstprivate(argc) +#pragma omp parallel sections firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/parallel_sections_lastprivate_messages.cpp b/test/OpenMP/parallel_sections_lastprivate_messages.cpp index 25ea4a51dd..b259b8a19e 100644 --- a/test/OpenMP/parallel_sections_lastprivate_messages.cpp +++ b/test/OpenMP/parallel_sections_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -93,7 +94,7 @@ int foomain(int argc, char **argv) { { foo(); } -#pragma omp parallel sections lastprivate(argc) +#pragma omp parallel sections lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/parallel_sections_private_messages.cpp b/test/OpenMP/parallel_sections_private_messages.cpp index 75e3f173ae..2161df33d8 100644 --- a/test/OpenMP/parallel_sections_private_messages.cpp +++ b/test/OpenMP/parallel_sections_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -134,7 +135,7 @@ int foomain(I argc, C **argv) { { foo(); } -#pragma omp parallel sections private(argc) +#pragma omp parallel sections private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/parallel_sections_reduction_messages.cpp b/test/OpenMP/parallel_sections_reduction_messages.cpp index ae8384adf0..ac205cd076 100644 --- a/test/OpenMP/parallel_sections_reduction_messages.cpp +++ b/test/OpenMP/parallel_sections_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -136,7 +137,7 @@ T tmain(T argc) { { foo(); } -#pragma omp parallel sections reduction(&& : argc) +#pragma omp parallel sections reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/requires_messages.cpp b/test/OpenMP/requires_messages.cpp index 7404d3ea5f..873edc7052 100644 --- a/test/OpenMP/requires_messages.cpp +++ b/test/OpenMP/requires_messages.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -#pragma omp requires unified_address // expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note{{unified_address clause previously used here}} +int a; +#pragma omp requires unified_address allocate(a) // expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note{{unified_address clause previously used here}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp requires'}} #pragma omp requires unified_shared_memory // expected-note {{unified_shared_memory clause previously used here}} expected-note{{unified_shared_memory clause previously used here}} diff --git a/test/OpenMP/sections_ast_print.cpp b/test/OpenMP/sections_ast_print.cpp index 15c8c26e8c..1679b11311 100644 --- a/test/OpenMP/sections_ast_print.cpp +++ b/test/OpenMP/sections_ast_print.cpp @@ -18,12 +18,12 @@ T tmain(T argc) { static T a; // CHECK: static T a; #pragma omp parallel -#pragma omp sections private(argc, b), firstprivate(c, d), lastprivate(d, f) reduction(- : g) nowait +#pragma omp sections private(argc, b), firstprivate(c, d), lastprivate(d, f) reduction(- : g) nowait allocate(d) { foo(); } // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(c,d) lastprivate(d,f) reduction(-: g) nowait{{$}} + // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(c,d) lastprivate(d,f) reduction(-: g) nowait allocate(d){{$}} // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } @@ -36,7 +36,7 @@ int main(int argc, char **argv) { static int a; // CHECK: static int a; #pragma omp parallel -#pragma omp sections private(argc, b), firstprivate(argv, c), lastprivate(d, f) reduction(+ : g) nowait +#pragma omp sections allocate(c) private(argc, b), firstprivate(argv, c), lastprivate(d, f) reduction(+ : g) nowait { #pragma omp section foo(); @@ -44,7 +44,7 @@ int main(int argc, char **argv) { foo(); } // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp sections private(argc,b) firstprivate(argv,c) lastprivate(d,f) reduction(+: g) nowait + // CHECK-NEXT: #pragma omp sections allocate(c) private(argc,b) firstprivate(argv,c) lastprivate(d,f) reduction(+: g) nowait // CHECK-NEXT: { // CHECK-NEXT: #pragma omp section{{$}} // CHECK-NEXT: foo(); diff --git a/test/OpenMP/sections_firstprivate_messages.cpp b/test/OpenMP/sections_firstprivate_messages.cpp index 425125c11a..e2d9de3c31 100644 --- a/test/OpenMP/sections_firstprivate_messages.cpp +++ b/test/OpenMP/sections_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -99,7 +100,7 @@ int foomain(int argc, char **argv) { foo(); } #pragma omp parallel -#pragma omp sections firstprivate(argc) +#pragma omp sections firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/sections_lastprivate_messages.cpp b/test/OpenMP/sections_lastprivate_messages.cpp index 1f73260541..f7e0d1acf0 100644 --- a/test/OpenMP/sections_lastprivate_messages.cpp +++ b/test/OpenMP/sections_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -206,7 +207,7 @@ int main(int argc, char **argv) { foo(); } #pragma omp parallel -#pragma omp sections lastprivate(argc) +#pragma omp sections lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/sections_private_messages.cpp b/test/OpenMP/sections_private_messages.cpp index 81e3eb4779..3548590b0f 100644 --- a/test/OpenMP/sections_private_messages.cpp +++ b/test/OpenMP/sections_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -134,7 +135,7 @@ int foomain(I argc, C **argv) { { foo(); } -#pragma omp sections private(argc) +#pragma omp sections private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/sections_reduction_messages.cpp b/test/OpenMP/sections_reduction_messages.cpp index 72a48c9c43..e0b285cbaf 100644 --- a/test/OpenMP/sections_reduction_messages.cpp +++ b/test/OpenMP/sections_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -14,7 +15,7 @@ bool foobool(int argc) { } void foobar(int &ref) { -#pragma omp parallel +#pragma omp parallel #pragma omp sections reduction(+:ref) { foo(); @@ -149,7 +150,7 @@ T tmain(T argc) { foo(); } #pragma omp parallel -#pragma omp sections reduction(&& : argc) +#pragma omp sections reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} { foo(); } diff --git a/test/OpenMP/simd_ast_print.cpp b/test/OpenMP/simd_ast_print.cpp index ad16fe2de9..dcd5d7f2dc 100644 --- a/test/OpenMP/simd_ast_print.cpp +++ b/test/OpenMP/simd_ast_print.cpp @@ -94,8 +94,8 @@ template struct S { // CHECK: T val; // CHECK: T lin = 0; // CHECK: T &ref = res; - #pragma omp simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) linear(ref(ref)) -// CHECK-NEXT: #pragma omp simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) linear(ref(ref)) + #pragma omp simd allocate(res) private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) linear(ref(ref)) +// CHECK-NEXT: #pragma omp simd allocate(res) private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) linear(ref(ref)) for (T i = 7; i < m_a; ++i) { val = v[i-7] + m_a; res = val; @@ -121,7 +121,7 @@ template struct S { template struct S2 { static void func(int n, float *a, float *b, float *c) { int k1 = 0, k2 = 0; -#pragma omp simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) +#pragma omp simd safelen(LEN) linear(k1,k2:LEN) aligned(a:LEN) simdlen(LEN) allocate(k1) for(int i = 0; i < n; i++) { c[i] = a[i] + b[i]; c[k1] = a[k1] + b[k1]; @@ -136,7 +136,7 @@ template struct S2 { // CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; -// CHECK-NEXT: #pragma omp simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) +// CHECK-NEXT: #pragma omp simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) allocate(k1) // CHECK-NEXT: for (int i = 0; i < n; i++) { // CHECK-NEXT: c[i] = a[i] + b[i]; // CHECK-NEXT: c[k1] = a[k1] + b[k1]; diff --git a/test/OpenMP/simd_lastprivate_messages.cpp b/test/OpenMP/simd_lastprivate_messages.cpp index bd5a237a60..9469c53b74 100644 --- a/test/OpenMP/simd_lastprivate_messages.cpp +++ b/test/OpenMP/simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -87,7 +88,7 @@ int foomain(I argc, C **argv) { #pragma omp simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp simd lastprivate(argc) +#pragma omp simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_linear_messages.cpp b/test/OpenMP/simd_linear_messages.cpp index 3a72ed26fc..fa2690616c 100644 --- a/test/OpenMP/simd_linear_messages.cpp +++ b/test/OpenMP/simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -127,7 +128,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp simd linear (argc : 5) + #pragma omp simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp simd linear (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/simd_private_messages.cpp b/test/OpenMP/simd_private_messages.cpp index bfa26d1645..99f76ceed5 100644 --- a/test/OpenMP/simd_private_messages.cpp +++ b/test/OpenMP/simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -105,7 +106,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp simd private (argc) + #pragma omp simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp simd private (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/simd_reduction_messages.cpp b/test/OpenMP/simd_reduction_messages.cpp index 1602aeb40f..f204ae1608 100644 --- a/test/OpenMP/simd_reduction_messages.cpp +++ b/test/OpenMP/simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -124,7 +125,7 @@ T tmain(T argc) { #pragma omp simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp simd reduction(&& : argc) +#pragma omp simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/single_ast_print.cpp b/test/OpenMP/single_ast_print.cpp index a8eaeb0bff..b8dfc51377 100644 --- a/test/OpenMP/single_ast_print.cpp +++ b/test/OpenMP/single_ast_print.cpp @@ -46,16 +46,16 @@ T tmain(T argc) { SST sst; // CHECK: static T a; #pragma omp parallel private(g) -#pragma omp single private(argc, b), firstprivate(c, d), nowait +#pragma omp single private(argc, b), firstprivate(c, d), nowait allocate(d) foo(); // CHECK: #pragma omp parallel private(g) - // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait + // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait allocate(d) // CHECK-NEXT: foo(); #pragma omp parallel private(g) -#pragma omp single private(argc, b), firstprivate(c, d), copyprivate(g) +#pragma omp single allocate(argc) private(argc, b), firstprivate(c, d), copyprivate(g) foo(); // CHECK-NEXT: #pragma omp parallel private(g) - // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) copyprivate(g) + // CHECK-NEXT: #pragma omp single allocate(argc) private(argc,b) firstprivate(c,d) copyprivate(g) // CHECK-NEXT: foo(); return T(); } diff --git a/test/OpenMP/single_firstprivate_messages.cpp b/test/OpenMP/single_firstprivate_messages.cpp index 4c714e392f..cff4b9013b 100644 --- a/test/OpenMP/single_firstprivate_messages.cpp +++ b/test/OpenMP/single_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -87,7 +88,7 @@ int foomain(int argc, char **argv) { #pragma omp single firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} foo(); #pragma omp parallel -#pragma omp single firstprivate(argc) +#pragma omp single firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp parallel #pragma omp single firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/single_private_messages.cpp b/test/OpenMP/single_private_messages.cpp index 0a3ec2e667..6ae2a385a3 100644 --- a/test/OpenMP/single_private_messages.cpp +++ b/test/OpenMP/single_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -110,7 +111,7 @@ int foomain(I argc, C **argv) { foo(); #pragma omp single private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} foo(); -#pragma omp single private(argc) +#pragma omp single private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp single private(S1) // expected-error {{'S1' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_data_messages.c b/test/OpenMP/target_data_messages.c index 017a339cc0..936e3eaa64 100644 --- a/test/OpenMP/target_data_messages.c +++ b/test/OpenMP/target_data_messages.c @@ -10,7 +10,7 @@ int main(int argc, char **argv) { {} L1: foo(); - #pragma omp target data map(a) + #pragma omp target data map(a) allocate(a) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target data'}} { foo(); goto L1; // expected-error {{use of undeclared label 'L1'}} diff --git a/test/OpenMP/target_enter_data_map_messages.c b/test/OpenMP/target_enter_data_map_messages.c index 381c94bf39..7d03fcfa9a 100644 --- a/test/OpenMP/target_enter_data_map_messages.c +++ b/test/OpenMP/target_enter_data_map_messages.c @@ -12,7 +12,7 @@ int main(int argc, char **argv) { #pragma omp target enter data map(r) // expected-error {{map type must be specified for '#pragma omp target enter data'}} #pragma omp target enter data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target enter data'}} - #pragma omp target enter data map(always, to: r) + #pragma omp target enter data map(always, to: r) allocate(r) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target enter data'}} #pragma omp target enter data map(always, alloc: r) #pragma omp target enter data map(always, from: r) // expected-error {{map type 'from' is not allowed for '#pragma omp target enter data'}} #pragma omp target enter data map(release: r) // expected-error {{map type 'release' is not allowed for '#pragma omp target enter data'}} diff --git a/test/OpenMP/target_exit_data_map_messages.c b/test/OpenMP/target_exit_data_map_messages.c index 1c15aac2e5..4a2df448d3 100644 --- a/test/OpenMP/target_exit_data_map_messages.c +++ b/test/OpenMP/target_exit_data_map_messages.c @@ -12,7 +12,7 @@ int main(int argc, char **argv) { #pragma omp target exit data map(r) // expected-error {{map type must be specified for '#pragma omp target exit data'}} #pragma omp target exit data map(tofrom: r) // expected-error {{map type 'tofrom' is not allowed for '#pragma omp target exit data'}} - #pragma omp target exit data map(always, from: r) + #pragma omp target exit data map(always, from: r) allocate(r) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target exit data'}} #pragma omp target exit data map(delete: r) #pragma omp target exit data map(release: r) #pragma omp target exit data map(always, alloc: r) // expected-error {{map type 'alloc' is not allowed for '#pragma omp target exit data'}} diff --git a/test/OpenMP/target_firstprivate_messages.cpp b/test/OpenMP/target_firstprivate_messages.cpp index 4f82c96e56..2ab3a80a5e 100644 --- a/test/OpenMP/target_firstprivate_messages.cpp +++ b/test/OpenMP/target_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}} extern S1 a; class S2 { @@ -103,7 +104,7 @@ int foomain(I argc, C **argv) { {} #pragma omp target firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} {} -#pragma omp target firstprivate(argc) +#pragma omp target firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} {} #pragma omp target firstprivate(S1) // expected-error {{'S1' does not refer to a value}} {} diff --git a/test/OpenMP/target_parallel_ast_print.cpp b/test/OpenMP/target_parallel_ast_print.cpp index 1b61f15330..fb206343cc 100644 --- a/test/OpenMP/target_parallel_ast_print.cpp +++ b/test/OpenMP/target_parallel_ast_print.cpp @@ -41,9 +41,9 @@ T tmain(T argc, T *argv) { T i, j, a[20]; #pragma omp target parallel h=2; -#pragma omp target parallel default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(C) proc_bind(master) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) +#pragma omp target parallel allocate(argv) default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(C) proc_bind(master) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10]) foo(); -#pragma omp target parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(&& : g) +#pragma omp target parallel if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(&& : g) allocate(g) foo(); #pragma omp target parallel if (target:argc > 0) foo(); @@ -76,9 +76,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: T i, j, a[20] // CHECK-NEXT: #pragma omp target parallel{{$}} // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) +// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) allocate(g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() @@ -108,9 +108,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: int i, j, a[20] // CHECK-NEXT: #pragma omp target parallel // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10]) +// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) allocate(g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() @@ -140,9 +140,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: char i, j, a[20] // CHECK-NEXT: #pragma omp target parallel // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10]) +// CHECK-NEXT: #pragma omp target parallel allocate(argv) default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) allocate(g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() diff --git a/test/OpenMP/target_parallel_firstprivate_messages.cpp b/test/OpenMP/target_parallel_firstprivate_messages.cpp index 02186e737b..36490394a0 100644 --- a/test/OpenMP/target_parallel_firstprivate_messages.cpp +++ b/test/OpenMP/target_parallel_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} foo(); - #pragma omp target parallel firstprivate (argc) + #pragma omp target parallel firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_parallel_for_ast_print.cpp b/test/OpenMP/target_parallel_for_ast_print.cpp index c6c46c0031..5e22ef3dd8 100644 --- a/test/OpenMP/target_parallel_for_ast_print.cpp +++ b/test/OpenMP/target_parallel_for_ast_print.cpp @@ -73,13 +73,13 @@ T tmain(T argc, T *argv) { // CHECK: static T a; static T g; #pragma omp threadprivate(g) -#pragma omp target parallel for schedule(dynamic) default(none) linear(a) - // CHECK: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) +#pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) + // CHECK: #pragma omp target parallel for schedule(dynamic) default(none) linear(a) allocate(a) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; -#pragma omp target parallel for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) +#pragma omp target parallel for allocate(b) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -91,7 +91,7 @@ T tmain(T argc, T *argv) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) foo(); - // CHECK-NEXT: #pragma omp target parallel for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) + // CHECK-NEXT: #pragma omp target parallel for allocate(b) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/target_parallel_for_firstprivate_messages.cpp b/test/OpenMP/target_parallel_for_firstprivate_messages.cpp index 350bb89108..3a425178d1 100644 --- a/test/OpenMP/target_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/target_parallel_for_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -86,7 +87,7 @@ int foomain(int argc, char **argv) { #pragma omp target parallel for firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for firstprivate(argc) +#pragma omp target parallel for firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_lastprivate_messages.cpp b/test/OpenMP/target_parallel_for_lastprivate_messages.cpp index 7aff164b50..ce5e1bfbd0 100644 --- a/test/OpenMP/target_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/target_parallel_for_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp target parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for lastprivate(argc) +#pragma omp target parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_linear_messages.cpp b/test/OpenMP/target_parallel_for_linear_messages.cpp index 79890c414a..c08530398c 100644 --- a/test/OpenMP/target_parallel_for_linear_messages.cpp +++ b/test/OpenMP/target_parallel_for_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -139,7 +140,7 @@ int foomain(I argc, C **argv) { #pragma omp target parallel for linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for linear(argc : 5) +#pragma omp target parallel for linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for linear(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_private_messages.cpp b/test/OpenMP/target_parallel_for_private_messages.cpp index dae4f17ccc..4a6b2c2899 100644 --- a/test/OpenMP/target_parallel_for_private_messages.cpp +++ b/test/OpenMP/target_parallel_for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp target parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for private(argc) +#pragma omp target parallel for private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_reduction_messages.cpp b/test/OpenMP/target_parallel_for_reduction_messages.cpp index 7cb55129e2..8eeafd4548 100644 --- a/test/OpenMP/target_parallel_for_reduction_messages.cpp +++ b/test/OpenMP/target_parallel_for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -124,7 +125,7 @@ T tmain(T argc) { #pragma omp target parallel for reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target parallel for reduction(&& : argc) +#pragma omp target parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_ast_print.cpp b/test/OpenMP/target_parallel_for_simd_ast_print.cpp index de7fb12ab9..4ac606d90e 100644 --- a/test/OpenMP/target_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/target_parallel_for_simd_ast_print.cpp @@ -75,20 +75,20 @@ T tmain(T argc, T *argv) { const T clen = 5; // CHECK: T clen = 5; #pragma omp threadprivate(g) -#pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) - // CHECK: #pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) +#pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) allocate(a) + // CHECK: #pragma omp target parallel for simd schedule(dynamic) default(none) linear(a) allocate(a) for (T i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (T i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; -#pragma omp target parallel for simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) +#pragma omp target parallel for simd allocate(d) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) foo(); - // CHECK-NEXT: #pragma omp target parallel for simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) + // CHECK-NEXT: #pragma omp target parallel for simd allocate(d) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp index 8a32c6ffc2..aebc45a937 100644 --- a/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -171,7 +172,7 @@ int main(int argc, char **argv) { #pragma omp target parallel for simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd firstprivate(argc) +#pragma omp target parallel for simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp index 1c4d853431..82271e1be0 100644 --- a/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -162,7 +163,7 @@ int main(int argc, char **argv) { #pragma omp target parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd lastprivate(argc) +#pragma omp target parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_linear_messages.cpp b/test/OpenMP/target_parallel_for_simd_linear_messages.cpp index 166cd2bc0b..30b0308a22 100644 --- a/test/OpenMP/target_parallel_for_simd_linear_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -139,7 +140,7 @@ int foomain(I argc, C **argv) { #pragma omp target parallel for simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for simd linear(argc : 5) +#pragma omp target parallel for simd linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for simd linear(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_private_messages.cpp b/test/OpenMP/target_parallel_for_simd_private_messages.cpp index 51f1d9b8be..923f6378b0 100644 --- a/test/OpenMP/target_parallel_for_simd_private_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp target parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target parallel for simd private(argc) +#pragma omp target parallel for simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp index eb3d756dce..5d40388fa9 100644 --- a/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -124,7 +125,7 @@ T tmain(T argc) { #pragma omp target parallel for simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target parallel for simd reduction(&& : argc) +#pragma omp target parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_private_messages.cpp b/test/OpenMP/target_parallel_private_messages.cpp index de71c03ad4..52826a54df 100644 --- a/test/OpenMP/target_parallel_private_messages.cpp +++ b/test/OpenMP/target_parallel_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -76,7 +77,7 @@ int foomain(I argc, C **argv) { {} #pragma omp target parallel private(argc argv) // expected-error {{expected ',' or ')' in 'private' clause}} {} -#pragma omp target parallel private(argc) +#pragma omp target parallel private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} {} #pragma omp target parallel private(S1) // expected-error {{'S1' does not refer to a value}} {} diff --git a/test/OpenMP/target_parallel_reduction_messages.cpp b/test/OpenMP/target_parallel_reduction_messages.cpp index 63a00caf92..01a9d01b7e 100644 --- a/test/OpenMP/target_parallel_reduction_messages.cpp +++ b/test/OpenMP/target_parallel_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -112,7 +113,7 @@ T tmain(T argc) { foo(); #pragma omp target parallel reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} foo(); -#pragma omp target parallel reduction(&& : argc) +#pragma omp target parallel reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_private_messages.cpp b/test/OpenMP/target_private_messages.cpp index 49ee3fed3e..4463dcfb99 100644 --- a/test/OpenMP/target_private_messages.cpp +++ b/test/OpenMP/target_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}} extern S1 a; class S2 { @@ -103,7 +104,7 @@ int foomain(I argc, C **argv) { {} #pragma omp target private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} {} -#pragma omp target private(argc) +#pragma omp target private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} {} #pragma omp target private(S1) // expected-error {{'S1' does not refer to a value}} {} diff --git a/test/OpenMP/target_reduction_messages.cpp b/test/OpenMP/target_reduction_messages.cpp index 29a12aba85..b95be1f628 100644 --- a/test/OpenMP/target_reduction_messages.cpp +++ b/test/OpenMP/target_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -207,7 +208,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target reduction(~ : argc) // expected-error {{expected unqualified-id}} foo(); -#pragma omp target reduction(&& : argc) +#pragma omp target reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target reduction(^ : S1) // expected-error {{'S1' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_simd_ast_print.cpp b/test/OpenMP/target_simd_ast_print.cpp index 7d3daa36f3..a68dd34f0b 100644 --- a/test/OpenMP/target_simd_ast_print.cpp +++ b/test/OpenMP/target_simd_ast_print.cpp @@ -76,20 +76,20 @@ T tmain(T argc, T *argv) { // CHECK: T clen = 5; T *p; #pragma omp threadprivate(g) -#pragma omp target simd linear(a) - // CHECK: #pragma omp target simd linear(a) +#pragma omp target simd linear(a) allocate(a) + // CHECK: #pragma omp target simd linear(a) allocate(a) for (T i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (T i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; -#pragma omp target simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) if (target :argc) reduction(+ : h) +#pragma omp target simd allocate(f) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) if (target :argc) reduction(+ : h) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) foo(); - // CHECK-NEXT: #pragma omp target simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) if(target: argc) reduction(+: h) + // CHECK-NEXT: #pragma omp target simd allocate(f) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) if(target: argc) reduction(+: h) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) diff --git a/test/OpenMP/target_simd_firstprivate_messages.cpp b/test/OpenMP/target_simd_firstprivate_messages.cpp index 85b216b4cb..9063937d0a 100644 --- a/test/OpenMP/target_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -86,7 +87,7 @@ int foomain(int argc, char **argv) { #pragma omp target simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target simd firstprivate(argc) +#pragma omp target simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_lastprivate_messages.cpp b/test/OpenMP/target_simd_lastprivate_messages.cpp index 70a452f6a5..d7ee2ca768 100644 --- a/test/OpenMP/target_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp target simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target simd lastprivate(argc) +#pragma omp target simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_linear_messages.cpp b/test/OpenMP/target_simd_linear_messages.cpp index d19409f280..4b04497c4a 100644 --- a/test/OpenMP/target_simd_linear_messages.cpp +++ b/test/OpenMP/target_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -139,7 +140,7 @@ int foomain(I argc, C **argv) { #pragma omp target simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target simd linear(argc : 5) +#pragma omp target simd linear(argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target simd linear(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_private_messages.cpp b/test/OpenMP/target_simd_private_messages.cpp index 1b7d864c7c..65ac875129 100644 --- a/test/OpenMP/target_simd_private_messages.cpp +++ b/test/OpenMP/target_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp target simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target simd private(argc) +#pragma omp target simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target simd private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_reduction_messages.cpp b/test/OpenMP/target_simd_reduction_messages.cpp index cf6c9f6295..e7a8737a63 100644 --- a/test/OpenMP/target_simd_reduction_messages.cpp +++ b/test/OpenMP/target_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -124,7 +125,7 @@ T tmain(T argc) { #pragma omp target simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target simd reduction(&& : argc) +#pragma omp target simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/target_teams_ast_print.cpp b/test/OpenMP/target_teams_ast_print.cpp index a0cb63535d..9bf037e0db 100644 --- a/test/OpenMP/target_teams_ast_print.cpp +++ b/test/OpenMP/target_teams_ast_print.cpp @@ -39,9 +39,9 @@ T tmain(T argc, T *argv) { S s; #pragma omp target teams a=2; -#pragma omp target teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) num_teams(C) thread_limit(d*C) +#pragma omp target teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) num_teams(C) thread_limit(d*C) allocate(argv) foo(); -#pragma omp target teams reduction(^:e, f) reduction(&& : g) +#pragma omp target teams allocate(f) reduction(^:e, f) reduction(&& : g) foo(); return 0; } @@ -52,9 +52,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target teams{{$}} // CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C) +// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C) allocate(argv) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g) +// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g) // CHECK-NEXT: foo() // CHECK: template<> int tmain(int argc, int *argv) { // CHECK-NEXT: int b = argc, c, d, e, f, g; @@ -62,9 +62,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target teams // CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5) +// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5) allocate(argv) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g) +// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g) // CHECK-NEXT: foo() // CHECK: template<> long tmain(long argc, long *argv) { // CHECK-NEXT: long b = argc, c, d, e, f, g; @@ -72,9 +72,9 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target teams // CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1) +// CHECK-NEXT: #pragma omp target teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1) allocate(argv) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target teams reduction(^: e,f) reduction(&&: g) +// CHECK-NEXT: #pragma omp target teams allocate(f) reduction(^: e,f) reduction(&&: g) // CHECK-NEXT: foo() enum Enum { }; diff --git a/test/OpenMP/target_teams_distribute_ast_print.cpp b/test/OpenMP/target_teams_distribute_ast_print.cpp index 4484451c49..616bbebefb 100644 --- a/test/OpenMP/target_teams_distribute_ast_print.cpp +++ b/test/OpenMP/target_teams_distribute_ast_print.cpp @@ -55,7 +55,7 @@ class S8 : public S7 { public: S8(int v) : S7(v){ -#pragma omp target teams distribute private(a) private(this->a) private(S7::a) +#pragma omp target teams distribute private(a) private(this->a) private(S7::a) for (int k = 0; k < a.a; ++k) ++this->a.a; } @@ -68,14 +68,14 @@ public: void bar() { int b, argv, d, c, e, f; -#pragma omp target teams distribute default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) +#pragma omp target teams distribute allocate(argv) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) allocate(e) for (int k = 0; k < a.a; ++k) ++a.a; } }; // CHECK: #pragma omp target teams distribute private(this->a) private(this->a) private(this->S7::a) // CHECK: #pragma omp target teams distribute private(this->a) private(this->a) -// CHECK: #pragma omp target teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) +// CHECK: #pragma omp target teams distribute allocate(argv) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) allocate(e) template T tmain(T argc) { diff --git a/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp index 01c1a2818f..b32b8f3074 100644 --- a/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -84,7 +85,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute firstprivate (argc) +#pragma omp target teams distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute firstprivate (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp index 0a2f5448ba..77f08f1dcd 100644 --- a/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -162,7 +163,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute lastprivate(argc) +#pragma omp target teams distribute lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp b/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp index a22b561320..c02f1b9bf9 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp @@ -72,7 +72,7 @@ public: } void bar() { int b, argv, d, c, e, f8; -#pragma omp target teams distribute parallel for default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) +#pragma omp target teams distribute parallel for allocate(b) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) allocate(e) for (int k = 0; k < a.a; ++k) ++a.a; } @@ -80,7 +80,7 @@ public: // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a) private(this->S7::a) // CHECK: #pragma omp target teams distribute parallel for private(this->a) private(this->a) -// CHECK: #pragma omp target teams distribute parallel for default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) +// CHECK: #pragma omp target teams distribute parallel for allocate(b) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) allocate(e) template T tmain(T argc) { diff --git a/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp index a278e9f89a..4cd7c4574c 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -84,7 +85,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for firstprivate (argc) +#pragma omp target teams distribute parallel for firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for firstprivate (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp index 3c5e815217..661eaac0f9 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp target teams distribute parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute parallel for lastprivate(argc) +#pragma omp target teams distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp index 43b0304bb9..3c7f164572 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -70,7 +71,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute parallel for private (argc) +#pragma omp target teams distribute parallel for private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp index 33a0e37b86..131ef8440c 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -107,7 +108,7 @@ T tmain(T argc) { for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute parallel for reduction(&& : argc) +#pragma omp target teams distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}} for (int j=0; j<100; j++) foo(); diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp index 5de2d4b195..86f243ee4d 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp @@ -33,7 +33,7 @@ public: } S7 &operator=(S7 &s) { int k; -#pragma omp target teams distribute parallel for simd private(a) private(this->a) linear(k) +#pragma omp target teams distribute parallel for simd allocate(a) private(a) private(this->a) linear(k) allocate(k) for (k = 0; k < s.a.a; ++k) ++s.a.a; @@ -58,7 +58,7 @@ public: } }; // CHECK: #pragma omp target teams distribute parallel for simd private(this->a) private(this->a) private(T::a) -// CHECK: #pragma omp target teams distribute parallel for simd private(this->a) private(this->a) linear(k) +// CHECK: #pragma omp target teams distribute parallel for simd allocate(this->a) private(this->a) private(this->a) linear(k) allocate(k) // CHECK: #pragma omp target teams distribute parallel for simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) // CHECK: #pragma omp target teams distribute parallel for simd simdlen(slen1) safelen(slen2) aligned(arr: alen) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp index 69292a7c61..3ef0389de0 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -84,7 +85,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for simd firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd firstprivate (argc) +#pragma omp target teams distribute parallel for simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd firstprivate (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp index d1adbd0d39..efcd5a4098 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp target teams distribute parallel for simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute parallel for simd lastprivate(argc) +#pragma omp target teams distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp index 372a976087..72d315aece 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -142,7 +143,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; // expected-error@+1 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} -#pragma omp target teams distribute parallel for simd linear (argc : 5) +#pragma omp target teams distribute parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp index 9cf810a9e9..81ed3ad8d9 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -70,7 +71,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp target teams distribute parallel for simd private (argc) + #pragma omp target teams distribute parallel for simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for simd private (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp index d3d9c60091..f7dd74c873 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -107,7 +108,7 @@ T tmain(T argc) { for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute parallel for simd reduction(&& : argc) +#pragma omp target teams distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} for (int j=0; j<100; j++) foo(); diff --git a/test/OpenMP/target_teams_distribute_private_messages.cpp b/test/OpenMP/target_teams_distribute_private_messages.cpp index 3d692a3f26..506beddfdf 100644 --- a/test/OpenMP/target_teams_distribute_private_messages.cpp +++ b/test/OpenMP/target_teams_distribute_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -70,7 +71,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute private (argc) +#pragma omp target teams distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute private (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_reduction_messages.cpp index 6a9e6782f6..6c245f1f28 100644 --- a/test/OpenMP/target_teams_distribute_reduction_messages.cpp +++ b/test/OpenMP/target_teams_distribute_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -112,7 +113,7 @@ T tmain(T argc) { for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute reduction(&& : argc) +#pragma omp target teams distribute reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}} for (int j=0; j<100; j++) foo(); diff --git a/test/OpenMP/target_teams_distribute_simd_ast_print.cpp b/test/OpenMP/target_teams_distribute_simd_ast_print.cpp index a96863572a..cf3e8fed67 100644 --- a/test/OpenMP/target_teams_distribute_simd_ast_print.cpp +++ b/test/OpenMP/target_teams_distribute_simd_ast_print.cpp @@ -33,7 +33,7 @@ public: } S7 &operator=(S7 &s) { int k; -#pragma omp target teams distribute simd private(a) private(this->a) linear(k) +#pragma omp target teams distribute simd allocate(a) private(a) private(this->a) linear(k) allocate(k) for (k = 0; k < s.a.a; ++k) ++s.a.a; return *this; @@ -55,7 +55,7 @@ public: } }; // CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) private(T::a) -// CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) linear(k) +// CHECK: #pragma omp target teams distribute simd allocate(this->a) private(this->a) private(this->a) linear(k) allocate(k) // CHECK: #pragma omp target teams distribute simd private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) // CHECK: #pragma omp target teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen) // CHECK: #pragma omp target teams distribute simd private(this->a) private(this->a) private(this->S::a) diff --git a/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp index a4aaba7f83..65c854281d 100644 --- a/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -84,7 +85,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute simd firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd firstprivate (argc) +#pragma omp target teams distribute simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd firstprivate (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp index 4dcc9ea754..bc5f3f8493 100644 --- a/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -88,7 +89,7 @@ int foomain(int argc, char **argv) { #pragma omp target teams distribute simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute simd lastprivate(argc) +#pragma omp target teams distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp b/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp index c353242bc1..a79fdcaff5 100644 --- a/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -209,7 +210,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; // expected-error@+1 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} -#pragma omp target teams distribute simd linear (argc) +#pragma omp target teams distribute simd linear (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute simd linear (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_simd_private_messages.cpp b/test/OpenMP/target_teams_distribute_simd_private_messages.cpp index eef86d229d..63dad4e32e 100644 --- a/test/OpenMP/target_teams_distribute_simd_private_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -70,7 +71,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute simd private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp target teams distribute simd private (argc) +#pragma omp target teams distribute simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute simd private (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp index 1b4b3ed88c..680794c195 100644 --- a/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s +extern int omp_default_mem_alloc; void foo() { } @@ -107,7 +108,7 @@ T tmain(T argc) { for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute simd reduction(&& : argc) +#pragma omp target teams distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} for (int j=0; j<100; j++) foo(); diff --git a/test/OpenMP/target_teams_firstprivate_messages.cpp b/test/OpenMP/target_teams_firstprivate_messages.cpp index 492796981a..4a1ab3f048 100644 --- a/test/OpenMP/target_teams_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -78,7 +79,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target teams firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} foo(); -#pragma omp target teams firstprivate(argc) +#pragma omp target teams firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target teams firstprivate(S1) // expected-error {{'S1' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_teams_private_messages.cpp b/test/OpenMP/target_teams_private_messages.cpp index ceb268f40a..9717d37509 100644 --- a/test/OpenMP/target_teams_private_messages.cpp +++ b/test/OpenMP/target_teams_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -78,7 +79,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target teams private (argv[1]) // expected-error {{expected variable name}} foo(); -#pragma omp target teams private(ba) +#pragma omp target teams private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target teams private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}} foo(); diff --git a/test/OpenMP/target_teams_reduction_messages.cpp b/test/OpenMP/target_teams_reduction_messages.cpp index 1c3eacfef4..6c71406746 100644 --- a/test/OpenMP/target_teams_reduction_messages.cpp +++ b/test/OpenMP/target_teams_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -112,7 +113,7 @@ T tmain(T argc) { foo(); #pragma omp target teams reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} foo(); -#pragma omp target teams reduction(&& : argc) +#pragma omp target teams reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target teams reduction(^ : T) // expected-error {{'T' does not refer to a value}} foo(); diff --git a/test/OpenMP/target_update_messages.cpp b/test/OpenMP/target_update_messages.cpp index da71ff6a5a..68b76344b9 100644 --- a/test/OpenMP/target_update_messages.cpp +++ b/test/OpenMP/target_update_messages.cpp @@ -26,7 +26,7 @@ int main(int argc, char **argv) { #pragma omp target update to(m) ] // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} #pragma omp target update to(m) ) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} - #pragma omp target update from(m) // OK + #pragma omp target update from(m) allocate(m) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target update'}} { foo(); } diff --git a/test/OpenMP/task_ast_print.cpp b/test/OpenMP/task_ast_print.cpp index 01ffda9f87..527f47072b 100644 --- a/test/OpenMP/task_ast_print.cpp +++ b/test/OpenMP/task_ast_print.cpp @@ -28,8 +28,8 @@ protected: public: S7(typename T::type v) : a(v) { -#pragma omp taskgroup task_reduction(+:b) -#pragma omp task private(a) private(this->a) private(T::a) in_reduction(+:this->b) +#pragma omp taskgroup allocate(b) task_reduction(+:b) +#pragma omp task private(a) private(this->a) private(T::a) in_reduction(+:this->b) allocate(b) for (int k = 0; k < a.a; ++k) ++this->a.a; } @@ -41,8 +41,8 @@ public: } }; -// CHECK: #pragma omp taskgroup task_reduction(+: this->b) -// CHECK: #pragma omp task private(this->a) private(this->a) private(T::a) in_reduction(+: this->b){{$}} +// CHECK: #pragma omp taskgroup allocate(this->b) task_reduction(+: this->b) +// CHECK: #pragma omp task private(this->a) private(this->a) private(T::a) in_reduction(+: this->b) allocate(this->b){{$}} // CHECK: #pragma omp task private(this->a) private(this->a) // CHECK: #pragma omp task private(this->a) private(this->a) private(this->S1::a) diff --git a/test/OpenMP/task_firstprivate_messages.cpp b/test/OpenMP/task_firstprivate_messages.cpp index d970f097a5..fac5f527b9 100644 --- a/test/OpenMP/task_firstprivate_messages.cpp +++ b/test/OpenMP/task_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -91,7 +92,7 @@ int main(int argc, char **argv) { #pragma omp task firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} -#pragma omp task firstprivate(argc) +#pragma omp task firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} #pragma omp task firstprivate(S1) // expected-error {{'S1' does not refer to a value}} #pragma omp task firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} #pragma omp task firstprivate(argv[1]) // expected-error {{expected variable name}} diff --git a/test/OpenMP/task_in_reduction_message.cpp b/test/OpenMP/task_in_reduction_message.cpp index e9bde31ec9..4120b73aba 100644 --- a/test/OpenMP/task_in_reduction_message.cpp +++ b/test/OpenMP/task_in_reduction_message.cpp @@ -7,6 +7,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s // SIMD-ONLY0-NOT: {{__kmpc|__tgt}} +extern int omp_default_mem_alloc; void foo() { } @@ -245,7 +246,7 @@ int main(int argc, char **argv) { #pragma omp task in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{in_reduction variable must have the same reduction operation as in a task_reduction clause}} foo(); } -#pragma omp task in_reduction(| : argc) +#pragma omp task in_reduction(| : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); } #pragma omp task in_reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}} diff --git a/test/OpenMP/task_private_messages.cpp b/test/OpenMP/task_private_messages.cpp index 2a3df509c2..9de045505c 100644 --- a/test/OpenMP/task_private_messages.cpp +++ b/test/OpenMP/task_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { #pragma omp task private(S1) // expected-error {{'S1' does not refer to a value}} #pragma omp task private(a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}} #pragma omp task private(argv[1]) // expected-error {{expected variable name}} -#pragma omp task private(ba) +#pragma omp task private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} #pragma omp task private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}} #pragma omp task private(da) // expected-error {{const-qualified variable cannot be private}} #pragma omp task private(S2::S2s) // expected-error {{shared variable cannot be private}} diff --git a/test/OpenMP/taskgroup_task_reduction_messages.cpp b/test/OpenMP/taskgroup_task_reduction_messages.cpp index 56abe2abe6..64d7c6c3ca 100644 --- a/test/OpenMP/taskgroup_task_reduction_messages.cpp +++ b/test/OpenMP/taskgroup_task_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -112,7 +113,7 @@ T tmain(T argc) { foo(); #pragma omp taskgroup task_reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} foo(); -#pragma omp taskgroup task_reduction(&& : argc) +#pragma omp taskgroup task_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp taskgroup task_reduction(^ : T) // expected-error {{'T' does not refer to a value}} foo(); diff --git a/test/OpenMP/taskloop_ast_print.cpp b/test/OpenMP/taskloop_ast_print.cpp index 97f797b7c9..d32ebb5a34 100644 --- a/test/OpenMP/taskloop_ast_print.cpp +++ b/test/OpenMP/taskloop_ast_print.cpp @@ -17,10 +17,10 @@ T tmain(T argc) { T b = argc, c, d, e, f, g; static T a; // CHECK: static T a; -#pragma omp taskgroup task_reduction(+: d) -#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) in_reduction(+: d) - // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) - // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) in_reduction(+: d){{$}} +#pragma omp taskgroup allocate(d) task_reduction(+: d) +#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) in_reduction(+: d) allocate(d) + // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d) + // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) in_reduction(+: d) allocate(d){{$}} for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/taskloop_firstprivate_messages.cpp b/test/OpenMP/taskloop_firstprivate_messages.cpp index a34d9bcd82..81c4fff15c 100644 --- a/test/OpenMP/taskloop_firstprivate_messages.cpp +++ b/test/OpenMP/taskloop_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -199,7 +200,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp parallel -#pragma omp taskloop firstprivate(argc) +#pragma omp taskloop firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel diff --git a/test/OpenMP/taskloop_in_reduction_messages.cpp b/test/OpenMP/taskloop_in_reduction_messages.cpp index 177217888e..bcfe86de29 100644 --- a/test/OpenMP/taskloop_in_reduction_messages.cpp +++ b/test/OpenMP/taskloop_in_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -164,7 +165,7 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(&&:argc) -#pragma omp taskloop in_reduction(&& : argc) +#pragma omp taskloop in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop in_reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/taskloop_lastprivate_messages.cpp b/test/OpenMP/taskloop_lastprivate_messages.cpp index c46a1f0c4c..5740aa50ad 100644 --- a/test/OpenMP/taskloop_lastprivate_messages.cpp +++ b/test/OpenMP/taskloop_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp taskloop lastprivate(argc) +#pragma omp taskloop lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/taskloop_private_messages.cpp b/test/OpenMP/taskloop_private_messages.cpp index ffe731d2c7..cba929cf3f 100644 --- a/test/OpenMP/taskloop_private_messages.cpp +++ b/test/OpenMP/taskloop_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp taskloop private(argc) +#pragma omp taskloop private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp taskloop private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_reduction_messages.cpp b/test/OpenMP/taskloop_reduction_messages.cpp index 4794c7a2d0..93024384ce 100644 --- a/test/OpenMP/taskloop_reduction_messages.cpp +++ b/test/OpenMP/taskloop_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -133,7 +134,7 @@ T tmain(T argc) { #pragma omp taskloop reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop reduction(&& : argc) +#pragma omp taskloop reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_ast_print.cpp b/test/OpenMP/taskloop_simd_ast_print.cpp index 0a847f8fad..d5403ed06d 100644 --- a/test/OpenMP/taskloop_simd_ast_print.cpp +++ b/test/OpenMP/taskloop_simd_ast_print.cpp @@ -18,10 +18,10 @@ T tmain(T argc) { T *ptr; static T a; // CHECK: static T a; -#pragma omp taskgroup task_reduction(+: d) -#pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d) - // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) - // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}} +#pragma omp taskgroup task_reduction(+: d) allocate(d) +#pragma omp taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d) + // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) allocate(d) + // CHECK-NEXT: #pragma omp taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}} for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/taskloop_simd_firstprivate_messages.cpp b/test/OpenMP/taskloop_simd_firstprivate_messages.cpp index 3fb5ad1706..662c4a5416 100644 --- a/test/OpenMP/taskloop_simd_firstprivate_messages.cpp +++ b/test/OpenMP/taskloop_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -93,7 +94,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp taskloop simd firstprivate(argc) +#pragma omp taskloop simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/taskloop_simd_in_reduction_messages.cpp b/test/OpenMP/taskloop_simd_in_reduction_messages.cpp index 5fa976b229..8d62ec8f49 100644 --- a/test/OpenMP/taskloop_simd_in_reduction_messages.cpp +++ b/test/OpenMP/taskloop_simd_in_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -164,7 +165,7 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(&&:argc) -#pragma omp taskloop simd in_reduction(&& : argc) +#pragma omp taskloop simd in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop simd in_reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_lastprivate_messages.cpp b/test/OpenMP/taskloop_simd_lastprivate_messages.cpp index 3ed65de247..912e033024 100644 --- a/test/OpenMP/taskloop_simd_lastprivate_messages.cpp +++ b/test/OpenMP/taskloop_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel -#pragma omp taskloop simd lastprivate(argc) +#pragma omp taskloop simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel diff --git a/test/OpenMP/taskloop_simd_linear_messages.cpp b/test/OpenMP/taskloop_simd_linear_messages.cpp index 645026c9fa..bf566e8ef2 100644 --- a/test/OpenMP/taskloop_simd_linear_messages.cpp +++ b/test/OpenMP/taskloop_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -127,7 +128,7 @@ template int foomain(I argc, C **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; - #pragma omp taskloop simd linear (argc : 5) + #pragma omp taskloop simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; diff --git a/test/OpenMP/taskloop_simd_private_messages.cpp b/test/OpenMP/taskloop_simd_private_messages.cpp index 68e5365251..3e654d3fc1 100644 --- a/test/OpenMP/taskloop_simd_private_messages.cpp +++ b/test/OpenMP/taskloop_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -116,7 +117,7 @@ int foomain(I argc, C **argv) { #pragma omp taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp taskloop simd private(argc) +#pragma omp taskloop simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_reduction_messages.cpp b/test/OpenMP/taskloop_simd_reduction_messages.cpp index fb279e28b8..0257cccba3 100644 --- a/test/OpenMP/taskloop_simd_reduction_messages.cpp +++ b/test/OpenMP/taskloop_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s +extern int omp_default_mem_alloc; void foo() { } @@ -133,7 +134,7 @@ T tmain(T argc) { #pragma omp taskloop simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop simd reduction(&& : argc) +#pragma omp taskloop simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/taskwait_messages.cpp b/test/OpenMP/taskwait_messages.cpp index 55bf2ddcad..ed7c53b070 100644 --- a/test/OpenMP/taskwait_messages.cpp +++ b/test/OpenMP/taskwait_messages.cpp @@ -4,7 +4,7 @@ template T tmain(T argc) { -#pragma omp taskwait +#pragma omp taskwait allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskwait'}} ; #pragma omp taskwait untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}} #pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}} diff --git a/test/OpenMP/taskyield_messages.cpp b/test/OpenMP/taskyield_messages.cpp index 48f741df91..cb66ccddf3 100644 --- a/test/OpenMP/taskyield_messages.cpp +++ b/test/OpenMP/taskyield_messages.cpp @@ -4,7 +4,7 @@ template T tmain(T argc) { -#pragma omp taskyield +#pragma omp taskyield allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskyield'}} ; #pragma omp taskyield untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}} #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}} diff --git a/test/OpenMP/teams_distribute_ast_print.cpp b/test/OpenMP/teams_distribute_ast_print.cpp index 8868802bbc..8673b453ea 100644 --- a/test/OpenMP/teams_distribute_ast_print.cpp +++ b/test/OpenMP/teams_distribute_ast_print.cpp @@ -10,6 +10,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + void foo() {} struct S { @@ -78,7 +88,7 @@ public: void bar() { int b, argv, d, c, e, f; #pragma omp target -#pragma omp teams distribute default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) +#pragma omp teams distribute allocate(omp_thread_mem_alloc:argv) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc:c) for (int k = 0; k < a.a; ++k) ++a.a; } @@ -88,7 +98,7 @@ public: // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) +// CHECK-NEXT: #pragma omp teams distribute allocate(omp_thread_mem_alloc: argv) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc: c) template T tmain(T argc) { diff --git a/test/OpenMP/teams_distribute_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_firstprivate_messages.cpp index e373a3a870..2bbe8d78dc 100644 --- a/test/OpenMP/teams_distribute_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -91,7 +92,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target -#pragma omp teams distribute firstprivate (argc) +#pragma omp teams distribute firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/teams_distribute_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_lastprivate_messages.cpp index a6440b7b6d..76f7139870 100644 --- a/test/OpenMP/teams_distribute_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target -#pragma omp teams distribute lastprivate(argc) +#pragma omp teams distribute lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp b/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp index 50d7b59fd9..c414a210a1 100644 --- a/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp @@ -81,7 +81,7 @@ public: void bar() { int b, argv, d, c, e, f8; #pragma omp target -#pragma omp teams distribute parallel for default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) copyin(x) +#pragma omp teams distribute parallel for allocate(b) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f8) thread_limit(d) copyin(x) allocate(argv) for (int k = 0; k < a.a; ++k) ++a.a; } @@ -93,7 +93,7 @@ public: // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute parallel for private(this->a) private(this->a) // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute parallel for default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) copyin(x) +// CHECK-NEXT: #pragma omp teams distribute parallel for allocate(b) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f8) thread_limit(d) copyin(x) allocate(argv) template T tmain(T argc) { diff --git a/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp index f495588754..35ef9792c4 100644 --- a/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -91,7 +92,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target -#pragma omp teams distribute parallel for firstprivate (argc) +#pragma omp teams distribute parallel for firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp index 14b7e8be2a..6207efadb1 100644 --- a/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target -#pragma omp teams distribute parallel for lastprivate(argc) +#pragma omp teams distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp index ba9e077437..5b22861f8e 100644 --- a/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target - #pragma omp teams distribute parallel for private (argc) + #pragma omp teams distribute parallel for private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp index 5eb69fd00b..5c982462c5 100644 --- a/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -119,7 +120,7 @@ T tmain(T argc) { #pragma omp teams distribute parallel for reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute parallel for reduction(&& : argc) +#pragma omp teams distribute parallel for reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp index bce89b7498..31a2e7e035 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp @@ -136,12 +136,12 @@ T tmain(T argc) { // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp target -#pragma omp teams distribute parallel for simd private(argc, b), firstprivate(c, d), collapse(2) +#pragma omp teams distribute parallel for simd allocate(b) private(argc, b), firstprivate(c, d), collapse(2) allocate(d) for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute parallel for simd private(argc,b) firstprivate(c,d) collapse(2) +// CHECK-NEXT: #pragma omp teams distribute parallel for simd allocate(b) private(argc,b) firstprivate(c,d) collapse(2) allocate(d) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp index 036f201230..611e9b808f 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -91,7 +92,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target -#pragma omp teams distribute parallel for simd firstprivate (argc) +#pragma omp teams distribute parallel for simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp index 7e78d06e93..f123f90243 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target -#pragma omp teams distribute parallel for simd lastprivate(argc) +#pragma omp teams distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp index c6fb77b496..798aa56559 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -161,7 +162,7 @@ template int foomain(I argc, C **argv) { // expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target -#pragma omp teams distribute parallel for simd linear (argc : 5) +#pragma omp teams distribute parallel for simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp index 7bbe4c2f23..9d4ca03f9e 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target - #pragma omp teams distribute parallel for simd private (argc) + #pragma omp teams distribute parallel for simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp index 9f203063f1..1efd4b05ca 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -119,7 +120,7 @@ T tmain(T argc) { #pragma omp teams distribute parallel for simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute parallel for simd reduction(&& : argc) +#pragma omp teams distribute parallel for simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/teams_distribute_private_messages.cpp b/test/OpenMP/teams_distribute_private_messages.cpp index c24504460e..130cbd5c57 100644 --- a/test/OpenMP/teams_distribute_private_messages.cpp +++ b/test/OpenMP/teams_distribute_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target - #pragma omp teams distribute private (argc) + #pragma omp teams distribute private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_reduction_messages.cpp b/test/OpenMP/teams_distribute_reduction_messages.cpp index f83dda6809..da86638ba0 100644 --- a/test/OpenMP/teams_distribute_reduction_messages.cpp +++ b/test/OpenMP/teams_distribute_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -125,7 +126,7 @@ T tmain(T argc) { #pragma omp teams distribute reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute reduction(&& : argc) +#pragma omp teams distribute reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/teams_distribute_simd_ast_print.cpp b/test/OpenMP/teams_distribute_simd_ast_print.cpp index f811b0b7ac..aa11622217 100644 --- a/test/OpenMP/teams_distribute_simd_ast_print.cpp +++ b/test/OpenMP/teams_distribute_simd_ast_print.cpp @@ -130,12 +130,12 @@ T tmain(T argc) { // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp target -#pragma omp teams distribute simd private(argc, b), firstprivate(c, d), collapse(2) +#pragma omp teams distribute simd allocate(b) private(argc, b), firstprivate(c, d), collapse(2) allocate(c) for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute simd private(argc,b) firstprivate(c,d) collapse(2) +// CHECK-NEXT: #pragma omp teams distribute simd allocate(b) private(argc,b) firstprivate(c,d) collapse(2) allocate(c) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp index 5b074c4cda..08a461a467 100644 --- a/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -91,7 +92,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target -#pragma omp teams distribute simd firstprivate (argc) +#pragma omp teams distribute simd firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (i = 0; i < argc; ++i) foo(); #pragma omp target diff --git a/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp index 5e0806b687..4feda4be2b 100644 --- a/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -95,7 +96,7 @@ int foomain(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target -#pragma omp teams distribute simd lastprivate(argc) +#pragma omp teams distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_simd_linear_messages.cpp b/test/OpenMP/teams_distribute_simd_linear_messages.cpp index 8548e3dcc0..43fe1a4239 100644 --- a/test/OpenMP/teams_distribute_simd_linear_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_linear_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; namespace X { int x; }; @@ -161,7 +162,7 @@ template int foomain(I argc, C **argv) { // expected-error@+2 {{only loop iteration variables are allowed in 'linear' clause in distribute directives}} #pragma omp target -#pragma omp teams distribute simd linear (argc : 5) +#pragma omp teams distribute simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_simd_private_messages.cpp b/test/OpenMP/teams_distribute_simd_private_messages.cpp index f2485b36a0..7ffdf86e3c 100644 --- a/test/OpenMP/teams_distribute_simd_private_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -77,7 +78,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) ++k; #pragma omp target - #pragma omp teams distribute simd private (argc) + #pragma omp teams distribute simd private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target diff --git a/test/OpenMP/teams_distribute_simd_reduction_messages.cpp b/test/OpenMP/teams_distribute_simd_reduction_messages.cpp index e590d3616d..fbe73e1f1e 100644 --- a/test/OpenMP/teams_distribute_simd_reduction_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -119,7 +120,7 @@ T tmain(T argc) { #pragma omp teams distribute simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute simd reduction(&& : argc) +#pragma omp teams distribute simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/teams_firstprivate_messages.cpp b/test/OpenMP/teams_firstprivate_messages.cpp index d29a2e3960..f04827708a 100644 --- a/test/OpenMP/teams_firstprivate_messages.cpp +++ b/test/OpenMP/teams_firstprivate_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -85,7 +86,7 @@ int main(int argc, char **argv) { #pragma omp teams firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} foo(); #pragma omp target -#pragma omp teams firstprivate(argc) +#pragma omp teams firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target #pragma omp teams firstprivate(S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/teams_private_messages.cpp b/test/OpenMP/teams_private_messages.cpp index 4ad7a0de29..5cc8a7a805 100644 --- a/test/OpenMP/teams_private_messages.cpp +++ b/test/OpenMP/teams_private_messages.cpp @@ -2,6 +2,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s +extern int omp_default_mem_alloc; void foo() { } @@ -89,7 +90,7 @@ int main(int argc, char **argv) { #pragma omp teams private (argv[1]) // expected-error {{expected variable name}} foo(); #pragma omp target - #pragma omp teams private(ba) + #pragma omp teams private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target #pragma omp teams private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}} diff --git a/test/OpenMP/teams_reduction_messages.cpp b/test/OpenMP/teams_reduction_messages.cpp index 37f58f8b17..558d766e70 100644 --- a/test/OpenMP/teams_reduction_messages.cpp +++ b/test/OpenMP/teams_reduction_messages.cpp @@ -6,6 +6,7 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-target // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-target +extern int omp_default_mem_alloc; void foo() { } @@ -125,7 +126,7 @@ T tmain(T argc) { #pragma omp teams reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}} foo(); #pragma omp target -#pragma omp teams reduction(&& : argc) +#pragma omp teams reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} foo(); #pragma omp target #pragma omp teams reduction(^ : T) // expected-error {{'T' does not refer to a value}} diff --git a/test/OpenMP/threadprivate_messages.cpp b/test/OpenMP/threadprivate_messages.cpp index 62ddfd1e63..381314246b 100644 --- a/test/OpenMP/threadprivate_messages.cpp +++ b/test/OpenMP/threadprivate_messages.cpp @@ -19,7 +19,7 @@ struct CompleteSt1{ int a; // expected-note {{'a' defined here}} -#pragma omp threadprivate(a) +#pragma omp threadprivate(a) allocate(a) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}} #pragma omp threadprivate(u) // expected-error {{use of undeclared identifier 'u'}} #pragma omp threadprivate(d, a) int foo() { // expected-note {{declared here}} -- cgit v1.2.3 From 522c8dac2d3d16fe43cae5a9a709e58ffd469a70 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 28 Mar 2019 19:15:36 +0000 Subject: [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357205 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_lastprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_linear_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_private_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_reduction_messages.cpp | 13 +++++++++++-- .../target_parallel_for_simd_firstprivate_messages.cpp | 13 +++++++++++-- .../target_parallel_for_simd_lastprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_simd_linear_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_for_simd_private_messages.cpp | 15 ++++++++++++--- .../target_parallel_for_simd_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_private_messages.cpp | 13 +++++++++++-- test/OpenMP/target_parallel_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/target_private_messages.cpp | 15 ++++++++++++--- test/OpenMP/target_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/target_simd_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_simd_lastprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_simd_linear_messages.cpp | 13 +++++++++++-- test/OpenMP/target_simd_private_messages.cpp | 15 ++++++++++++--- test/OpenMP/target_simd_reduction_messages.cpp | 13 +++++++++++-- .../target_teams_distribute_firstprivate_messages.cpp | 13 +++++++++++-- .../target_teams_distribute_lastprivate_messages.cpp | 13 +++++++++++-- ...eams_distribute_parallel_for_firstprivate_messages.cpp | 13 +++++++++++-- ...teams_distribute_parallel_for_lastprivate_messages.cpp | 13 +++++++++++-- ...get_teams_distribute_parallel_for_private_messages.cpp | 13 +++++++++++-- ...t_teams_distribute_parallel_for_reduction_messages.cpp | 13 +++++++++++-- ...distribute_parallel_for_simd_firstprivate_messages.cpp | 13 +++++++++++-- ..._distribute_parallel_for_simd_lastprivate_messages.cpp | 13 +++++++++++-- ...teams_distribute_parallel_for_simd_linear_messages.cpp | 11 ++++++++++- ...eams_distribute_parallel_for_simd_private_messages.cpp | 13 +++++++++++-- ...ms_distribute_parallel_for_simd_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/target_teams_distribute_private_messages.cpp | 13 +++++++++++-- .../OpenMP/target_teams_distribute_reduction_messages.cpp | 13 +++++++++++-- ...target_teams_distribute_simd_firstprivate_messages.cpp | 13 +++++++++++-- .../target_teams_distribute_simd_lastprivate_messages.cpp | 13 +++++++++++-- .../target_teams_distribute_simd_linear_messages.cpp | 11 ++++++++++- .../target_teams_distribute_simd_private_messages.cpp | 13 +++++++++++-- .../target_teams_distribute_simd_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/target_teams_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/target_teams_private_messages.cpp | 13 +++++++++++-- test/OpenMP/target_teams_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/task_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/task_in_reduction_message.cpp | 13 +++++++++++-- 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 +++++++++++-- test/OpenMP/taskloop_private_messages.cpp | 15 ++++++++++++--- test/OpenMP/taskloop_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/taskloop_simd_firstprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/taskloop_simd_in_reduction_messages.cpp | 13 +++++++++++-- test/OpenMP/taskloop_simd_lastprivate_messages.cpp | 13 +++++++++++-- test/OpenMP/taskloop_simd_linear_messages.cpp | 13 +++++++++++-- test/OpenMP/taskloop_simd_private_messages.cpp | 15 ++++++++++++--- test/OpenMP/taskloop_simd_reduction_messages.cpp | 13 +++++++++++-- 56 files changed, 619 insertions(+), 115 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_firstprivate_messages.cpp b/test/OpenMP/target_firstprivate_messages.cpp index 2ab3a80a5e..248751f789 100644 --- a/test/OpenMP/target_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_firstprivate_messages.cpp b/test/OpenMP/target_parallel_firstprivate_messages.cpp index 36490394a0..d6c1bb2496 100644 --- a/test/OpenMP/target_parallel_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_firstprivate_messages.cpp b/test/OpenMP/target_parallel_for_firstprivate_messages.cpp index 3a425178d1..286faec963 100644 --- a/test/OpenMP/target_parallel_for_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_lastprivate_messages.cpp b/test/OpenMP/target_parallel_for_lastprivate_messages.cpp index ce5e1bfbd0..d01e393bae 100644 --- a/test/OpenMP/target_parallel_for_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_linear_messages.cpp b/test/OpenMP/target_parallel_for_linear_messages.cpp index c08530398c..3556faa3ca 100644 --- a/test/OpenMP/target_parallel_for_linear_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_private_messages.cpp b/test/OpenMP/target_parallel_for_private_messages.cpp index 4a6b2c2899..2e3848a600 100644 --- a/test/OpenMP/target_parallel_for_private_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_reduction_messages.cpp b/test/OpenMP/target_parallel_for_reduction_messages.cpp index 8eeafd4548..3b201f2f2e 100644 --- a/test/OpenMP/target_parallel_for_reduction_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp index aebc45a937..77661a3133 100644 --- a/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp index 82271e1be0..750fa3b19a 100644 --- a/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_simd_linear_messages.cpp b/test/OpenMP/target_parallel_for_simd_linear_messages.cpp index 30b0308a22..b5664dd317 100644 --- a/test/OpenMP/target_parallel_for_simd_linear_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_simd_private_messages.cpp b/test/OpenMP/target_parallel_for_simd_private_messages.cpp index 923f6378b0..6210323330 100644 --- a/test/OpenMP/target_parallel_for_simd_private_messages.cpp +++ b/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/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp index 5d40388fa9..87be4f1c65 100644 --- a/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp +++ b/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/test/OpenMP/target_parallel_private_messages.cpp b/test/OpenMP/target_parallel_private_messages.cpp index 52826a54df..97ed1fc96a 100644 --- a/test/OpenMP/target_parallel_private_messages.cpp +++ b/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/test/OpenMP/target_parallel_reduction_messages.cpp b/test/OpenMP/target_parallel_reduction_messages.cpp index 01a9d01b7e..eca57a8cce 100644 --- a/test/OpenMP/target_parallel_reduction_messages.cpp +++ b/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/test/OpenMP/target_private_messages.cpp b/test/OpenMP/target_private_messages.cpp index 4463dcfb99..245a0ea2b0 100644 --- a/test/OpenMP/target_private_messages.cpp +++ b/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/test/OpenMP/target_reduction_messages.cpp b/test/OpenMP/target_reduction_messages.cpp index b95be1f628..b9b744f455 100644 --- a/test/OpenMP/target_reduction_messages.cpp +++ b/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/test/OpenMP/target_simd_firstprivate_messages.cpp b/test/OpenMP/target_simd_firstprivate_messages.cpp index 9063937d0a..eac95ade6f 100644 --- a/test/OpenMP/target_simd_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_simd_lastprivate_messages.cpp b/test/OpenMP/target_simd_lastprivate_messages.cpp index d7ee2ca768..8b485840ce 100644 --- a/test/OpenMP/target_simd_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_simd_linear_messages.cpp b/test/OpenMP/target_simd_linear_messages.cpp index 4b04497c4a..86e3cc43fb 100644 --- a/test/OpenMP/target_simd_linear_messages.cpp +++ b/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/test/OpenMP/target_simd_private_messages.cpp b/test/OpenMP/target_simd_private_messages.cpp index 65ac875129..f95d77c302 100644 --- a/test/OpenMP/target_simd_private_messages.cpp +++ b/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/test/OpenMP/target_simd_reduction_messages.cpp b/test/OpenMP/target_simd_reduction_messages.cpp index e7a8737a63..e50159462c 100644 --- a/test/OpenMP/target_simd_reduction_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp index b32b8f3074..833f951b78 100644 --- a/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp index 77f08f1dcd..a7e33d0e78 100644 --- a/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp index 4cd7c4574c..d7be6062eb 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp index 661eaac0f9..d06628fef8 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp index 3c7f164572..86410b3faf 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp index 131ef8440c..01175deeca 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp index 3ef0389de0..46a91c953b 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp index efcd5a4098..2652079514 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp index 72d315aece..029401a64c 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp index 81ed3ad8d9..1f3a131326 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_private_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp index f7dd74c873..6e298a7e6b 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_private_messages.cpp b/test/OpenMP/target_teams_distribute_private_messages.cpp index 506beddfdf..93989a5840 100644 --- a/test/OpenMP/target_teams_distribute_private_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_reduction_messages.cpp index 6c245f1f28..bdde93bd93 100644 --- a/test/OpenMP/target_teams_distribute_reduction_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp index 65c854281d..1ce3adc74d 100644 --- a/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp index bc5f3f8493..1235f81a21 100644 --- a/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp b/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp index a79fdcaff5..f4131ed7ae 100644 --- a/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_simd_private_messages.cpp b/test/OpenMP/target_teams_distribute_simd_private_messages.cpp index 63dad4e32e..7edcaf19a3 100644 --- a/test/OpenMP/target_teams_distribute_simd_private_messages.cpp +++ b/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/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp b/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp index 680794c195..c033c05802 100644 --- a/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp +++ b/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/test/OpenMP/target_teams_firstprivate_messages.cpp b/test/OpenMP/target_teams_firstprivate_messages.cpp index 4a1ab3f048..9f6eb8ad81 100644 --- a/test/OpenMP/target_teams_firstprivate_messages.cpp +++ b/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/test/OpenMP/target_teams_private_messages.cpp b/test/OpenMP/target_teams_private_messages.cpp index 9717d37509..7714113af7 100644 --- a/test/OpenMP/target_teams_private_messages.cpp +++ b/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/test/OpenMP/target_teams_reduction_messages.cpp b/test/OpenMP/target_teams_reduction_messages.cpp index 6c71406746..2d8a47b7f8 100644 --- a/test/OpenMP/target_teams_reduction_messages.cpp +++ b/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/test/OpenMP/task_firstprivate_messages.cpp b/test/OpenMP/task_firstprivate_messages.cpp index fac5f527b9..b34cda78d1 100644 --- a/test/OpenMP/task_firstprivate_messages.cpp +++ b/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/test/OpenMP/task_in_reduction_message.cpp b/test/OpenMP/task_in_reduction_message.cpp index 4120b73aba..d064a5f625 100644 --- a/test/OpenMP/task_in_reduction_message.cpp +++ b/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/test/OpenMP/task_private_messages.cpp b/test/OpenMP/task_private_messages.cpp index 9de045505c..934f5aad8c 100644 --- a/test/OpenMP/task_private_messages.cpp +++ b/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/test/OpenMP/taskloop_firstprivate_messages.cpp b/test/OpenMP/taskloop_firstprivate_messages.cpp index 81c4fff15c..fde767da94 100644 --- a/test/OpenMP/taskloop_firstprivate_messages.cpp +++ b/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/test/OpenMP/taskloop_in_reduction_messages.cpp b/test/OpenMP/taskloop_in_reduction_messages.cpp index bcfe86de29..00c17d0a19 100644 --- a/test/OpenMP/taskloop_in_reduction_messages.cpp +++ b/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/test/OpenMP/taskloop_lastprivate_messages.cpp b/test/OpenMP/taskloop_lastprivate_messages.cpp index 5740aa50ad..929d2b801c 100644 --- a/test/OpenMP/taskloop_lastprivate_messages.cpp +++ b/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/test/OpenMP/taskloop_private_messages.cpp b/test/OpenMP/taskloop_private_messages.cpp index cba929cf3f..107a2f4b76 100644 --- a/test/OpenMP/taskloop_private_messages.cpp +++ b/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/test/OpenMP/taskloop_reduction_messages.cpp b/test/OpenMP/taskloop_reduction_messages.cpp index 93024384ce..a1c533cfe0 100644 --- a/test/OpenMP/taskloop_reduction_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_firstprivate_messages.cpp b/test/OpenMP/taskloop_simd_firstprivate_messages.cpp index 662c4a5416..7553bd2fec 100644 --- a/test/OpenMP/taskloop_simd_firstprivate_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_in_reduction_messages.cpp b/test/OpenMP/taskloop_simd_in_reduction_messages.cpp index 8d62ec8f49..6ad8bad2a3 100644 --- a/test/OpenMP/taskloop_simd_in_reduction_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_lastprivate_messages.cpp b/test/OpenMP/taskloop_simd_lastprivate_messages.cpp index 912e033024..ec0d071a1d 100644 --- a/test/OpenMP/taskloop_simd_lastprivate_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_linear_messages.cpp b/test/OpenMP/taskloop_simd_linear_messages.cpp index bf566e8ef2..05b08d6d75 100644 --- a/test/OpenMP/taskloop_simd_linear_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_private_messages.cpp b/test/OpenMP/taskloop_simd_private_messages.cpp index 3e654d3fc1..4198c891c2 100644 --- a/test/OpenMP/taskloop_simd_private_messages.cpp +++ b/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/test/OpenMP/taskloop_simd_reduction_messages.cpp b/test/OpenMP/taskloop_simd_reduction_messages.cpp index 0257cccba3..dc3a389fc0 100644 --- a/test/OpenMP/taskloop_simd_reduction_messages.cpp +++ b/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) -- cgit v1.2.3 From c0876c1cbb17e5ecfffa8cc74e2f80fc47a94185 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 1 Apr 2019 14:25:31 +0000 Subject: [OPENMP] Check that allocated variables are used in private clauses. According to OpenMP 5.0 standard, 2.11.4 allocate Clause, Restrictions, For any list item that is specified in the allocate clause on a directive, a data-sharing attribute clause that may create a private copy of that list item must be specified on the same directive. Patch adds the checks for this restriction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357390 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_messages.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_messages.cpp b/test/OpenMP/allocate_messages.cpp index 2d40f792d1..cde714244c 100644 --- a/test/OpenMP/allocate_messages.cpp +++ b/test/OpenMP/allocate_messages.cpp @@ -146,4 +146,6 @@ label: #pragma omp allocate(a) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'a' variable declaration}} return (y); #pragma omp allocate(d) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'd' variable declaration}} +#pragma omp parallel allocate(d) // expected-error {{the referenced item is not found in any private clause on the same directive}} + ; } -- cgit v1.2.3 From 8aead58dfcd599634ffb831526046923018d0cd1 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 1 Apr 2019 16:56:59 +0000 Subject: [OPENMP]Allocate clause allocator in target region. According to OpenMP 5.0, 2.11.4 allocate Clause, Restrictions, allocate clauses that appear on a target construct or on constructs in a target region must specify an allocator expression unless a requires directive with the dynamic_allocators clause is present in the same compilation unit. Patch adds a check for this restriction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357412 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_allocate_messages.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_allocate_messages.cpp b/test/OpenMP/nvptx_allocate_messages.cpp index 5bb9422227..e6fb83f634 100644 --- a/test/OpenMP/nvptx_allocate_messages.cpp +++ b/test/OpenMP/nvptx_allocate_messages.cpp @@ -57,6 +57,11 @@ template T foo() { T v; #pragma omp allocate(v) allocator(omp_cgroup_mem_alloc) v = ST::m; +#if defined(DEVICE) && !defined(REQUIRES) +// expected-error@+2 2 {{expected an allocator expression inside of the target region; provide an allocator expression or use 'requires' directive with the 'dynamic_allocators' clause}} +#endif // DEVICE && !REQUIRES +#pragma omp parallel private(v) allocate(v) + v = 0; return v; } @@ -75,6 +80,7 @@ int main () { #endif // DEVICE && !REQUIRES #pragma omp allocate(b) #if defined(DEVICE) && !defined(REQUIRES) +// expected-note@+3 {{in instantiation of function template specialization 'foo' requested here}} // expected-note@+2 {{called by 'main'}} #endif // DEVICE && !REQUIRES return (foo() + bar()); -- cgit v1.2.3 From 2f03b60f2c0f44524f2822a0a254627814e331e9 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Mon, 1 Apr 2019 17:47:41 +0000 Subject: [CodeGen] Generate follow-up metadata for loops with more than one transformation. Before this patch, CGLoop would dump all transformations for a loop into a single LoopID without encoding any order in which to apply them. rL348944 added the possibility to encode a transformation order using followup-attributes. When a loop has more than one transformation, use the follow-up attribute define the order in which they are applied. The emitted order is the defacto order as defined by the current LLVM pass pipeline, which is: LoopFullUnrollPass LoopDistributePass LoopVectorizePass LoopUnrollAndJamPass LoopUnrollPass MachinePipeliner This patch should therefore not change the assembly output, assuming that all explicit transformations can be applied, and no implicit transformations in-between. In the former case, WarnMissedTransformationsPass should emit a warning (except for MachinePipeliner which is not implemented yet). The latter could be avoided by adding 'llvm.loop.disable_nonforced' attributes. Because LoopUnrollAndJamPass processes a loop nest, generation of the MDNode is delayed to after the inner loop metadata have been processed. A temporary LoopID is therefore used to annotate instructions and RAUW'ed by the actual LoopID later. Differential Revision: https://reviews.llvm.org/D57978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357415 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/simd_metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/simd_metadata.c b/test/OpenMP/simd_metadata.c index 44a7e901a0..f0ae0200dd 100644 --- a/test/OpenMP/simd_metadata.c +++ b/test/OpenMP/simd_metadata.c @@ -147,16 +147,16 @@ void h3(float *c, float *a, float *b, int size) // CHECK: [[LOOP_H1_HEADER:![0-9]+]] = distinct !{[[LOOP_H1_HEADER]], [[LOOP_WIDTH_8:![0-9]+]], [[LOOP_VEC_ENABLE]]} // CHECK: [[LOOP_WIDTH_8]] = !{!"llvm.loop.vectorize.width", i32 8} // CHECK: ![[ACCESS_GROUP_7]] = distinct !{} -// CHECK: [[LOOP_H1_HEADER:![0-9]+]] = distinct !{[[LOOP_H1_HEADER]], [[LOOP_WIDTH_8]], [[LOOP_VEC_ENABLE]], ![[PARALLEL_ACCESSES_9:[0-9]+]]} +// CHECK: [[LOOP_H1_HEADER:![0-9]+]] = distinct !{[[LOOP_H1_HEADER]], ![[PARALLEL_ACCESSES_9:[0-9]+]], [[LOOP_WIDTH_8]], [[LOOP_VEC_ENABLE]]} // CHECK: ![[PARALLEL_ACCESSES_9]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_7]]} // // Metadata for h2: // CHECK: ![[ACCESS_GROUP_10]] = distinct !{} -// CHECK: [[LOOP_H2_HEADER]] = distinct !{[[LOOP_H2_HEADER]], [[LOOP_VEC_ENABLE]], ![[PARALLEL_ACCESSES_12:[0-9]+]]} +// CHECK: [[LOOP_H2_HEADER]] = distinct !{[[LOOP_H2_HEADER]], ![[PARALLEL_ACCESSES_12:[0-9]+]], [[LOOP_VEC_ENABLE]]} // CHECK: ![[PARALLEL_ACCESSES_12]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_10]]} // // Metadata for h3: // CHECK: ![[ACCESS_GROUP_13]] = distinct !{} -// CHECK: [[LOOP_H3_HEADER]] = distinct !{[[LOOP_H3_HEADER]], [[LOOP_VEC_ENABLE]], ![[PARALLEL_ACCESSES_15:[0-9]+]]} +// CHECK: [[LOOP_H3_HEADER]] = distinct !{[[LOOP_H3_HEADER]], ![[PARALLEL_ACCESSES_15:[0-9]+]], [[LOOP_VEC_ENABLE]]} // CHECK: ![[PARALLEL_ACCESSES_15]] = !{!"llvm.loop.parallel_accesses", ![[ACCESS_GROUP_13]]} // -- cgit v1.2.3 From bb0e97888cc58a6786b3e59f4d00875503ee4fc4 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 2 Apr 2019 16:03:40 +0000 Subject: [OPENMP]Fix mapping of the pointers captured by reference. If the pointer is captured by reference, it must be mapped as _PTR_AND_OBJ kind of mapping to correctly translate the pointer address on the device. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357488 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/target_firstprivate_codegen.cpp | 38 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/target_firstprivate_codegen.cpp b/test/OpenMP/target_firstprivate_codegen.cpp index e1d5019a2b..b28b6b83f6 100644 --- a/test/OpenMP/target_firstprivate_codegen.cpp +++ b/test/OpenMP/target_firstprivate_codegen.cpp @@ -53,8 +53,8 @@ struct TT { // TCHECK-DAG: [[S1:%.+]] = type { double } // CHECK-DAG: [[FP_E:@__omp_offloading_firstprivate_.+_e_l76]] = internal global [[TTII]] zeroinitializer -// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [1 x i{{32|64}}] [i[[SZ:32|64]] 4] -// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [1 x i64] [i64 800] +// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i{{32|64}}] [i[[SZ:32|64]] 4, i{{64|32}} {{8|4}}] +// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 800, i64 561] // CHECK-DAG: [[MAPT2:@.+]] = private unnamed_addr constant [9 x i64] [i64 800, i64 673, i64 288, i64 673, i64 673, i64 288, i64 288, i64 673, i64 673] // CHECK-DAG: [[SIZET3:@.+]] = private unnamed_addr constant [2 x i{{32|64}}] [i{{32|64}} 0, i{{32|64}} 8] // CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 549] @@ -74,8 +74,9 @@ int foo(int n, double *ptr) { double cn[5][n]; TT d; const TT e = {n, n}; + int *p __attribute__ ((aligned (64))) = &a; -#pragma omp target firstprivate(a) +#pragma omp target firstprivate(a, p) { } @@ -88,9 +89,10 @@ int foo(int n, double *ptr) { // CHECK: [[SSTACK:%.+]] = alloca i8*, // CHECK: [[C:%.+]] = alloca [5 x [10 x double]], // CHECK: [[D:%.+]] = alloca [[TT]], + // CHECK: [[P:%.+]] = alloca i32*, align 64 // CHECK: [[ACAST:%.+]] = alloca i{{[0-9]+}}, - // CHECK: [[BASE_PTR_ARR:%.+]] = alloca [1 x i8*], - // CHECK: [[PTR_ARR:%.+]] = alloca [1 x i8*], + // CHECK: [[BASE_PTR_ARR:%.+]] = alloca [2 x i8*], + // CHECK: [[PTR_ARR:%.+]] = alloca [2 x i8*], // CHECK: [[A2CAST:%.+]] = alloca i{{[0-9]+}}, // CHECK: [[BASE_PTR_ARR2:%.+]] = alloca [9 x i8*], // CHECK: [[PTR_ARR2:%.+]] = alloca [9 x i8*], @@ -113,20 +115,30 @@ int foo(int n, double *ptr) { // CHECK-64: store i{{[0-9]+}} [[AVAL]], i{{[0-9]+}}* [[CONV]], // CHECK-32: store i{{[0-9]+}} [[AVAL]], i{{[0-9]+}}* [[ACAST]], // CHECK: [[ACAST_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[ACAST]], - // CHECK: [[BASE_PTR_GEP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[P_PTR:%.+]] = load i32*, i32** [[P]], align 64 + // CHECK: [[BASE_PTR_GEP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[ACAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP]] to i{{[0-9]+}}* // CHECK: store i{{[0-9]+}} [[ACAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR]], - // CHECK: [[PTR_GEP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[PTR_GEP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[ACAST_TOPTR2:%.+]] = bitcast i8** [[PTR_GEP]] to i{{[0-9]+}}* // CHECK: store i{{[0-9]+}} [[ACAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR2]], - // CHECK: [[BASE_PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: [[PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 1, i8** [[BASE_PTR_GEP_ARG]], i8** [[PTR_GEP_ARG]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPT]], i32 0, i32 0)) - - // TCHECK: define weak void @__omp_offloading_{{.+}}(i{{[0-9]+}} [[A_IN:%.+]]) + // CHECK: [[BASE_PTR_GEP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[PCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP]] to i32*** + // CHECK: store i32** [[P]], i32*** [[PCAST_TOPTR]], + // CHECK: [[PTR_GEP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 + // CHECK: [[PCAST_TOPTR2:%.+]] = bitcast i8** [[PTR_GEP]] to i32** + // CHECK: store i32* [[P_PTR]], i32** [[PCAST_TOPTR2]], + // CHECK: [[BASE_PTR_GEP_ARG:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: [[PTR_GEP_ARG:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 + // CHECK: {{.+}} = call i32 @__tgt_target(i64 -1, {{.+}}, i32 2, i8** [[BASE_PTR_GEP_ARG]], i8** [[PTR_GEP_ARG]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT]], i32 0, i32 0)) + + // TCHECK: define weak void @__omp_offloading_{{.+}}(i{{[0-9]+}} [[A_IN:%.+]], i32** dereferenceable{{.+}} [[P_IN:%.+]]) // TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}}, - // TCHECK-NOT: alloca i{{[0-9]+}}, + // TCHECK: [[P_ADDR:%.+]] = alloca i32**, + // TCHECK: [[P_PRIV:%.+]] = alloca i32*, + // TCHECK-NOT: alloca i{{[0-9]+}} // TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]], + // TCHECK: store i32** [[P_IN]], i32*** [[P_ADDR]], // TCHECK-NOT: store i{{[0-9]+}} % // TCHECK: ret void -- cgit v1.2.3 From bc0fd569105bad7efd7f25b0947cc6e457107c81 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 2 Apr 2019 19:44:46 +0000 Subject: [OPENMP]Add codegen for private vars with allocate clause. Added codegen/test for the privatized variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357514 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/parallel_private_codegen.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/parallel_private_codegen.cpp b/test/OpenMP/parallel_private_codegen.cpp index 33a5b4cba0..7271c3f5a0 100644 --- a/test/OpenMP/parallel_private_codegen.cpp +++ b/test/OpenMP/parallel_private_codegen.cpp @@ -13,6 +13,16 @@ // expected-no-diagnostics #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + template struct S { T f; @@ -54,7 +64,7 @@ template struct SST { T a; SST() : a(T()) { -#pragma omp parallel private(a) +#pragma omp parallel private(a) allocate(omp_large_cap_mem_alloc:a) #ifdef LAMBDA [&]() { [&]() { @@ -343,12 +353,18 @@ int main() { // CHECK: ret // CHECK: define internal void [[SST_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[SST_TY]]* %{{.+}}) -// CHECK: [[A_PRIV:%.+]] = alloca i{{[0-9]+}}, +// CHECK: [[GTID_ADDR_PTR:%.+]] = alloca i32*, +// CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_PTR]], +// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]], +// CHECK: [[LARGE_CAP_ALLOC:%.+]] = load i8**, i8*** @omp_large_cap_mem_alloc, +// CHECK: [[A_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[LARGE_CAP_ALLOC]]) +// CHECK: [[A_PRIV:%.+]] = bitcast i8* [[A_VOID_PTR]] to i32* // CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REF:%.+]], // CHECK-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REF]], // CHECK-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]], // CHECK-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1 // CHECK-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]], +// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[A_VOID_PTR]], i8** [[LARGE_CAP_ALLOC]]) // CHECK-NEXT: ret void #endif -- cgit v1.2.3 From 456575d0e83a9cbf7e35e844a431a0f3ec58c582 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 3 Apr 2019 17:57:06 +0000 Subject: [OPENMP]Add codegen for firstprivate vars with allocate clause. Added codegen/test for the firstprivatized variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357617 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/parallel_firstprivate_codegen.cpp | 62 +++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 4 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/parallel_firstprivate_codegen.cpp b/test/OpenMP/parallel_firstprivate_codegen.cpp index 6772f61779..e448a406e0 100644 --- a/test/OpenMP/parallel_firstprivate_codegen.cpp +++ b/test/OpenMP/parallel_firstprivate_codegen.cpp @@ -33,6 +33,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + struct St { int a, b; St() : a(0), b(0) {} @@ -322,7 +332,7 @@ int main() { s_arr[0] = var; sivar = 2; } -#pragma omp parallel firstprivate(t_var) +#pragma omp parallel allocate(omp_default_mem_alloc: t_var) firstprivate(t_var) {} return tmain(); #endif @@ -333,6 +343,7 @@ int main() { // CHECK: [[T_VAR:%.+]] = alloca i32, // CHECK: [[T_VARCAST:%.+]] = alloca [[iz:i64|i32]], // CHECK: [[SIVARCAST:%.+]] = alloca [[iz]], +// CHECK: [[T_VARCAST1:%.+]] = alloca [[iz:i64|i32]], // CHECK: call {{.*}} [[S_FLOAT_TY_DEF_CONSTR:@.+]]([[S_FLOAT_TY]]* [[TEST]]) // CHECK: [[T_VARVAL:%.+]] = load i32, i32* [[T_VAR]], // CHECK-64: [[T_VARCONV:%.+]] = bitcast i64* [[T_VARCAST]] to i32* @@ -345,6 +356,12 @@ int main() { // CHECK-32: store i32 [[SIVARVAL]], i32* [[SIVARCAST]], // CHECK: [[SIVARPVT:%.+]] = load [[iz]], [[iz]]* [[SIVARCAST]], // CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 5, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [2 x i32]*, [[iz]], [2 x [[S_FLOAT_TY]]]*, [[S_FLOAT_TY]]*, i{{[0-9]+}})* [[MAIN_MICROTASK:@.+]] to void {{.*}}[[iz]] [[T_VARPVT]],{{.*}}[[iz]] [[SIVARPVT]] +// CHECK: [[T_VARVAL:%.+]] = load i32, i32* [[T_VAR]], +// CHECK-64: [[T_VARCONV:%.+]] = bitcast i64* [[T_VARCAST1]] to i32* +// CHECK-64: store i32 [[T_VARVAL]], i32* [[T_VARCONV]], +// CHECK-32: store i32 [[T_VARVAL]], i32* [[T_VARCAST1]], +// CHECK: [[T_VARPVT:%.+]] = load [[iz]], [[iz]]* [[T_VARCAST1]], +// CHECK: call {{.*}}void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[iz]])* [[MAIN_MICROTASK1:@.+]] to void {{.*}}[[iz]] [[T_VARPVT]]) // CHECK: = call {{.*}}i{{.+}} [[TMAIN_INT:@.+]]() // CHECK: call {{.*}} [[S_FLOAT_TY_DESTR:@.+]]([[S_FLOAT_TY]]* // CHECK: ret @@ -387,6 +404,24 @@ int main() { // CHECK-DAG: call {{.*}} [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]* [[VAR_PRIV]]) // CHECK-DAG: call {{.*}} [[S_FLOAT_TY_DESTR]]([[S_FLOAT_TY]]* // CHECK: ret void + + +// CHECK: define internal void [[MAIN_MICROTASK1]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [[iz]] [[T_VAR:%.+]]) +// CHECK: [[GTID_ADDR:%.+]] = alloca i32*, +// CHECK: store [[iz]] [[T_VAR]], [[iz]]* [[T_VAR_ADDR:%.+]], +// CHECK-64: [[BC:%.+]] = bitcast [[iz]]* [[T_VAR_ADDR]] to i32* +// CHECK: [[GTID_PTR:%.+]] = load i32*, i32** [[GTID_ADDR]], +// CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_PTR]], +// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_default_mem_alloc, +// CHECK: [[T_VAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], [[iz]] 4, i8** [[ALLOCATOR]]) +// CHECK: [[T_VAR_PRIV:%.+]] = bitcast i8* [[T_VAR_VOID_PTR]] to i32* +// CHECK-32: [[T_VAR_VAL:%.+]] = load i32, i32* [[T_VAR_ADDR]], +// CHECK-64: [[T_VAR_VAL:%.+]] = load i32, i32* [[BC]], +// CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_PRIV]], +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[T_VAR_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK: ret void + + // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]() // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]], // CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]]) @@ -480,6 +515,16 @@ int main() { #endif #else +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 St { int a, b; St() : a(0), b(0) {} @@ -488,7 +533,7 @@ struct St { void St_func(St s[2], int n, long double vla1[n]) { double vla2[n][n] __attribute__((aligned(128))); a = b; -#pragma omp parallel firstprivate(s, vla1, vla2) +#pragma omp parallel allocate(omp_thread_mem_alloc:vla2) firstprivate(s, vla1, vla2) vla1[b] = vla2[1][n - 1] = a = b; } }; @@ -521,9 +566,18 @@ void array_func(float a[3], St s[2], int n, long double vla1[n]) { // ARRAY-DAG: store %struct.St* %{{.+}}, %struct.St** [[PRIV_S]], // ARRAY-DAG: store x86_fp80* %{{.+}}, x86_fp80** [[PRIV_VLA1]], // ARRAY-DAG: store double* %{{.+}}, double** [[PRIV_VLA2]], -// ARRAY: call i8* @llvm.stacksave() // ARRAY: [[SIZE:%.+]] = mul nuw i64 %{{.+}}, 8 -// ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 128 %{{.+}}, i8* align 128 %{{.+}}, i64 [[SIZE]], i1 false) +// ARRAY: [[SZ1:%.+]] = add nuw i64 [[SIZE]], 127 +// ARRAY: [[SZ2:%.+]] = udiv i64 [[SZ1]], 128 +// ARRAY: [[SIZE:%.+]] = mul nuw i64 [[SZ2]], 128 +// ARRAY: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_thread_mem_alloc, +// ARRAY: [[VLA2_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 [[SIZE]], i8** [[ALLOCATOR]]) +// ARRAY: [[VLA2_PTR:%.+]] = bitcast i8* [[VLA2_VOID_PTR]] to double* +// ARRAY: [[SIZE:%.+]] = mul nuw i64 %{{.+}}, 8 +// ARRAY: [[BC:%.+]] = bitcast double* [[VLA2_PTR]] to i8* +// ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 128 [[BC]], i8* align 128 %{{.+}}, i64 [[SIZE]], i1 false) +// ARRAY: call void @__kmpc_free(i32 [[GTID]], i8* [[VLA2_VOID_PTR]], i8** [[ALLOCATOR]]) +// ARRAY-NEXT: ret void #endif -- cgit v1.2.3 From 17562937ebaa3a5d5b7329f19bd991889455d89d Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 3 Apr 2019 19:12:47 +0000 Subject: [OPENMP]Add codegen for lastprivate vars with allocate clause, NFC. Added test for the lastprivatized variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357625 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_lastprivate_codegen.cpp | 36 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_lastprivate_codegen.cpp b/test/OpenMP/for_lastprivate_codegen.cpp index f0eeb63128..504a29bec7 100644 --- a/test/OpenMP/for_lastprivate_codegen.cpp +++ b/test/OpenMP/for_lastprivate_codegen.cpp @@ -14,6 +14,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + struct SS { int a; int b : 4; @@ -456,12 +466,12 @@ int main() { A::x++; } #pragma omp parallel -#pragma omp for firstprivate(f) lastprivate(f) +#pragma omp for allocate(omp_const_mem_alloc: f) firstprivate(f) lastprivate(f) for (int i = 0; i < 2; ++i) { A::x++; } #pragma omp parallel -#pragma omp for lastprivate(cnt) +#pragma omp for allocate(omp_const_mem_alloc :cnt) lastprivate(cnt) for (cnt = 0; cnt < 2; ++cnt) { A::x++; } @@ -590,15 +600,17 @@ int main() { // CHECK: ret void // CHECK: define internal void [[MAIN_MICROTASK2]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}) -// CHECK: [[F_PRIV:%.+]] = alloca float, // CHECK-NOT: alloca float // Check for default initialization. +// CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]] +// CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] +// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_const_mem_alloc, +// CHECK: [[F_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[ALLOCATOR]]) +// CHECK: [[F_PRIV:%.+]] = bitcast i8* [[F_VOID_PTR]] to float* // CHECK: [[F_VAL:%.+]] = load float, float* [[F]], // CHECK: store float [[F_VAL]], float* [[F_PRIV]], -// CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]] -// CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] // CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) // // CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 [[GTID]]) @@ -617,15 +629,16 @@ int main() { // CHECK-NEXT: br label %[[LAST_DONE]] // CHECK: [[LAST_DONE]] -// CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) -// CHECK: ret void +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[F_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK-NEXT: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) +// CHECK-NEXT: ret void // CHECK: define internal void [[MAIN_MICROTASK3]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}) -// CHECK: alloca i8, -// CHECK: [[CNT_PRIV:%.+]] = alloca i8, // CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]] // CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] +// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_const_mem_alloc, +// CHECK: [[CNT_PRIV:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 1, i8** [[ALLOCATOR]]) // CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1) // UB = min(UB, GlobalUB) // CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]] @@ -653,8 +666,9 @@ int main() { // CHECK-NEXT: br label %[[LAST_DONE]] // CHECK: [[LAST_DONE]] -// CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) -// CHECK: ret void +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[CNT_PRIV]], i8** [[ALLOCATOR]]) +// CHECK-NEXT: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) +// CHECK-NEXT: ret void // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]() // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]], -- cgit v1.2.3 From 1ca36348d2a41d4e273f4fd3d7471bdb146bd643 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 3 Apr 2019 19:59:09 +0000 Subject: [OPENMP]Add codegen for reduction vars with allocate clause, NFC. Added test for the reduction variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357629 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_reduction_codegen_UDR.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_reduction_codegen_UDR.cpp b/test/OpenMP/for_reduction_codegen_UDR.cpp index 7adca3eb80..69ccab74de 100644 --- a/test/OpenMP/for_reduction_codegen_UDR.cpp +++ b/test/OpenMP/for_reduction_codegen_UDR.cpp @@ -10,6 +10,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + volatile double g, g_orig; volatile double &g1 = g_orig; @@ -124,7 +134,7 @@ int main() { for (int i = 0; i < 10; ++i) ; #pragma omp parallel -#pragma omp for reduction(& : var3) +#pragma omp for reduction(& : var3) allocate(omp_cgroup_mem_alloc: var3) for (int i = 0; i < 10; ++i) ; return tmain(); @@ -778,7 +788,6 @@ int main() { // CHECK: define internal void [[MAIN_MICROTASK6]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, [4 x [[S_FLOAT_TY]]]* dereferenceable(48) %{{.+}}) // CHECK: [[VAR3_ORIG_ADDR:%.+]] = alloca [4 x [[S_FLOAT_TY]]]*, -// CHECK: [[VAR3_PRIV:%.+]] = alloca [4 x [[S_FLOAT_TY]]], // Reduction list for runtime. // CHECK: [[RED_LIST:%.+]] = alloca [1 x i8*], @@ -788,12 +797,15 @@ int main() { // CHECK: [[VAR3_ORIG:%.+]] = load [4 x [[S_FLOAT_TY]]]*, [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR]], // CHECK: store [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]], [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR:%.+]], // CHECK: [[VAR3_ORIG:%.+]] = load [4 x [[S_FLOAT_TY]]]*, [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR]], +// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_cgroup_mem_alloc, +// CHECK: [[VAR3_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 48, i8** [[ALLOCATOR]]) +// CHECK: [[VAR3_PRIV:%.+]] = bitcast i8* [[VAR3_VOID_PTR]] to [4 x %struct.S]* // CHECK: getelementptr inbounds [4 x [[S_FLOAT_TY]]], [4 x [[S_FLOAT_TY]]]* [[VAR3_PRIV]], i32 0, i32 0 // CHECK: bitcast [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]] to [[S_FLOAT_TY]]* // CHECK: getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* %{{.+}}, i64 4 // CHECK: store [4 x [[S_FLOAT_TY]]]* [[VAR3_PRIV]], [4 x [[S_FLOAT_TY]]]** % - +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[VAR3_VOID_PTR]], i8** [[ALLOCATOR]]) // CHECK: ret void // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT_42]]() -- cgit v1.2.3 From 73af6b66399c0350b4897ed47421409532973aac Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 4 Apr 2019 17:28:22 +0000 Subject: [OPENMP]Fix lookup of the user-defined reductions in C. Fixed the regression of the lookup of user-defined reductions for C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357708 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_reduction_ast_print.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_reduction_ast_print.c b/test/OpenMP/declare_reduction_ast_print.c index 239b1cfd44..37b722e5f8 100644 --- a/test/OpenMP/declare_reduction_ast_print.c +++ b/test/OpenMP/declare_reduction_ast_print.c @@ -43,4 +43,17 @@ int main() { } // CHECK: } +#pragma omp declare reduction(mymin:int \ + : omp_out = omp_out > omp_in ? omp_in : omp_out) \ + initializer(omp_priv = 2147483647) + +int foo(int argc, char **argv) { + int x; +#pragma omp parallel for reduction(mymin : x) + for (int i = 0; i < 1000; i++) + ; + return 0; +} + +// CHECK: #pragma omp parallel for reduction(mymin: x) #endif -- cgit v1.2.3 From 5f4fe1b0183cbf31e8abb7de29da30a9f16e793d Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 4 Apr 2019 18:06:53 +0000 Subject: [OPENMP]Add codegen for linear vars with allocate clause, NFC. Added test for the linear variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357712 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_linear_codegen.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_linear_codegen.cpp b/test/OpenMP/for_linear_codegen.cpp index a9bc621005..ebb69c80f3 100644 --- a/test/OpenMP/for_linear_codegen.cpp +++ b/test/OpenMP/for_linear_codegen.cpp @@ -14,6 +14,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + template struct S { T f; @@ -344,7 +354,7 @@ int main() { float *pvar = &test.f; long long lvar = 0; #pragma omp parallel -#pragma omp for linear(pvar, lvar : 3) +#pragma omp for linear(pvar, lvar : 3) allocate(omp_low_lat_mem_alloc: lvar) for (int i = 0; i < 2; ++i) { pvar += 3, lvar += 3; } @@ -370,7 +380,6 @@ int main() { // CHECK: alloca i{{[0-9]+}}, // CHECK: alloca i{{[0-9]+}}, // CHECK: [[PVAR_PRIV:%.+]] = alloca float*, -// CHECK: [[LVAR_PRIV:%.+]] = alloca i64, // CHECK: store i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]] // Check for default initialization. @@ -380,7 +389,10 @@ int main() { // CHECK: store float* [[PVAR_VAL]], float** [[PVAR_START]], // CHECK: [[LVAR_VAL:%.+]] = load i64, i64* [[LVAR_REF]], // CHECK: store i64 [[LVAR_VAL]], i64* [[LVAR_START]], -// CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID:%.+]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) +// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_low_lat_mem_alloc, +// CHECK: [[LVAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 8, i8** [[ALLOCATOR]]) +// CHECK: [[LVAR_PRIV:%.+]] = bitcast i8* [[LVAR_VOID_PTR]] to i64* +// CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) // CHECK: [[PVAR_VAL:%.+]] = load float*, float** [[PVAR_START]], // CHECK: [[CNT:%.+]] = load i32, i32* // CHECK: [[MUL:%.+]] = mul nsw i32 [[CNT]], 3 @@ -400,6 +412,7 @@ int main() { // CHECK: [[ADD:%.+]] = add nsw i64 [[LVAR_VAL]], 3 // CHECK: store i64 [[ADD]], i64* [[LVAR_PRIV]], // CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 %{{.+}}) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[LVAR_VOID_PTR]], i8** [[ALLOCATOR]]) // CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) // CHECK: ret void -- cgit v1.2.3 From 840592268a881da59e838ec97cfe04b5dfb59dbc Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 4 Apr 2019 18:58:17 +0000 Subject: [OPENMP]Add codegen for task reduction vars with allocate clause, NFC. Added test for the task reduction variables with the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357717 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/task_in_reduction_codegen.cpp | 12 +++++++++++- test/OpenMP/taskgroup_task_reduction_codegen.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/task_in_reduction_codegen.cpp b/test/OpenMP/task_in_reduction_codegen.cpp index e96d12689f..2370b2bc41 100644 --- a/test/OpenMP/task_in_reduction_codegen.cpp +++ b/test/OpenMP/task_in_reduction_codegen.cpp @@ -10,6 +10,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + // CHECK: [[PRIVATES:%.+]] = type { i8*, i8* } struct S { @@ -31,7 +41,7 @@ int main(int argc, char **argv) { { #pragma omp taskgroup task_reduction(-:c, d) #pragma omp parallel -#pragma omp task in_reduction(+:a) in_reduction(-:d) +#pragma omp task in_reduction(+:a) in_reduction(-:d) allocate(omp_high_bw_mem_alloc: d) a += d[a]; } return 0; diff --git a/test/OpenMP/taskgroup_task_reduction_codegen.cpp b/test/OpenMP/taskgroup_task_reduction_codegen.cpp index 02a5ba664e..686bb6ff57 100644 --- a/test/OpenMP/taskgroup_task_reduction_codegen.cpp +++ b/test/OpenMP/taskgroup_task_reduction_codegen.cpp @@ -12,6 +12,16 @@ #ifndef HEADER #define HEADER +typedef void **omp_allocator_handle_t; +extern const omp_allocator_handle_t omp_default_mem_alloc; +extern const omp_allocator_handle_t omp_large_cap_mem_alloc; +extern const omp_allocator_handle_t omp_const_mem_alloc; +extern const omp_allocator_handle_t omp_high_bw_mem_alloc; +extern const omp_allocator_handle_t omp_low_lat_mem_alloc; +extern const omp_allocator_handle_t omp_cgroup_mem_alloc; +extern const omp_allocator_handle_t omp_pteam_mem_alloc; +extern const omp_allocator_handle_t omp_thread_mem_alloc; + // CHECK-DAG: @reduction_size.[[ID:.+]]_[[CID:[0-9]+]].artificial. // CHECK-DAG: @reduction_size.[[ID]]_[[CID]].artificial..cache. @@ -29,7 +39,7 @@ int main(int argc, char **argv) { float b; S c[5]; short d[argc]; -#pragma omp taskgroup task_reduction(+: a, b, argc) +#pragma omp taskgroup allocate(omp_pteam_mem_alloc: a) task_reduction(+: a, b, argc) { #pragma omp taskgroup task_reduction(-:c, d) ; -- cgit v1.2.3 From 0024213e0906181eea275e5db24801ed684c1747 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 8 Apr 2019 16:53:57 +0000 Subject: [OPENMP][NVPTX]Fixed processing of memory management directives. Added special processing of the memory management directives/clauses for NVPTX target. For private locals, omp_default_mem_alloc and omp_thread_mem_alloc result in allocation in local memory. omp_const_mem_alloc allocates const memory, omp_teams_mem_alloc allocates shared memory, and omp_cgroup_mem_alloc and omp_large_cap_mem_alloc allocate global memory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357923 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_allocate_codegen.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_allocate_codegen.cpp b/test/OpenMP/nvptx_allocate_codegen.cpp index ec1faff426..9a285d0d09 100644 --- a/test/OpenMP/nvptx_allocate_codegen.cpp +++ b/test/OpenMP/nvptx_allocate_codegen.cpp @@ -24,6 +24,8 @@ extern const omp_allocator_handle_t omp_thread_mem_alloc; // CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} = addrspace(3) global i32 0, // CHECK-DAG: @{{.+}}main{{.+}}a{{.*}} = internal global i32 0, // CHECK-DAG: @{{.+}}ST{{.+}}m{{.+}} = external global i32, +// CHECK-DAG: @bar_c = internal global i32 0, +// CHECK-DAG: @bar_b = internal addrspace(3) global double 0.000000e+00, struct St{ int a; }; @@ -64,13 +66,42 @@ int main () { #pragma omp allocate(a) allocator(omp_thread_mem_alloc) a=2; double b = 3; + float c; #pragma omp allocate(b) allocator(omp_default_mem_alloc) +#pragma omp allocate(c) allocator(omp_cgroup_mem_alloc) return (foo()); } // CHECK: define {{.*}}i32 @{{.+}}foo{{.+}}() -// CHECK: alloca i32, +// CHECK-NOT: alloca i32, extern template int ST::m; + +void baz(float &); + +// CHECK: define void @{{.+}}bar{{.+}}() +void bar() { + // CHECK: alloca float, + float bar_a; + // CHECK: alloca double, + double bar_b; + int bar_c; +#pragma omp allocate(bar_c) allocator(omp_cgroup_mem_alloc) + // CHECK: call void [[OUTLINED:@.+]](i32* %{{.+}}, i32* %{{.+}}) +#pragma omp parallel private(bar_a, bar_b) allocate(omp_thread_mem_alloc \ + : bar_a) allocate(omp_pteam_mem_alloc \ + : bar_b) + { + bar_b = bar_a; + baz(bar_a); + } +// CHECK: define internal void [[OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}}) +// CHECK-NOT: alloca double, +// CHECK: alloca float, +// CHECK-NOT: alloca double, +// CHECK: load float, float* % +// CHECK: store double {{.+}}, double addrspace(3)* @bar_b, +} + #pragma omp end declare target #endif -- cgit v1.2.3 From b0743db40c9e2f1087f7013373ae4d00cea1a65b Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 8 Apr 2019 19:06:42 +0000 Subject: [OPENMP] Sync __kmpc_alloc/_kmpc_free function with the runtime. Functions __kmpc_alloc/__kmpc_free are updated with the new interfaces. Patch synchronizes the compiler with the runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357933 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_codegen.cpp | 26 +++++++------ test/OpenMP/for_lastprivate_codegen.cpp | 31 ++++++++-------- test/OpenMP/for_linear_codegen.cpp | 26 +++++++------ test/OpenMP/for_reduction_codegen_UDR.cpp | 26 +++++++------ test/OpenMP/parallel_firstprivate_codegen.cpp | 53 +++++++++++++++------------ test/OpenMP/parallel_private_codegen.cpp | 27 ++++++++------ 6 files changed, 102 insertions(+), 87 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_codegen.cpp b/test/OpenMP/allocate_codegen.cpp index daad935336..827b7012b0 100644 --- a/test/OpenMP/allocate_codegen.cpp +++ b/test/OpenMP/allocate_codegen.cpp @@ -17,15 +17,18 @@ #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; struct St{ int a; @@ -77,13 +80,12 @@ int main () { // CHECK: define {{.*}}i32 @{{.+}}foo{{.+}}() // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) -// CHECK-NEXT: [[OMP_CGROUP_MEM_ALLOC:%.+]] = load i8**, i8*** @omp_cgroup_mem_alloc, -// CHECK-NEXT: [[V_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[OMP_CGROUP_MEM_ALLOC]]) +// CHECK-NEXT: [[V_VOID_ADDR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8* inttoptr (i64 6 to i8*)) // CHECK-NEXT: [[V_ADDR:%.+]] = bitcast i8* [[V_VOID_ADDR]] to i32* // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} // CHECK: store i32 %{{.+}}, i32* [[V_ADDR]], // CHECK-NEXT: [[V_VAL:%.+]] = load i32, i32* [[V_ADDR]], -// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[V_VOID_ADDR]], i8** [[OMP_CGROUP_MEM_ALLOC]]) +// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[V_VOID_ADDR]], i8* inttoptr (i64 6 to i8*)) // CHECK-NOT: {{__kmpc_alloc|__kmpc_free}} // CHECK: ret i32 [[V_VAL]] diff --git a/test/OpenMP/for_lastprivate_codegen.cpp b/test/OpenMP/for_lastprivate_codegen.cpp index 504a29bec7..57fb4ad9d5 100644 --- a/test/OpenMP/for_lastprivate_codegen.cpp +++ b/test/OpenMP/for_lastprivate_codegen.cpp @@ -14,15 +14,18 @@ #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; struct SS { int a; @@ -605,8 +608,7 @@ int main() { // Check for default initialization. // CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]] // CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] -// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_const_mem_alloc, -// CHECK: [[F_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[ALLOCATOR]]) +// CHECK: [[F_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8* inttoptr (i64 3 to i8*)) // CHECK: [[F_PRIV:%.+]] = bitcast i8* [[F_VOID_PTR]] to float* // CHECK: [[F_VAL:%.+]] = load float, float* [[F]], // CHECK: store float [[F_VAL]], float* [[F_PRIV]], @@ -629,7 +631,7 @@ int main() { // CHECK-NEXT: br label %[[LAST_DONE]] // CHECK: [[LAST_DONE]] -// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[F_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[F_VOID_PTR]], i8* inttoptr (i64 3 to i8*)) // CHECK-NEXT: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) // CHECK-NEXT: ret void @@ -637,8 +639,7 @@ int main() { // CHECK: [[GTID_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]] // CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]] -// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_const_mem_alloc, -// CHECK: [[CNT_PRIV:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 1, i8** [[ALLOCATOR]]) +// CHECK: [[CNT_PRIV:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 1, i8* inttoptr (i64 3 to i8*)) // CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1) // UB = min(UB, GlobalUB) // CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]] @@ -666,7 +667,7 @@ int main() { // CHECK-NEXT: br label %[[LAST_DONE]] // CHECK: [[LAST_DONE]] -// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[CNT_PRIV]], i8** [[ALLOCATOR]]) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[CNT_PRIV]], i8* inttoptr (i64 3 to i8*)) // CHECK-NEXT: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) // CHECK-NEXT: ret void diff --git a/test/OpenMP/for_linear_codegen.cpp b/test/OpenMP/for_linear_codegen.cpp index ebb69c80f3..e424200400 100644 --- a/test/OpenMP/for_linear_codegen.cpp +++ b/test/OpenMP/for_linear_codegen.cpp @@ -14,15 +14,18 @@ #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; template struct S { @@ -389,8 +392,7 @@ int main() { // CHECK: store float* [[PVAR_VAL]], float** [[PVAR_START]], // CHECK: [[LVAR_VAL:%.+]] = load i64, i64* [[LVAR_REF]], // CHECK: store i64 [[LVAR_VAL]], i64* [[LVAR_START]], -// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_low_lat_mem_alloc, -// CHECK: [[LVAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 8, i8** [[ALLOCATOR]]) +// CHECK: [[LVAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 8, i8* inttoptr (i64 5 to i8*)) // CHECK: [[LVAR_PRIV:%.+]] = bitcast i8* [[LVAR_VOID_PTR]] to i64* // CHECK: call {{.+}} @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1) // CHECK: [[PVAR_VAL:%.+]] = load float*, float** [[PVAR_START]], @@ -412,7 +414,7 @@ int main() { // CHECK: [[ADD:%.+]] = add nsw i64 [[LVAR_VAL]], 3 // CHECK: store i64 [[ADD]], i64* [[LVAR_PRIV]], // CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 %{{.+}}) -// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[LVAR_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[LVAR_VOID_PTR]], i8* inttoptr (i64 5 to i8*)) // CHECK: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]]) // CHECK: ret void diff --git a/test/OpenMP/for_reduction_codegen_UDR.cpp b/test/OpenMP/for_reduction_codegen_UDR.cpp index 69ccab74de..8cb88f61c1 100644 --- a/test/OpenMP/for_reduction_codegen_UDR.cpp +++ b/test/OpenMP/for_reduction_codegen_UDR.cpp @@ -10,15 +10,18 @@ #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; volatile double g, g_orig; volatile double &g1 = g_orig; @@ -797,15 +800,14 @@ int main() { // CHECK: [[VAR3_ORIG:%.+]] = load [4 x [[S_FLOAT_TY]]]*, [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR]], // CHECK: store [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]], [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR:%.+]], // CHECK: [[VAR3_ORIG:%.+]] = load [4 x [[S_FLOAT_TY]]]*, [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR]], -// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_cgroup_mem_alloc, -// CHECK: [[VAR3_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 48, i8** [[ALLOCATOR]]) +// CHECK: [[VAR3_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 48, i8* inttoptr (i64 6 to i8*)) // CHECK: [[VAR3_PRIV:%.+]] = bitcast i8* [[VAR3_VOID_PTR]] to [4 x %struct.S]* // CHECK: getelementptr inbounds [4 x [[S_FLOAT_TY]]], [4 x [[S_FLOAT_TY]]]* [[VAR3_PRIV]], i32 0, i32 0 // CHECK: bitcast [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]] to [[S_FLOAT_TY]]* // CHECK: getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* %{{.+}}, i64 4 // CHECK: store [4 x [[S_FLOAT_TY]]]* [[VAR3_PRIV]], [4 x [[S_FLOAT_TY]]]** % -// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[VAR3_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[VAR3_VOID_PTR]], i8* inttoptr (i64 6 to i8*)) // CHECK: ret void // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT_42]]() diff --git a/test/OpenMP/parallel_firstprivate_codegen.cpp b/test/OpenMP/parallel_firstprivate_codegen.cpp index e448a406e0..66964152aa 100644 --- a/test/OpenMP/parallel_firstprivate_codegen.cpp +++ b/test/OpenMP/parallel_firstprivate_codegen.cpp @@ -33,15 +33,18 @@ #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; struct St { int a, b; @@ -412,13 +415,12 @@ int main() { // CHECK-64: [[BC:%.+]] = bitcast [[iz]]* [[T_VAR_ADDR]] to i32* // CHECK: [[GTID_PTR:%.+]] = load i32*, i32** [[GTID_ADDR]], // CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_PTR]], -// CHECK: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_default_mem_alloc, -// CHECK: [[T_VAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], [[iz]] 4, i8** [[ALLOCATOR]]) +// CHECK: [[T_VAR_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], [[iz]] 4, i8* inttoptr ([[iz]] 1 to i8*)) // CHECK: [[T_VAR_PRIV:%.+]] = bitcast i8* [[T_VAR_VOID_PTR]] to i32* // CHECK-32: [[T_VAR_VAL:%.+]] = load i32, i32* [[T_VAR_ADDR]], // CHECK-64: [[T_VAR_VAL:%.+]] = load i32, i32* [[BC]], // CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_PRIV]], -// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[T_VAR_VOID_PTR]], i8** [[ALLOCATOR]]) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[T_VAR_VOID_PTR]], i8* inttoptr ([[iz]] 1 to i8*)) // CHECK: ret void @@ -515,15 +517,19 @@ int main() { #endif #else -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; + +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; struct St { int a, b; @@ -570,13 +576,12 @@ void array_func(float a[3], St s[2], int n, long double vla1[n]) { // ARRAY: [[SZ1:%.+]] = add nuw i64 [[SIZE]], 127 // ARRAY: [[SZ2:%.+]] = udiv i64 [[SZ1]], 128 // ARRAY: [[SIZE:%.+]] = mul nuw i64 [[SZ2]], 128 -// ARRAY: [[ALLOCATOR:%.+]] = load i8**, i8*** @omp_thread_mem_alloc, -// ARRAY: [[VLA2_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 [[SIZE]], i8** [[ALLOCATOR]]) +// ARRAY: [[VLA2_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 [[SIZE]], i8* inttoptr (i64 8 to i8*)) // ARRAY: [[VLA2_PTR:%.+]] = bitcast i8* [[VLA2_VOID_PTR]] to double* // ARRAY: [[SIZE:%.+]] = mul nuw i64 %{{.+}}, 8 // ARRAY: [[BC:%.+]] = bitcast double* [[VLA2_PTR]] to i8* // ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 128 [[BC]], i8* align 128 %{{.+}}, i64 [[SIZE]], i1 false) -// ARRAY: call void @__kmpc_free(i32 [[GTID]], i8* [[VLA2_VOID_PTR]], i8** [[ALLOCATOR]]) +// ARRAY: call void @__kmpc_free(i32 [[GTID]], i8* [[VLA2_VOID_PTR]], i8* inttoptr (i64 8 to i8*)) // ARRAY-NEXT: ret void #endif diff --git a/test/OpenMP/parallel_private_codegen.cpp b/test/OpenMP/parallel_private_codegen.cpp index 7271c3f5a0..ceceaf95d4 100644 --- a/test/OpenMP/parallel_private_codegen.cpp +++ b/test/OpenMP/parallel_private_codegen.cpp @@ -13,15 +13,19 @@ // expected-no-diagnostics #ifndef HEADER #define HEADER -typedef void **omp_allocator_handle_t; -extern const omp_allocator_handle_t omp_default_mem_alloc; -extern const omp_allocator_handle_t omp_large_cap_mem_alloc; -extern const omp_allocator_handle_t omp_const_mem_alloc; -extern const omp_allocator_handle_t omp_high_bw_mem_alloc; -extern const omp_allocator_handle_t omp_low_lat_mem_alloc; -extern const omp_allocator_handle_t omp_cgroup_mem_alloc; -extern const omp_allocator_handle_t omp_pteam_mem_alloc; -extern const omp_allocator_handle_t omp_thread_mem_alloc; + +enum omp_allocator_handle_t { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = __UINTPTR_MAX__ +}; template struct S { @@ -356,15 +360,14 @@ int main() { // CHECK: [[GTID_ADDR_PTR:%.+]] = alloca i32*, // CHECK: [[GTID_ADDR:%.+]] = load i32*, i32** [[GTID_ADDR_PTR]], // CHECK: [[GTID:%.+]] = load i32, i32* [[GTID_ADDR]], -// CHECK: [[LARGE_CAP_ALLOC:%.+]] = load i8**, i8*** @omp_large_cap_mem_alloc, -// CHECK: [[A_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8** [[LARGE_CAP_ALLOC]]) +// CHECK: [[A_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 4, i8* inttoptr (i64 2 to i8*)) // CHECK: [[A_PRIV:%.+]] = bitcast i8* [[A_VOID_PTR]] to i32* // CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REF:%.+]], // CHECK-NEXT: [[A_PRIV:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[REF]], // CHECK-NEXT: [[A_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[A_PRIV]], // CHECK-NEXT: [[INC:%.+]] = add nsw i{{[0-9]+}} [[A_VAL]], 1 // CHECK-NEXT: store i{{[0-9]+}} [[INC]], i{{[0-9]+}}* [[A_PRIV]], -// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[A_VOID_PTR]], i8** [[LARGE_CAP_ALLOC]]) +// CHECK-NEXT: call void @__kmpc_free(i32 [[GTID]], i8* [[A_VOID_PTR]], i8* inttoptr (i64 2 to i8*)) // CHECK-NEXT: ret void #endif -- cgit v1.2.3 From 1c5a77ab63d1abd64398ea2f76721e59d4517ad5 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 9 Apr 2019 16:31:37 +0000 Subject: [OPENMP]Allow allocate directive on parameters. Patch allows to use allocate directives on the function parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358016 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/allocate_codegen.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/allocate_codegen.cpp b/test/OpenMP/allocate_codegen.cpp index 827b7012b0..c068589041 100644 --- a/test/OpenMP/allocate_codegen.cpp +++ b/test/OpenMP/allocate_codegen.cpp @@ -91,4 +91,18 @@ int main () { // CHECK-NOT: call {{.+}} {{__kmpc_alloc|__kmpc_free}} extern template int ST::m; + +// CHECK: define void @{{.+}}bar{{.+}}(i32 %{{.+}}, float* {{.+}}) +void bar(int a, float &z) { +// CHECK: [[A_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 4, i8* inttoptr (i64 1 to i8*)) +// CHECK: [[A_ADDR:%.+]] = bitcast i8* [[A_VOID_PTR]] to i32* +// CHECK: store i32 %{{.+}}, i32* [[A_ADDR]], +// CHECK: [[Z_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID]], i64 8, i8* inttoptr (i64 1 to i8*)) +// CHECK: [[Z_ADDR:%.+]] = bitcast i8* [[Z_VOID_PTR]] to float** +// CHECK: store float* %{{.+}}, float** [[Z_ADDR]], +#pragma omp allocate(a,z) allocator(omp_default_mem_alloc) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[Z_VOID_PTR]], i8* inttoptr (i64 1 to i8*)) +// CHECK: call void @__kmpc_free(i32 [[GTID]], i8* [[A_VOID_PTR]], i8* inttoptr (i64 1 to i8*)) +// CHECK: ret void +} #endif -- cgit v1.2.3 From 40afe0b6f2b39195e6c141d770b51a691c19000e Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 10 Apr 2019 17:03:09 +0000 Subject: Don't emit an unreachable return block. Patch by Brad Moody. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358104 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/parallel_reduction_codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/parallel_reduction_codegen.cpp b/test/OpenMP/parallel_reduction_codegen.cpp index bd43a9328a..38be6c39fc 100644 --- a/test/OpenMP/parallel_reduction_codegen.cpp +++ b/test/OpenMP/parallel_reduction_codegen.cpp @@ -622,7 +622,7 @@ int main() { // CHECK-NOT: call i32 @__kmpc_reduce -// CHECK: ret void +// CHECK: } // CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]() // CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]], -- cgit v1.2.3 From dd7821f8092fffaddffb87250e4cdb305f8f9d21 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 10 Apr 2019 19:11:33 +0000 Subject: [OPENMP]Improve detection of number of teams, threads in target regions. Added more complex analysis for number of teams and number of threads in the target regions, also merged related common code between CGOpenMPRuntime and CGOpenMPRuntimeNVPTX classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358126 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/distribute_simd_reduction_codegen.cpp | 4 ++-- test/OpenMP/target_map_codegen.cpp | 4 ++-- test/OpenMP/target_simd_codegen.cpp | 14 +++++++------- test/OpenMP/target_simd_depend_codegen.cpp | 4 ++-- test/OpenMP/target_teams_distribute_simd_codegen.cpp | 12 ++++++------ .../target_teams_distribute_simd_depend_codegen.cpp | 4 ++-- ...target_teams_distribute_simd_firstprivate_codegen.cpp | 14 +++++++------- .../target_teams_distribute_simd_private_codegen.cpp | 4 ++-- .../target_teams_distribute_simd_reduction_codegen.cpp | 4 ++-- test/OpenMP/teams_distribute_simd_codegen.cpp | 16 ++++++++-------- .../teams_distribute_simd_firstprivate_codegen.cpp | 6 +++--- test/OpenMP/teams_distribute_simd_private_codegen.cpp | 4 ++-- test/OpenMP/teams_distribute_simd_reduction_codegen.cpp | 4 ++-- 13 files changed, 47 insertions(+), 47 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/distribute_simd_reduction_codegen.cpp b/test/OpenMP/distribute_simd_reduction_codegen.cpp index 85b0e80aad..63fb75e000 100644 --- a/test/OpenMP/distribute_simd_reduction_codegen.cpp +++ b/test/OpenMP/distribute_simd_reduction_codegen.cpp @@ -46,7 +46,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]]( // LAMBDA: ret #pragma omp target @@ -123,7 +123,7 @@ int main() { } // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]](i{{64|32}} %{{.+}}) // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret diff --git a/test/OpenMP/target_map_codegen.cpp b/test/OpenMP/target_map_codegen.cpp index b267a72b4c..44d7ffc9cc 100644 --- a/test/OpenMP/target_map_codegen.cpp +++ b/test/OpenMP/target_map_codegen.cpp @@ -259,7 +259,7 @@ void implicit_maps_nested_integer (int a){ // CK4: define internal void [[KERNELP1]](i32* {{[^,]+}}, i32* {{[^,]+}}, i32* {{[^,]+}}) #pragma omp parallel { - // CK4-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}}) + // CK4-DAG: call i32 @__tgt_target_teams(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}}, i32 1, i32 0) // CK4-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0 // CK4-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK4-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 @@ -1516,7 +1516,7 @@ void explicit_maps_single (int ii){ int b = a; // Region 00n - // CK19-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00n]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00n]]{{.+}}) + // CK19-DAG: call i32 @__tgt_target_teams(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00n]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00n]]{{.+}}, i32 1, i32 0) // CK19-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] // CK19-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] diff --git a/test/OpenMP/target_simd_codegen.cpp b/test/OpenMP/target_simd_codegen.cpp index 13504213c5..6a9ac90fe7 100644 --- a/test/OpenMP/target_simd_codegen.cpp +++ b/test/OpenMP/target_simd_codegen.cpp @@ -110,7 +110,7 @@ int foo(int n) { double cn[5][n]; TT d; - // CHECK: [[RET:%.+]] = call i32 @__tgt_target_nowait(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null) + // CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams_nowait(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null, i32 1, i32 1) // CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]] // CHECK: [[FAIL]] @@ -128,7 +128,7 @@ int foo(int n) { a += 1; } - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BP:%[^,]+]], i8** [[P:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET2]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT2]], i32 0, i32 0)) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BP:%[^,]+]], i8** [[P:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET2]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT2]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BP]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BPR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[P]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BPR]], i32 0, i32 0 @@ -165,7 +165,7 @@ int foo(int n) { // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 10 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0)) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P:%[^,]+]], i32 0, i32 0 @@ -217,7 +217,7 @@ int foo(int n) { // CHECK: [[CNELEMSIZE2:%.+]] = mul nuw i[[SZ]] 5, [[VLA1:%.+]] // CHECK: [[CNSIZE:%.+]] = mul nuw i[[SZ]] [[CNELEMSIZE2]], 8 - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 9, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([9 x i64], [9 x i64]* [[MAPT4]], i32 0, i32 0)) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 9, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([9 x i64], [9 x i64]* [[MAPT4]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S:%[^,]+]], i32 0, i32 0 @@ -489,7 +489,7 @@ int bar(int n){ // CHECK: [[CELEMSIZE2:%.+]] = mul nuw i[[SZ]] 2, [[VLA0:%.+]] // CHECK: [[CSIZE:%.+]] = mul nuw i[[SZ]] [[CELEMSIZE2]], 2 -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0)) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [6 x i[[SZ]]], [6 x i[[SZ]]]* [[S:%.+]], i32 0, i32 0 @@ -564,7 +564,7 @@ int bar(int n){ // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 50 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 4, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([4 x i[[SZ]]], [4 x i[[SZ]]]* [[SIZET6]], i32 0, i32 0), i64* getelementptr inbounds ([4 x i64], [4 x i64]* [[MAPT6]], i32 0, i32 0)) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([4 x i[[SZ]]], [4 x i[[SZ]]]* [[SIZET6]], i32 0, i32 0), i64* getelementptr inbounds ([4 x i64], [4 x i64]* [[MAPT6]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P:%.+]], i32 0, i32 0 @@ -614,7 +614,7 @@ int bar(int n){ // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 40 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET5]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT5]], i32 0, i32 0)) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET5]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT5]], i32 0, i32 0), i32 1, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P:%.+]], i32 0, i32 0 diff --git a/test/OpenMP/target_simd_depend_codegen.cpp b/test/OpenMP/target_simd_depend_codegen.cpp index 37f726aa2a..8a9ed02b50 100644 --- a/test/OpenMP/target_simd_depend_codegen.cpp +++ b/test/OpenMP/target_simd_depend_codegen.cpp @@ -194,7 +194,7 @@ int foo(int n) { // CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0 // CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]], // CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64 -// CHECK: [[RET:%.+]] = call i32 @__tgt_target(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null) +// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null, i32 1, i32 1) // CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]] // CHECK: [[FAIL]] @@ -211,7 +211,7 @@ int foo(int n) { // CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2 // CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]], // CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64 -// CHECK: [[RET:%.+]] = call i32 @__tgt_target_nowait(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SZT]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT]], i32 0, i32 0) +// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams_nowait(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SZT]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT]], i32 0, i32 0), i32 1, i32 1) // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]] diff --git a/test/OpenMP/target_teams_distribute_simd_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_codegen.cpp index 0a5482e9b1..4e7d7d3c8d 100644 --- a/test/OpenMP/target_teams_distribute_simd_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_codegen.cpp @@ -152,7 +152,7 @@ int foo(int n) { a += 1; } - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** [[BP:%[^,]+]], i8** [[P:%[^,]+]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET2]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPT2]], i32 0, i32 0), i32 0, i32 0) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** [[BP:%[^,]+]], i8** [[P:%[^,]+]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET2]], i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* [[MAPT2]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BP]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BPR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[P]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BPR]], i32 0, i32 [[IDX0:[0-9]+]] @@ -176,7 +176,7 @@ int foo(int n) { // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 10 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0), i32 0, i32 0) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET3]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT3]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P:%[^,]+]], i32 0, i32 0 @@ -227,7 +227,7 @@ int foo(int n) { // CHECK: [[CNELEMSIZE2:%.+]] = mul nuw i[[SZ]] 5, [[VLA1:%.+]] // CHECK: [[CNSIZE:%.+]] = mul nuw i[[SZ]] [[CNELEMSIZE2]], 8 - // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 9, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([9 x i64], [9 x i64]* [[MAPT4]], i32 0, i32 0), i32 0, i32 0) + // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 9, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([9 x i64], [9 x i64]* [[MAPT4]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S:%[^,]+]], i32 0, i32 0 @@ -564,7 +564,7 @@ int bar(int n){ // CHECK: [[CELEMSIZE2:%.+]] = mul nuw i[[SZ]] 2, [[VLA0:%.+]] // CHECK: [[CSIZE:%.+]] = mul nuw i[[SZ]] [[CELEMSIZE2]], 2 -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT5]], i32 0, i32 0), i32 0, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT5]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [6 x i[[SZ]]], [6 x i[[SZ]]]* [[S:%.+]], i32 0, i32 0 @@ -639,7 +639,7 @@ int bar(int n){ // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 50 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([5 x i[[SZ]]], [5 x i[[SZ]]]* [[SIZET6]], i32 0, i32 0), i64* getelementptr inbounds ([5 x i64], [5 x i64]* [[MAPT6]], i32 0, i32 0), i32 0, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([5 x i[[SZ]]], [5 x i[[SZ]]]* [[SIZET6]], i32 0, i32 0), i64* getelementptr inbounds ([5 x i64], [5 x i64]* [[MAPT6]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P:%.+]], i32 0, i32 0 @@ -696,7 +696,7 @@ int bar(int n){ // CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 40 // CHECK: br i1 [[IF]], label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]] // CHECK: [[IFTHEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET7]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT7]], i32 0, i32 0), i32 0, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET7]], i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPT7]], i32 0, i32 0), i32 0, i32 1) // CHECK-DAG: [[BPR]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P:%.+]], i32 0, i32 0 diff --git a/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp index 0516979f8c..21055ea4b1 100644 --- a/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp @@ -194,7 +194,7 @@ int foo(int n) { // CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0 // CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]], // CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64 -// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null, i32 0, i32 0) +// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i[[SZ]]* null, i64* null, i32 0, i32 1) // CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]] // CHECK: [[FAIL]] @@ -211,7 +211,7 @@ int foo(int n) { // CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2 // CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]], // CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64 -// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams_nowait(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SZT]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT]], i32 0, i32 0), i32 0, i32 0) +// CHECK: [[RET:%.+]] = call i32 @__tgt_target_teams_nowait(i64 [[DEVICE]], i8* @{{[^,]+}}, i32 2, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i[[SZ]]* [[SZT]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPT]], i32 0, i32 0), i32 0, i32 1) // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]] diff --git a/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp index b2b911e888..463a6afd2d 100644 --- a/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp @@ -85,7 +85,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]](i{{64|32}} %{{.+}}) // LAMBDA: ret #pragma omp target teams distribute simd firstprivate(g, g1, sivar) @@ -164,7 +164,7 @@ int main() { } // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}) // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret @@ -225,8 +225,8 @@ int main() { // CHECK-DAG: [[VAR_ADDR_REF:%.+]] = load{{.+}} [[VAR_ADDR]], // firstprivate vec(vec): copy from *_addr into priv1 and then from priv1 into priv2 -// CHECK-DAG: [[VEC_DEST_PRIV:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* -// CHECK-DAG: [[VEC_SRC:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_ADDR_VAL]] to i8* +// CHECK-DAG: [[VEC_DEST_PRIV:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* +// CHECK-DAG: [[VEC_SRC:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_ADDR_VAL]] to i8* // CHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[VEC_DEST_PRIV]], i8* align {{[0-9]+}} [[VEC_SRC]], {{.+}}) // firstprivate(s_arr) @@ -258,7 +258,7 @@ int main() { // CHECK: ret void // CHECK: define{{.*}} i{{[0-9]+}} @[[TMAIN_INT]]() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[TOFFL1:.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}) // CHECK: ret @@ -311,8 +311,8 @@ int main() { // CHECK: [[S_ARR_ADDR_REF:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[S_ARR_ADDR]], // firstprivate vec(vec): copy from *_addr into priv1 and then from priv1 into priv2 -// CHECK-DAG: [[VEC_DEST_PRIV:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* -// CHECK-DAG: [[VEC_SRC:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_ADDR_VAL]] to i8* +// CHECK-DAG: [[VEC_DEST_PRIV:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_PRIV]] to i8* +// CHECK-DAG: [[VEC_SRC:%.+]] = bitcast [2 x i{{[0-9]+}}]* [[VEC_ADDR_VAL]] to i8* // CHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[VEC_DEST_PRIV]], i8* align {{[0-9]+}} [[VEC_SRC]], {{.+}}) // firstprivate(s_arr) diff --git a/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp index 4fa4d04c70..402c83921d 100644 --- a/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp @@ -84,7 +84,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]]() // LAMBDA: ret #pragma omp target teams distribute simd private(g, g1, sivar) @@ -151,7 +151,7 @@ int main() { } // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]]() // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret diff --git a/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp b/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp index c533bb30f8..a850238af5 100644 --- a/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp +++ b/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp @@ -46,7 +46,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]]( // LAMBDA: ret #pragma omp target teams distribute simd reduction(+: sivar) @@ -124,7 +124,7 @@ int main() { // CHECK: [[RED_VAR:@.+]] = common global [8 x {{.+}}] zeroinitializer // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]](i32* {{.+}}) // CHECK: [[RES:%.+]] = call{{.*}} i32 @[[TMAIN_INT:[^(]+]]() // CHECK: ret i32 [[RES]] diff --git a/test/OpenMP/teams_distribute_simd_codegen.cpp b/test/OpenMP/teams_distribute_simd_codegen.cpp index c89a936b64..ab1482855e 100644 --- a/test/OpenMP/teams_distribute_simd_codegen.cpp +++ b/test/OpenMP/teams_distribute_simd_codegen.cpp @@ -39,7 +39,7 @@ int teams_argument_global(int n) { // CK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]], // CK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]], - // CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 {{.+}}) + // CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 1) // CK1: call void @[[OFFL1:.+]](i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]], #pragma omp target @@ -48,7 +48,7 @@ int teams_argument_global(int n) { a[i] = 0; } - // CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CK1: call void @[[OFFL2:.+]](i{{64|32}} %{{.+}}) #pragma omp target {{{ @@ -119,7 +119,7 @@ int teams_local_arg(void) { int n = 100; int a[n]; - // CK2: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // CK2: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CK2: call void @[[OFFL1:.+]](i{{64|32}} %{{.+}}) #pragma omp target #pragma omp teams distribute simd @@ -135,7 +135,7 @@ int teams_local_arg(void) { // CK2: define internal void @[[OUTL1]]({{.+}}) // CK2: call void @__kmpc_for_static_init_4( // CK2: call void @__kmpc_for_static_fini( - // CK2: ret void + // CK2: ret void return a[0]; } @@ -168,7 +168,7 @@ struct SS{ // CK3: define {{.*}}i32 @{{.+}}foo{{.+}}( int foo(void) { - // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CK3: call void @[[OFFL1:.+]]([[SSI]]* %{{.+}}) #pragma omp target #pragma omp teams distribute simd @@ -184,7 +184,7 @@ struct SS{ // CK3: define internal void @[[OUTL1]]({{.+}}) // CK3: call void @__kmpc_for_static_init_4( // CK3: call void @__kmpc_for_static_fini( - // CK3: ret void + // CK3: ret void return a[0]; } @@ -241,7 +241,7 @@ int main (int argc, char **argv) { } // CK4: define {{.*}}i32 @{{[^,]+}}(i{{.+}}{{.+}} %[[ARGC:.+]], {{.+}}) -// CK4: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CK4: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CK4: call void @[[OFFL1:.+]]({{.+}}) // CK4: {{%.+}} = call{{.*}} i32 @[[TMAIN:.+]]({{.+}}) // CK4: ret @@ -256,7 +256,7 @@ int main (int argc, char **argv) { // CK4: ret void // CK4: define {{.*}}i32 @[[TMAIN]]({{.+}}) -// CK4: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 {{.+}}) +// CK4: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 1) // CK4: call void @[[OFFLT:.+]]({{.+}}) // CK4: ret // CK4-NEXT: } diff --git a/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp b/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp index 27320191fa..ec0b006a37 100644 --- a/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp +++ b/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp @@ -86,7 +86,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]](i{{64|32}} %{{.+}}) // LAMBDA: ret #pragma omp target @@ -167,7 +167,7 @@ int main() { } // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]](i{{64|32}} %{{.+}}) // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret @@ -261,7 +261,7 @@ int main() { // CHECK: ret void // CHECK: define{{.*}} i{{[0-9]+}} @[[TMAIN_INT]]() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[TOFFL1:.+]](i{{64|32}} %{{.+}}) // CHECK: ret diff --git a/test/OpenMP/teams_distribute_simd_private_codegen.cpp b/test/OpenMP/teams_distribute_simd_private_codegen.cpp index fc7000a699..10ad66ad31 100644 --- a/test/OpenMP/teams_distribute_simd_private_codegen.cpp +++ b/test/OpenMP/teams_distribute_simd_private_codegen.cpp @@ -85,7 +85,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]]( // LAMBDA: ret #pragma omp target @@ -155,7 +155,7 @@ int main() { } // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]]() // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret diff --git a/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp b/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp index 10901dea12..2137913bcd 100644 --- a/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp +++ b/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp @@ -47,7 +47,7 @@ int main() { // LAMBDA: call void [[OUTER_LAMBDA:@.+]]( [&]() { // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]]( - // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) + // LAMBDA: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // LAMBDA: call void @[[LOFFL1:.+]]( // LAMBDA: ret #pragma omp target @@ -128,7 +128,7 @@ int main() { // CHECK: [[RED_VAR:@.+]] = common global [8 x {{.+}}] zeroinitializer // CHECK: define {{.*}}i{{[0-9]+}} @main() -// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0) +// CHECK: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1) // CHECK: call void @[[OFFL1:.+]](i{{64|32}} %{{.+}}) // CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]() // CHECK: ret -- cgit v1.2.3 From e9137d49fde1e9aa1247785dd0bbfa23312e2618 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 15 Apr 2019 20:38:10 +0000 Subject: [OPENMP][NVPTX]Run parallel regions with num_threads clauses in SPMD mode. After the previous patch with the more correct handling of the number of threads in parallel regions, the parallel regions with num_threads clauses can be executed in SPMD mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358445 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_codegen.cpp | 68 +++++++++------------- .../nvptx_target_parallel_num_threads_codegen.cpp | 31 +++++----- 2 files changed, 43 insertions(+), 56 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_codegen.cpp b/test/OpenMP/nvptx_target_codegen.cpp index b05ee9dee6..906ff928c4 100644 --- a/test/OpenMP/nvptx_target_codegen.cpp +++ b/test/OpenMP/nvptx_target_codegen.cpp @@ -5,21 +5,20 @@ // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 // RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 // expected-no-diagnostics + #ifndef HEADER #define HEADER // Check that the execution mode of all 7 target regions is set to Generic Mode. // CHECK-DAG: [[NONSPMD:@.+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds // CHECK-DAG: [[UNKNOWN:@.+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 2, i32 0, i8* getelementptr inbounds -// CHECK-DAG: {{@__omp_offloading_.+l59}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l137}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l214}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l324}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l362}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l380}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l345}}_exec_mode = weak constant i8 1 -// CHECK-DAG: [[MAP_TY:%.+]] = type { [128 x i8] } -// CHECK-DAG: [[GLOB_TY:%.+]] = type { i32* } +// CHECK-DAG: {{@__omp_offloading_.+l45}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l123}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l200}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l310}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l348}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l366}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l331}}_exec_mode = weak constant i8 1 __thread int id; @@ -32,29 +31,16 @@ struct TT{ tx &operator[](int i) { return X; } }; -// CHECK: define weak void @__omp_offloading_{{.+}}_{{.+}}targetBar{{.+}}_l59(i32* [[PTR1:%.+]], i32** dereferenceable{{.*}} [[PTR2_REF:%.+]]) +// CHECK: define weak void @__omp_offloading_{{.+}}_{{.+}}targetBar{{.+}}_l45(i32* [[PTR1:%.+]], i32** dereferenceable{{.*}} [[PTR2_REF:%.+]]) // CHECK: store i32* [[PTR1]], i32** [[PTR1_ADDR:%.+]], // CHECK: store i32** [[PTR2_REF]], i32*** [[PTR2_REF_PTR:%.+]], // CHECK: [[PTR2_REF:%.+]] = load i32**, i32*** [[PTR2_REF_PTR]], -// CHECK: call void @__kmpc_kernel_init( -// CHECK: call void @__kmpc_get_team_static_memory(i16 0, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds ([[MAP_TY]], [[MAP_TY]] addrspace(3)* @{{.+}}, i32 0, i32 0, i32 0) to i8*), i{{64|32}} %{{.+}}, i16 %{{.+}}, i8** addrspacecast (i8* addrspace(3)* [[BUF_PTR:@.+]] to i8**)) -// CHECK: [[BUF:%.+]] = load i8*, i8* addrspace(3)* [[BUF_PTR]], -// CHECK: [[BUF_OFFS:%.+]] = getelementptr inbounds i8, i8* [[BUF]], i{{[0-9]+}} 0 -// CHECK: [[BUF:%.+]] = bitcast i8* [[BUF_OFFS]] to [[GLOB_TY]]* -// CHECK: [[PTR1:%.+]] = load i32*, i32** [[PTR1_ADDR]], -// CHECK: [[PTR1_GLOB_REF:%.+]] = getelementptr inbounds [[GLOB_TY]], [[GLOB_TY]]* [[BUF]], i32 0, i32 0 -// CHECK: store i32* [[PTR1]], i32** [[PTR1_GLOB_REF]], -// CHECK: call void @__kmpc_begin_sharing_variables(i8*** [[ARG_PTRS_REF:%.+]], i{{64|32}} 2) -// CHECK: [[ARG_PTRS:%.+]] = load i8**, i8*** [[ARG_PTRS_REF]], -// CHECK: [[ARG_PTR1:%.+]] = getelementptr inbounds i8*, i8** [[ARG_PTRS]], i{{[0-9]+}} 0 -// CHECK: [[BC:%.+]] = bitcast i32** [[PTR1_GLOB_REF]] to i8* -// CHECK: store i8* [[BC]], i8** [[ARG_PTR1]], -// CHECK: [[ARG_PTR2:%.+]] = getelementptr inbounds i8*, i8** [[ARG_PTRS]], i{{[0-9]+}} 1 -// CHECK: [[BC:%.+]] = bitcast i32** [[PTR2_REF]] to i8* -// CHECK: store i8* [[BC]], i8** [[ARG_PTR2]], -// CHECK: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) -// CHECK: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) -// CHECK: call void @__kmpc_end_sharing_variables() +// CHECK: call void @__kmpc_spmd_kernel_init( +// CHECK: call void @__kmpc_data_sharing_init_stack_spmd() +// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) +// CHECK: store i32 [[GTID]], i32* [[THREADID:%.+]], +// CHECK: call void @{{.+}}(i32* [[THREADID]], i32* %{{.+}}, i32** [[PTR1_ADDR]], i32** [[PTR2_REF]]) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) void targetBar(int *Ptr1, int *Ptr2) { #pragma omp target map(Ptr1[:0], Ptr2) #pragma omp parallel num_threads(2) @@ -70,7 +56,7 @@ int foo(int n) { double cn[5][n]; TT d; - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l137}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l123}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -101,7 +87,7 @@ int foo(int n) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T1:@__omp_offloading_.+foo.+l137]]() + // CHECK: define {{.*}}void [[T1:@__omp_offloading_.+foo.+l123]]() // CHECK-DAG: [[TID:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK-DAG: [[NTH:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK-DAG: [[WS:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() @@ -143,7 +129,7 @@ int foo(int n) { { } - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l214}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l200}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -174,7 +160,7 @@ int foo(int n) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T2:@__omp_offloading_.+foo.+l214]](i[[SZ:32|64]] [[ARG1:%[a-zA-Z_]+]], i[[SZ:32|64]] [[ID:%[a-zA-Z_]+]]) + // CHECK: define {{.*}}void [[T2:@__omp_offloading_.+foo.+l200]](i[[SZ:32|64]] [[ARG1:%[a-zA-Z_]+]], i[[SZ:32|64]] [[ID:%[a-zA-Z_]+]]) // CHECK: [[AA_ADDR:%.+]] = alloca i[[SZ]], // CHECK: store i[[SZ]] [[ARG1]], i[[SZ]]* [[AA_ADDR]], // CHECK: [[AA_CADDR:%.+]] = bitcast i[[SZ]]* [[AA_ADDR]] to i16* @@ -217,7 +203,7 @@ int foo(int n) { id = aa; } - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l324}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+foo.+l310}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -248,7 +234,7 @@ int foo(int n) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T3:@__omp_offloading_.+foo.+l324]](i[[SZ]] + // CHECK: define {{.*}}void [[T3:@__omp_offloading_.+foo.+l310]](i[[SZ]] // Create local storage for each capture. // CHECK: [[LOCAL_A:%.+]] = alloca i[[SZ]] // CHECK: [[LOCAL_B:%.+]] = alloca [10 x float]* @@ -409,7 +395,7 @@ int baz(int f, double &a) { return f; } - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+static.+362}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+static.+348}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -440,7 +426,7 @@ int baz(int f, double &a) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T4:@__omp_offloading_.+static.+l362]](i[[SZ]] + // CHECK: define {{.*}}void [[T4:@__omp_offloading_.+static.+l348]](i[[SZ]] // Create local storage for each capture. // CHECK: [[LOCAL_A:%.+]] = alloca i[[SZ]] // CHECK: [[LOCAL_AA:%.+]] = alloca i[[SZ]] @@ -495,7 +481,7 @@ int baz(int f, double &a) { - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+S1.+l380}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+S1.+l366}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -529,7 +515,7 @@ int baz(int f, double &a) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T5:@__omp_offloading_.+S1.+l380]]( + // CHECK: define {{.*}}void [[T5:@__omp_offloading_.+S1.+l366]]( // Create local storage for each capture. // CHECK: [[LOCAL_THIS:%.+]] = alloca [[S1:%struct.*]]* // CHECK: [[LOCAL_B:%.+]] = alloca i[[SZ]] @@ -648,7 +634,7 @@ int baz(int f, double &a) { // CHECK: ret i32 [[RES]] - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l345}}_worker() + // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l331}}_worker() // CHECK-DAG: [[OMP_EXEC_STATUS:%.+]] = alloca i8, // CHECK-DAG: [[OMP_WORK_FN:%.+]] = alloca i8*, // CHECK: store i8* null, i8** [[OMP_WORK_FN]], @@ -679,7 +665,7 @@ int baz(int f, double &a) { // CHECK: [[EXIT]] // CHECK: ret void - // CHECK: define {{.*}}void [[T6:@__omp_offloading_.+template.+l345]](i[[SZ]] + // CHECK: define {{.*}}void [[T6:@__omp_offloading_.+template.+l331]](i[[SZ]] // Create local storage for each capture. // CHECK: [[LOCAL_A:%.+]] = alloca i[[SZ]] // CHECK: [[LOCAL_AA:%.+]] = alloca i[[SZ]] diff --git a/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp b/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp index 13a7fb289d..fc90d34da3 100644 --- a/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp +++ b/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp @@ -9,8 +9,8 @@ #define HEADER // Check that the execution mode of all 2 target regions on the gpu is set to non-SPMD Mode. -// CHECK-DAG: {{@__omp_offloading_.+l21}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l26}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l21}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l26}}_exec_mode = weak constant i8 0 template tx ftemplate(int n) { @@ -46,13 +46,16 @@ int bar(int n){ // CHECK: store i16* {{%.+}}, i16** [[AA_ADDR]], align // CHECK: [[AA:%.+]] = load i16*, i16** [[AA_ADDR]], align // CHECK: [[THREAD_LIMIT:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() - // CHECK: call void @__kmpc_kernel_init(i32 - // CHECK: call void @__kmpc_push_num_threads - // CHECK: call void @__kmpc_kernel_deinit(i16 1) + // CHECK: call void @__kmpc_spmd_kernel_init(i32 [[THREAD_LIMIT]], i16 1, i16 0) + // CHECK: call void @__kmpc_data_sharing_init_stack_spmd() + // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) + // CHECK: store i32 [[GTID]], i32* [[THREADID:%.+]], + // CHECK: call void [[OUTLINED:@.+]](i32* [[THREADID]], i32* %{{.+}}, i16* [[AA]]) + // CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK: } - // CHECK: define internal void @{{.+}}(i32* noalias %{{.+}}, i32* noalias %{{.+}}, i16* {{[^%]*}}[[ARG:%.+]]) + // CHECK: define internal void [[OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i16* {{[^%]*}}[[ARG:%.+]]) // CHECK: = alloca i32*, align // CHECK: = alloca i32*, align // CHECK: [[AA_ADDR:%.+]] = alloca i16*, align @@ -63,11 +66,6 @@ int bar(int n){ // CHECK: ret void // CHECK: } - - - - - // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l26}}( // CHECK: [[A_ADDR:%.+]] = alloca i32*, align // CHECK: [[AA_ADDR:%.+]] = alloca i16*, align @@ -79,13 +77,16 @@ int bar(int n){ // CHECK: [[AA:%.+]] = load i16*, i16** [[AA_ADDR]], align // CHECK: [[B:%.+]] = load [10 x i32]*, [10 x i32]** [[B_ADDR]], align // CHECK: [[THREAD_LIMIT:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() - // CHECK: call void @__kmpc_kernel_init(i32 - // CHECK: call void @__kmpc_push_num_threads - // CHECK: call void @__kmpc_kernel_deinit(i16 1) + // CHECK: call void @__kmpc_spmd_kernel_init(i32 [[THREAD_LIMIT]], i16 1, i16 0) + // CHECK: call void @__kmpc_data_sharing_init_stack_spmd() + // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{.+}}) + // CHECK: store i32 [[GTID]], i32* [[THREADID:%.+]], + // CHECK: call void [[OUTLINED:@.+]](i32* [[THREADID]], i32* %{{.+}}, i32* [[A]], i16* [[AA]], [10 x i32]* [[B]]) + // CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK: } - // CHECK: define internal void @{{.+}}(i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* {{[^%]*}}[[ARG1:%.+]], i16* {{[^%]*}}[[ARG2:%.+]], [10 x i32]* {{[^%]*}}[[ARG3:%.+]]) + // CHECK: define internal void [[OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* {{[^%]*}}[[ARG1:%.+]], i16* {{[^%]*}}[[ARG2:%.+]], [10 x i32]* {{[^%]*}}[[ARG3:%.+]]) // CHECK: = alloca i32*, align // CHECK: = alloca i32*, align // CHECK: [[A_ADDR:%.+]] = alloca i32*, align -- cgit v1.2.3 From d54daf976f675b101ab72c7b2a6113bd723f0a78 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 16 Apr 2019 13:56:21 +0000 Subject: [AArch64] Implement Vector Funtion ABI name mangling. Summary: The name mangling scheme is defined in section 3.5 of the "Vector function application binary interface specification for AArch64" [1]. [1] https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi Reviewers: rengolin, ABataev Reviewed By: ABataev Subscribers: sdesmalen, javed.absar, kristof.beyls, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60583 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358490 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/Inputs/declare-simd-fix.h | 8 + test/OpenMP/declare_simd_aarch64.c | 190 +++++++++++++++++++++ test/OpenMP/declare_simd_aarch64.cpp | 37 ++++ test/OpenMP/declare_simd_aarch64_complex.c | 26 +++ test/OpenMP/declare_simd_aarch64_fix.c | 37 ++++ test/OpenMP/declare_simd_aarch64_sve.c | 43 +++++ test/OpenMP/declare_simd_aarch64_warning_advsimd.c | 16 ++ test/OpenMP/declare_simd_aarch64_warning_sve.c | 12 ++ 8 files changed, 369 insertions(+) create mode 100644 test/OpenMP/Inputs/declare-simd-fix.h create mode 100644 test/OpenMP/declare_simd_aarch64.c create mode 100644 test/OpenMP/declare_simd_aarch64.cpp create mode 100644 test/OpenMP/declare_simd_aarch64_complex.c create mode 100644 test/OpenMP/declare_simd_aarch64_fix.c create mode 100644 test/OpenMP/declare_simd_aarch64_sve.c create mode 100644 test/OpenMP/declare_simd_aarch64_warning_advsimd.c create mode 100644 test/OpenMP/declare_simd_aarch64_warning_sve.c (limited to 'test/OpenMP') diff --git a/test/OpenMP/Inputs/declare-simd-fix.h b/test/OpenMP/Inputs/declare-simd-fix.h new file mode 100644 index 0000000000..508818cf70 --- /dev/null +++ b/test/OpenMP/Inputs/declare-simd-fix.h @@ -0,0 +1,8 @@ +#ifndef LLVM_CLANG_TEST_OPENMP_INPUTS_DECLARE_SIMD_FIX_H +#define LLVM_CLANG_TEST_OPENMP_INPUTS_DECLARE_SIMD_FIX_H + +#pragma omp declare simd +float foo(float a, float b, int c); +float bar(float a, float b, int c); + +#endif diff --git a/test/OpenMP/declare_simd_aarch64.c b/test/OpenMP/declare_simd_aarch64.c new file mode 100644 index 0000000000..942c0e98b9 --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64.c @@ -0,0 +1,190 @@ +// -fopemp and -fopenmp-simd behavior are expected to be the same. + +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix=AARCH64 +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp-simd -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix=AARCH64 + +#pragma omp declare simd +#pragma omp declare simd simdlen(2) +#pragma omp declare simd simdlen(6) +#pragma omp declare simd simdlen(8) +double foo(float x); + +// AARCH64: "_ZGVnM2v_foo" "_ZGVnM4v_foo" "_ZGVnM8v_foo" "_ZGVnN2v_foo" "_ZGVnN4v_foo" "_ZGVnN8v_foo" +// AARCH64-NOT: _ZGVnN6v_foo + +void foo_loop(double *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = foo(y[i]); + } +} + +// make sure that the following two function by default gets generated +// with 4 and 2 lanes, as descrived in the vector ABI +#pragma omp declare simd notinbranch +float bar(double x); +#pragma omp declare simd notinbranch +double baz(float x); + +// AARCH64: "_ZGVnN2v_baz" "_ZGVnN4v_baz" +// AARCH64-NOT: baz +// AARCH64: "_ZGVnN2v_bar" "_ZGVnN4v_bar" +// AARCH64-NOT: bar + +void baz_bar_loop(double *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = baz(y[i]); + y[i] = bar(x[i]); + } +} + + /***************************/ + /* 32-bit integer tests */ + /***************************/ + +#pragma omp declare simd +#pragma omp declare simd simdlen(2) +#pragma omp declare simd simdlen(6) +#pragma omp declare simd simdlen(8) +long foo_int(int x); + +// AARCH64: "_ZGVnN2v_foo_int" "_ZGVnN4v_foo_int" "_ZGVnN8v_foo_int" +// No non power of two +// AARCH64-NOT: _ZGVnN6v_foo_int + +void foo_int_loop(long *x, int *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = foo_int(y[i]); + } +} + +#pragma omp declare simd +char simple_8bit(char); +// AARCH64: "_ZGVnM16v_simple_8bit" "_ZGVnM8v_simple_8bit" "_ZGVnN16v_simple_8bit" "_ZGVnN8v_simple_8bit" +#pragma omp declare simd +short simple_16bit(short); +// AARCH64: "_ZGVnM4v_simple_16bit" "_ZGVnM8v_simple_16bit" "_ZGVnN4v_simple_16bit" "_ZGVnN8v_simple_16bit" +#pragma omp declare simd +int simple_32bit(int); +// AARCH64: "_ZGVnM2v_simple_32bit" "_ZGVnM4v_simple_32bit" "_ZGVnN2v_simple_32bit" "_ZGVnN4v_simple_32bit" +#pragma omp declare simd +long simple_64bit(long); +// AARCH64: "_ZGVnM2v_simple_64bit" "_ZGVnN2v_simple_64bit" + +#pragma omp declare simd +#pragma omp declare simd simdlen(32) +char a01(int x); +// AARCH64: "_ZGVnN16v_a01" "_ZGVnN32v_a01" "_ZGVnN8v_a01" +// AARCH64-NOT: a01 + +#pragma omp declare simd +#pragma omp declare simd simdlen(2) +long a02(short x); +// AARCH64: "_ZGVnN2v_a02" "_ZGVnN4v_a02" "_ZGVnN8v_a02" + +// AARCH64-NOT: a02 +/************/ +/* pointers */ +/************/ + +#pragma omp declare simd +int b01(int *x); +// AARCH64: "_ZGVnN4v_b01" +// AARCH64-NOT: b01 + +#pragma omp declare simd +char b02(char *); +// AARCH64: "_ZGVnN16v_b02" "_ZGVnN8v_b02" +// AARCH64-NOT: b02 + +#pragma omp declare simd +double *b03(double *); +// AARCH64: "_ZGVnN2v_b03" +// AARCH64-NOT: b03 + +/***********/ +/* masking */ +/***********/ + +#pragma omp declare simd inbranch +int c01(double *x, short y); +// AARCH64: "_ZGVnM8vv_c01" +// AARCH64-NOT: c01 + +#pragma omp declare simd inbranch uniform(x) +double c02(double *x, char y); +// AARCH64: "_ZGVnM16uv_c02" "_ZGVnM8uv_c02" +// AARCH64-NOT: c02 + +/*************************/ +/* sincos-like signature */ +/*************************/ +#pragma omp declare simd linear(sin) linear(cos) +void sincos(double in, double *sin, double *cos); +// AARCH64: "_ZGVnN2vll_sincos" +// AARCH64-NOT: sincos + +#pragma omp declare simd linear(sin : 1) linear(cos : 2) +void SinCos(double in, double *sin, double *cos); +// AARCH64: "_ZGVnN2vll2_SinCos" +// AARCH64-NOT: SinCos + +// Selection of tests based on the examples provided in chapter 5 of +// the Vector Function ABI specifications for AArch64, at +// https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi. + +// Listing 2, p. 18 +#pragma omp declare simd inbranch uniform(x) linear(val(i) : 4) +int foo2(int *x, int i); +// AARCH64: "_ZGVnM2ul4_foo2" "_ZGVnM4ul4_foo2" +// AARCH64-NOT: foo2 + +// Listing 3, p. 18 +#pragma omp declare simd inbranch uniform(x, c) linear(i \ + : c) +int foo3(int *x, int i, unsigned char c); +// AARCH64: "_ZGVnM16uls2u_foo3" "_ZGVnM8uls2u_foo3" +// AARCH64-NOT: foo3 + +// Listing 6, p. 19 +#pragma omp declare simd linear(x) aligned(x : 16) simdlen(4) +int foo4(int *x, float y); +// AARCH64: "_ZGVnM4la16v_foo4" "_ZGVnN4la16v_foo4" +// AARCH64-NOT: foo4 + +static int *I; +static char *C; +static short *S; +static long *L; +static float *F; +static double *D; +void do_something() { + simple_8bit(*C); + simple_16bit(*S); + simple_32bit(*I); + simple_64bit(*L); + *C = a01(*I); + *L = a02(*S); + *I = b01(I); + *C = b02(C); + D = b03(D); + *I = c01(D, *S); + *D = c02(D, *S); + sincos(*D, D, D); + SinCos(*D, D, D); + foo2(I, *I); + foo3(I, *I, *C); + foo4(I, *F); +} + +typedef struct S { + char R, G, B; +} STy; +#pragma omp declare simd notinbranch +STy DoRGB(STy x); +// AARCH64: "_ZGVnN2v_DoRGB" + +static STy *RGBData; + +void do_rgb_stuff() { + DoRGB(*RGBData); +} diff --git a/test/OpenMP/declare_simd_aarch64.cpp b/test/OpenMP/declare_simd_aarch64.cpp new file mode 100644 index 0000000000..ac7dd85231 --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64.cpp @@ -0,0 +1,37 @@ +// -fopemp and -fopenmp-simd behavior are expected to be the same. + +// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=ADVSIMD +// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +sve -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=SVE + +// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +neon -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=ADVSIMD +// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +sve -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=SVE + +// expected-no-diagnostics + +#pragma omp declare simd +double f(double x); + +#pragma omp declare simd +float f(float x); + +void aaa(double *x, double *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = f(y[i]); + } +} + +void aaa(float *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = f(y[i]); + } +} + +// ADVSIMD: "_ZGVnN2v__Z1fd" +// ADVSIMD-NOT: _Z1fd +// ADVSIMD: "_ZGVnN4v__Z1ff" +// ADVSIMD-NOT: _Z1fF + +// SVE: "_ZGVsMxv__Z1fd" +// SVE-NOT: _Z1fd +// SVE: "_ZGVsMxv__Z1ff" +// SVE-NOT: _Z1ff diff --git a/test/OpenMP/declare_simd_aarch64_complex.c b/test/OpenMP/declare_simd_aarch64_complex.c new file mode 100644 index 0000000000..97666b22ae --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64_complex.c @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c -std=c11 -emit-llvm %s -o - -femit-all-decls | FileCheck %s + +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp -x c -std=c11 -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix=SVE + +#pragma omp declare simd +#pragma omp declare simd simdlen(4) notinbranch +double _Complex double_complex(double _Complex); +// CHECK: "_ZGVnM2v_double_complex" "_ZGVnN2v_double_complex" "_ZGVnN4v_double_complex" +// CHECK-NOT: double_complex +// SVE: "_ZGVsM4v_double_complex" "_ZGVsMxv_double_complex" +// SVE-NOT: double_complex + +#pragma omp declare simd +#pragma omp declare simd simdlen(8) notinbranch +float _Complex float_complex(float _Complex); +// CHECK: "_ZGVnM2v_float_complex" "_ZGVnN2v_float_complex" "_ZGVnN8v_float_complex" +// CHECK-NOT: float_complex +// SVE: "_ZGVsM8v_float_complex" "_ZGVsMxv_float_complex" +// SVE-NOT: float_complex + +static double _Complex *DC; +static float _Complex *DF; +void call_the_complex_functions() { + double_complex(*DC); + float_complex(*DF); +} diff --git a/test/OpenMP/declare_simd_aarch64_fix.c b/test/OpenMP/declare_simd_aarch64_fix.c new file mode 100644 index 0000000000..29141f20b4 --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64_fix.c @@ -0,0 +1,37 @@ +// This test is making sure that no crash happens. + +// RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ +// RUN: -fopenmp -O3 -march=armv8-a -c %s | FileCheck %s + +// RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ +// RUN: -fopenmp-simd -O3 -march=armv8-a -c %s | FileCheck %s + +// RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ +// RUN: -fopenmp -O3 -march=armv8-a+sve -c %s | FileCheck %s + +// RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ +// RUN: -fopenmp-simd -O3 -march=armv8-a+sve -c %s | FileCheck %s + +// loop in the user code, in user_code.c +#include "Inputs/declare-simd-fix.h" + +// CHECK-LABEL: do_something: +void do_something(int *a, double *b, unsigned N) { + for (unsigned i = 0; i < N; ++i) { + a[i] = foo(b[0], b[0], 1); + } +} + +// CHECK-LABEL: do_something_else: +void do_something_else(int *a, double *b, unsigned N) { + for (unsigned i = 0; i < N; ++i) { + a[i] = foo(1.1, 1.2, 1); + } +} + +// CHECK-LABEL: do_something_more: +void do_something_more(int *a, double *b, unsigned N) { + for (unsigned i = 0; i < N; ++i) { + a[i] = foo(b[i], b[i], a[1]); + } +} diff --git a/test/OpenMP/declare_simd_aarch64_sve.c b/test/OpenMP/declare_simd_aarch64_sve.c new file mode 100644 index 0000000000..7771dc6538 --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64_sve.c @@ -0,0 +1,43 @@ +// -fopemp and -fopenmp-simd behavior are expected to be the same + +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \ +// RUN: -fopenmp -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s + +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \ +// RUN: -fopenmp-simd -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s + +#pragma omp declare simd +#pragma omp declare simd notinbranch +#pragma omp declare simd simdlen(2) +#pragma omp declare simd simdlen(4) +#pragma omp declare simd simdlen(5) // not a multiple of 128-bits +#pragma omp declare simd simdlen(6) +#pragma omp declare simd simdlen(8) +#pragma omp declare simd simdlen(32) +#pragma omp declare simd simdlen(34) // requires more than 2048 bits +double foo(float x); + +// CHECK-DAG: "_ZGVsM2v_foo" "_ZGVsM32v_foo" "_ZGVsM4v_foo" "_ZGVsM6v_foo" "_ZGVsM8v_foo" "_ZGVsMxv_foo" +// CHECK-NOT: _ZGVsN +// CHECK-NOT: _ZGVsM5v_foo +// CHECK-NOT: _ZGVsM34v_foo +// CHECK-NOT: foo + +void foo_loop(double *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = foo(y[i]); + } +} + + // test integers + +#pragma omp declare simd notinbranch +char a01(int x); +// CHECK-DAG: _ZGVsMxv_a01 +// CHECK-NOT: a01 + +static int *in; +static char *out; +void do_something() { + *out = a01(*in); +} diff --git a/test/OpenMP/declare_simd_aarch64_warning_advsimd.c b/test/OpenMP/declare_simd_aarch64_warning_advsimd.c new file mode 100644 index 0000000000..55dc960e21 --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64_warning_advsimd.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp %s -S -o %t -verify +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp-simd %s -S -o %t -verify + +#pragma omp declare simd simdlen(6) +double foo(float x); +// expected-warning@-2{{The value specified in simdlen must be a power of 2 when targeting Advanced SIMD.}} +#pragma omp declare simd simdlen(1) +float bar(double x); +// expected-warning@-2{{The clause simdlen(1) has no effect when targeting aarch64.}} + +void foo_loop(double *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = foo(y[i]); + y[i] = bar(x[i]); + } +} diff --git a/test/OpenMP/declare_simd_aarch64_warning_sve.c b/test/OpenMP/declare_simd_aarch64_warning_sve.c new file mode 100644 index 0000000000..1ed432390c --- /dev/null +++ b/test/OpenMP/declare_simd_aarch64_warning_sve.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp %s -S -o %t -verify +// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp-simd %s -S -o %t -verify + +#pragma omp declare simd simdlen(66) +double foo(float x); +//expected-warning@-2{{The clause simdlen must fit the 64-bit lanes in the architectural constraints for SVE (min is 128-bit, max is 2048-bit, by steps of 128-bit)}} + +void foo_loop(double *x, float *y, int N) { + for (int i = 0; i < N; ++i) { + x[i] = foo(y[i]); + } +} -- cgit v1.2.3 From 2201cc83eb9f6c7f2deb6010ed19a7e216e28681 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 16 Apr 2019 14:26:10 +0000 Subject: [OPENMP]Require aarch arch for the tests, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358493 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_simd_aarch64.c | 1 + test/OpenMP/declare_simd_aarch64.cpp | 1 + test/OpenMP/declare_simd_aarch64_complex.c | 1 + test/OpenMP/declare_simd_aarch64_fix.c | 1 + test/OpenMP/declare_simd_aarch64_sve.c | 1 + test/OpenMP/declare_simd_aarch64_warning_advsimd.c | 1 + test/OpenMP/declare_simd_aarch64_warning_sve.c | 1 + 7 files changed, 7 insertions(+) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_simd_aarch64.c b/test/OpenMP/declare_simd_aarch64.c index 942c0e98b9..eff0eed07d 100644 --- a/test/OpenMP/declare_simd_aarch64.c +++ b/test/OpenMP/declare_simd_aarch64.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // -fopemp and -fopenmp-simd behavior are expected to be the same. // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix=AARCH64 diff --git a/test/OpenMP/declare_simd_aarch64.cpp b/test/OpenMP/declare_simd_aarch64.cpp index ac7dd85231..2cd6d3986f 100644 --- a/test/OpenMP/declare_simd_aarch64.cpp +++ b/test/OpenMP/declare_simd_aarch64.cpp @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // -fopemp and -fopenmp-simd behavior are expected to be the same. // RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=ADVSIMD diff --git a/test/OpenMP/declare_simd_aarch64_complex.c b/test/OpenMP/declare_simd_aarch64_complex.c index 97666b22ae..d2bf1c585b 100644 --- a/test/OpenMP/declare_simd_aarch64_complex.c +++ b/test/OpenMP/declare_simd_aarch64_complex.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c -std=c11 -emit-llvm %s -o - -femit-all-decls | FileCheck %s // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp -x c -std=c11 -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix=SVE diff --git a/test/OpenMP/declare_simd_aarch64_fix.c b/test/OpenMP/declare_simd_aarch64_fix.c index 29141f20b4..87e39e524b 100644 --- a/test/OpenMP/declare_simd_aarch64_fix.c +++ b/test/OpenMP/declare_simd_aarch64_fix.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // This test is making sure that no crash happens. // RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ diff --git a/test/OpenMP/declare_simd_aarch64_sve.c b/test/OpenMP/declare_simd_aarch64_sve.c index 7771dc6538..6c5dcead83 100644 --- a/test/OpenMP/declare_simd_aarch64_sve.c +++ b/test/OpenMP/declare_simd_aarch64_sve.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // -fopemp and -fopenmp-simd behavior are expected to be the same // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \ diff --git a/test/OpenMP/declare_simd_aarch64_warning_advsimd.c b/test/OpenMP/declare_simd_aarch64_warning_advsimd.c index 55dc960e21..594013d25b 100644 --- a/test/OpenMP/declare_simd_aarch64_warning_advsimd.c +++ b/test/OpenMP/declare_simd_aarch64_warning_advsimd.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp %s -S -o %t -verify // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -fopenmp-simd %s -S -o %t -verify diff --git a/test/OpenMP/declare_simd_aarch64_warning_sve.c b/test/OpenMP/declare_simd_aarch64_warning_sve.c index 1ed432390c..0d66ce143c 100644 --- a/test/OpenMP/declare_simd_aarch64_warning_sve.c +++ b/test/OpenMP/declare_simd_aarch64_warning_sve.c @@ -1,3 +1,4 @@ +// REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp %s -S -o %t -verify // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve -fopenmp-simd %s -S -o %t -verify -- cgit v1.2.3 From 49e3eaedc344ee619c2895ce81ed70809f96b55c Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 16 Apr 2019 15:39:12 +0000 Subject: [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode. Combined constructs with parallel and if clauses without modifiers may be executed in SPMD mode since if the condition is true for the target region, it is also true for parallel region and the threads must be run in parallel. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358503 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_SPMD_codegen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_SPMD_codegen.cpp b/test/OpenMP/nvptx_SPMD_codegen.cpp index 738bbf34f7..5fa820fcba 100644 --- a/test/OpenMP/nvptx_SPMD_codegen.cpp +++ b/test/OpenMP/nvptx_SPMD_codegen.cpp @@ -8,6 +8,8 @@ #ifndef HEADER #define HEADER +int a; + // CHECK-NOT: @__omp_offloading_{{.+}}_exec_mode = weak constant i8 1 // CHECK-DAG: [[DISTR_LIGHT:@.+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 2050, i32 3, i32 0, i8* getelementptr inbounds // CHECK-DAG: [[FOR_LIGHT:@.+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 514, i32 3, i32 0, i8* getelementptr inbounds @@ -43,7 +45,7 @@ void foo() { // CHECK: call void @__kmpc_spmd_kernel_init(i32 {{.+}}, i16 1, i16 {{.+}}) // CHECK-DAG: [[DISTR_FULL]] // CHECK-DAG: [[FULL]] -#pragma omp target teams distribute parallel for simd +#pragma omp target teams distribute parallel for simd if(a) for (int i = 0; i < 10; ++i) ; #pragma omp target teams distribute parallel for simd schedule(static) @@ -301,7 +303,7 @@ int a; // CHECK-DAG: [[FULL]] // CHECK: call void @__kmpc_spmd_kernel_init(i32 {{.+}}, i16 1, i16 {{.+}}) // CHECK-DAG: [[FULL]] -#pragma omp target parallel for +#pragma omp target parallel for if(a) for (int i = 0; i < 10; ++i) ; #pragma omp target parallel for schedule(static) @@ -346,7 +348,7 @@ int a; // CHECK: call void @__kmpc_spmd_kernel_init(i32 {{.+}}, i16 1, i16 {{.+}}) // CHECK-DAG: [[FULL]] // CHECK-DAG: [[BAR_FULL]] -#pragma omp target parallel +#pragma omp target parallel if(a) #pragma omp for simd for (int i = 0; i < 10; ++i) ; -- cgit v1.2.3 From 129afaf26c246f8cfad3703bbcbcb6c10a405b4a Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 17 Apr 2019 16:53:08 +0000 Subject: [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode. All target-parallel-based constructs can be run in SPMD mode from now on. Even if num_threads clauses or if clauses are used, such constructs can be executed in SPMD mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358595 91177308-0d34-0410-b5e6-96231b3b80d8 --- ...tx_distribute_parallel_generic_mode_codegen.cpp | 19 ++++-------- test/OpenMP/nvptx_target_simd_codegen.cpp | 24 +++++++-------- .../nvptx_target_teams_distribute_simd_codegen.cpp | 34 +++++++++++----------- test/OpenMP/target_parallel_if_codegen.cpp | 11 ++++--- .../OpenMP/target_parallel_num_threads_codegen.cpp | 2 +- 5 files changed, 43 insertions(+), 47 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp b/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp index d9056eeff5..9470aa7972 100644 --- a/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp +++ b/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp @@ -24,29 +24,22 @@ int main(int argc, char **argv) { // CHECK: [[MEM_TY:%.+]] = type { [128 x i8] } // CHECK-DAG: [[SHARED_GLOBAL_RD:@.+]] = common addrspace(3) global [[MEM_TY]] zeroinitializer // CHECK-DAG: [[KERNEL_PTR:@.+]] = internal addrspace(3) global i8* null -// CHECK-DAG: [[KERNEL_SIZE:@.+]] = internal unnamed_addr constant i{{64|32}} 84 -// CHECK-DAG: @__omp_offloading_{{.*}}_main_l17_exec_mode = weak constant i8 1 - -// CHECK-LABEL: define internal void @__omp_offloading_{{.*}}_main_l17_worker( +// CHECK-DAG: [[KERNEL_SIZE:@.+]] = internal unnamed_addr constant i{{64|32}} 40 +// CHECK-DAG: @__omp_offloading_{{.*}}_main_l17_exec_mode = weak constant i8 0 // CHECK: define weak void @__omp_offloading_{{.*}}_main_l17([10 x i32]* dereferenceable(40) %{{.+}}, [10 x i32]* dereferenceable(40) %{{.+}}, i32* dereferenceable(4) %{{.+}}, i{{64|32}} %{{.+}}, [10 x i32]* dereferenceable(40) %{{.+}}) -// CHECK: call void @__kmpc_get_team_static_memory(i16 0, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds ([[MEM_TY]], [[MEM_TY]] addrspace(3)* [[SHARED_GLOBAL_RD]], i32 0, i32 0, i32 0) to i8*), i{{64|32}} 84, i16 1, i8** addrspacecast (i8* addrspace(3)* [[KERNEL_PTR]] to i8**)) +// CHECK: call void @__kmpc_get_team_static_memory(i16 1, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds ([[MEM_TY]], [[MEM_TY]] addrspace(3)* [[SHARED_GLOBAL_RD]], i32 0, i32 0, i32 0) to i8*), i{{64|32}} 40, i16 1, i8** addrspacecast (i8* addrspace(3)* [[KERNEL_PTR]] to i8**)) // CHECK: [[PTR:%.+]] = load i8*, i8* addrspace(3)* [[KERNEL_PTR]], // CHECK: [[STACK:%.+]] = bitcast i8* [[PTR]] to %struct._globalized_locals_ty* -// CHECK: [[ARGC:%.+]] = load i32, i32* %{{.+}}, align -// CHECK: [[ARGC_ADDR:%.+]] = getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[STACK]], i{{32|64}} 0, i{{32|64}} 0 -// CHECK: store i32 [[ARGC]], i32* [[ARGC_ADDR]], -// CHECK: getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[STACK]], i{{32|64}} 0, i{{32|64}} 1 -// CHECK: getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[STACK]], i{{32|64}} 0, i{{32|64}} 2 +// CHECK: getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[STACK]], i{{32|64}} 0, i{{32|64}} 0 +// CHECK-NOT: getelementptr inbounds %struct._globalized_locals_ty, %struct._globalized_locals_ty* [[STACK]], // CHECK: call void @__kmpc_for_static_init_4( -// CHECK: call void @__kmpc_serialized_parallel( // CHECK: call void [[PARALLEL:@.+]]( -// CHECK: call void @__kmpc_end_serialized_parallel( // CHECK: call void @__kmpc_for_static_fini(%struct.ident_t* @ -// CHECK: call void @__kmpc_restore_team_static_memory(i16 0, i16 1) +// CHECK: call void @__kmpc_restore_team_static_memory(i16 1, i16 1) // CHECK: define internal void [[PARALLEL]]( // CHECK-NOT: call i8* @__kmpc_data_sharing_push_stack( diff --git a/test/OpenMP/nvptx_target_simd_codegen.cpp b/test/OpenMP/nvptx_target_simd_codegen.cpp index 89ea173add..ce4a4238f8 100644 --- a/test/OpenMP/nvptx_target_simd_codegen.cpp +++ b/test/OpenMP/nvptx_target_simd_codegen.cpp @@ -9,10 +9,10 @@ #define HEADER // Check that the execution mode of all 2 target regions on the gpu is set to NonSPMD Mode. -// CHECK-DAG: {{@__omp_offloading_.+l25}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l30}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l35}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l40}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l25}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l30}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l35}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l40}}_exec_mode = weak constant i8 0 #define N 1000 @@ -54,33 +54,33 @@ int bar(int n){ } // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l25}}( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l30}}( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l35}}( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l40}}( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini // CHECK-NOT: call i32 @__kmpc_nvptx_simd_reduce_nowait( // CHECK-NOT: call void @__kmpc_nvptx_end_reduce_nowait( -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void diff --git a/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp b/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp index 48f314785c..f86b456b3b 100644 --- a/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp +++ b/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp @@ -9,10 +9,10 @@ #define HEADER // Check that the execution mode of all 2 target regions on the gpu is set to NonSPMD Mode. -// CHECK-DAG: {{@__omp_offloading_.+l30}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l36}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l41}}_exec_mode = weak constant i8 1 -// CHECK-DAG: {{@__omp_offloading_.+l46}}_exec_mode = weak constant i8 1 +// CHECK-DAG: {{@__omp_offloading_.+l30}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l36}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l41}}_exec_mode = weak constant i8 0 +// CHECK-DAG: {{@__omp_offloading_.+l46}}_exec_mode = weak constant i8 0 #define N 1000 #define M 10 @@ -22,7 +22,7 @@ tx ftemplate(int n) { tx a[N]; short aa[N]; tx b[10]; - tx c[M][M]; + tx c[M][M]; tx f = n; tx l; int k; @@ -47,7 +47,7 @@ tx ftemplate(int n) { for(int i = 0; i < M; i++) { for(int j = 0; j < M; j++) { k = M; - c[i][j] = i+j*f+k; + c[i][j] = i + j * f + k; } } @@ -63,33 +63,33 @@ int bar(int n){ } // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l30( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l36( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) -// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 92, +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l41( -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) -// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 92, +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void // CHECK: define {{.*}}void {{@__omp_offloading_.+}}_l46({{.+}}, i{{32|64}} [[F_IN:%.+]]) // CHECK: store {{.+}} [[F_IN]], {{.+}}* {{.+}}, -// CHECK: call void @__kmpc_kernel_init(i32 %{{.+}}, i16 1) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) // CHECK: store {{.+}} 99, {{.+}}* [[COMB_UB:%.+]], align -// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 92, {{.+}}, {{.+}}, {{.+}}* [[COMB_UB]], +// CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, {{.+}}, {{.+}}, {{.+}}* [[COMB_UB]], // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_kernel_deinit(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK: ret void #endif diff --git a/test/OpenMP/target_parallel_if_codegen.cpp b/test/OpenMP/target_parallel_if_codegen.cpp index 03e8c34445..a4fdaa62f1 100644 --- a/test/OpenMP/target_parallel_if_codegen.cpp +++ b/test/OpenMP/target_parallel_if_codegen.cpp @@ -163,7 +163,8 @@ int bar(int n){ // CHECK: store i8 [[FB]], i8* [[CONV]], align // CHECK: [[ARG:%.+]] = load i[[SZ]], i[[SZ]]* [[CAPEC_ADDR]], align // -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, {{.*}}, i32 1, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, {{.*}}, i32 1, i32 [[NT:%.+]]) +// CHECK-DAG: [[NT]] = select i1 %{{.+}}, i32 0, i32 1 // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK: br i1 [[ERROR]], label %[[FAIL:.+]], label %[[END:[^,]+]] // @@ -189,7 +190,8 @@ int bar(int n){ // CHECK: br i1 [[CMP]], label {{%?}}[[IF_THEN:.+]], label {{%?}}[[IF_ELSE:.+]] // // CHECK: [[IF_THEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, {{.*}}, i32 1, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, {{.*}}, i32 1, i32 [[NT:%.+]]) +// CHECK-DAG: [[NT]] = select i1 %{{.+}}, i32 0, i32 1 // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:.+]], label %[[END:[^,]+]] // CHECK: [[FAIL]] @@ -221,7 +223,8 @@ int bar(int n){ // CHECK: br i1 [[TB]], label {{%?}}[[IF_THEN:.+]], label {{%?}}[[IF_ELSE:.+]] // // CHECK: [[IF_THEN]] -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, {{.*}}, i32 1, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, {{.*}}, i32 1, i32 [[NT:%.+]]) +// CHECK-DAG: [[NT]] = select i1 %{{.+}}, i32 0, i32 1 // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:.+]], label %[[END:[^,]+]] // CHECK: [[FAIL]] @@ -263,7 +266,7 @@ int bar(int n){ // // CHECK: define {{.*}}[[FTEMPLATE]] // -// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, {{.*}}, i32 1, i32 0) +// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, {{.*}}, i32 1, i32 1) // CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 // CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:.+]], label %[[END:[^,]+]] // diff --git a/test/OpenMP/target_parallel_num_threads_codegen.cpp b/test/OpenMP/target_parallel_num_threads_codegen.cpp index 7a39a3fd1c..41a779ced3 100644 --- a/test/OpenMP/target_parallel_num_threads_codegen.cpp +++ b/test/OpenMP/target_parallel_num_threads_codegen.cpp @@ -263,7 +263,7 @@ int bar(int n){ // CHECK: store i16 [[CEV]], i16* [[CONV]], align // CHECK: [[ARG:%.+]] = load i[[SZ]], i[[SZ]]* [[CAPEC_ADDR]], align // CHECK: [[T:%.+]] = load i16, i16* [[CAPE_ADDR]], align -// CHECK: [[THREADS:%.+]] = sext i16 [[T]] to i32 +// CHECK: [[THREADS:%.+]] = zext i16 [[T]] to i32 // // CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, {{.*}}, i32 1, i32 [[THREADS]]) // CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0 -- cgit v1.2.3 From dc7729e594a7cec142b37cc64f7bb493be22bc40 Mon Sep 17 00:00:00 2001 From: Gheorghe-Teodor Bercea Date: Thu, 18 Apr 2019 19:53:43 +0000 Subject: [OpenMP] Add checks for requires and target directives. Summary: The requires directive containing target related clauses must appear before any target region in the compilation unit. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60875 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358709 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/requires_messages.cpp | 8 ++++---- test/OpenMP/requires_target_messages.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 test/OpenMP/requires_target_messages.cpp (limited to 'test/OpenMP') diff --git a/test/OpenMP/requires_messages.cpp b/test/OpenMP/requires_messages.cpp index 873edc7052..edc98f1a14 100644 --- a/test/OpenMP/requires_messages.cpp +++ b/test/OpenMP/requires_messages.cpp @@ -7,7 +7,7 @@ int a; #pragma omp requires unified_shared_memory, unified_shared_memory // expected-error {{Only one unified_shared_memory clause can appear on a requires directive in a single translation unit}} expected-error {{directive '#pragma omp requires' cannot contain more than one 'unified_shared_memory' clause}} -#pragma omp requires unified_address // expected-error {{Only one unified_address clause can appear on a requires directive in a single translation unit}} +#pragma omp requires unified_address // expected-error {{Only one unified_address clause can appear on a requires directive in a single translation unit}} #pragma omp requires unified_address, unified_address // expected-error {{Only one unified_address clause can appear on a requires directive in a single translation unit}} expected-error {{directive '#pragma omp requires' cannot contain more than one 'unified_address' clause}} @@ -29,13 +29,13 @@ int a; #pragma omp requires atomic_default_mem_order( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'seq_cst', 'acq_rel' or 'relaxed' in OpenMP clause 'atomic_default_mem_order'}} expected-error {{expected at least one clause on '#pragma omp requires' directive}} -#pragma omp requires atomic_default_mem_order(seq_cst // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{Only one atomic_default_mem_order clause can appear on a requires directive in a single translation unit}} +#pragma omp requires atomic_default_mem_order(seq_cst // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{Only one atomic_default_mem_order clause can appear on a requires directive in a single translation unit}} -#pragma omp requires atomic_default_mem_order(invalid_modifier) // expected-error {{expected 'seq_cst', 'acq_rel' or 'relaxed' in OpenMP clause 'atomic_default_mem_order'}} expected-error {{expected at least one clause on '#pragma omp requires' directive}} +#pragma omp requires atomic_default_mem_order(invalid_modifier) // expected-error {{expected 'seq_cst', 'acq_rel' or 'relaxed' in OpenMP clause 'atomic_default_mem_order'}} expected-error {{expected at least one clause on '#pragma omp requires' directive}} #pragma omp requires atomic_default_mem_order(shared) // expected-error {{expected 'seq_cst', 'acq_rel' or 'relaxed' in OpenMP clause 'atomic_default_mem_order'}} expected-error {{expected at least one clause on '#pragma omp requires' directive}} -#pragma omp requires atomic_default_mem_order(acq_rel), atomic_default_mem_order(relaxed) // expected-error {{directive '#pragma omp requires' cannot contain more than one 'atomic_default_mem_order' claus}} expected-error {{Only one atomic_default_mem_order clause can appear on a requires directive in a single translation unit}} +#pragma omp requires atomic_default_mem_order(acq_rel), atomic_default_mem_order(relaxed) // expected-error {{directive '#pragma omp requires' cannot contain more than one 'atomic_default_mem_order' claus}} expected-error {{Only one atomic_default_mem_order clause can appear on a requires directive in a single translation unit}} #pragma omp requires // expected-error {{expected at least one clause on '#pragma omp requires' directive}} diff --git a/test/OpenMP/requires_target_messages.cpp b/test/OpenMP/requires_target_messages.cpp new file mode 100644 index 0000000000..190abbc07e --- /dev/null +++ b/test/OpenMP/requires_target_messages.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +void foo2() { + int a; + #pragma omp target // expected-note 4 {{Target previously encountered here}} + { + a = a + 1; + } +} + +#pragma omp requires atomic_default_mem_order(seq_cst) +#pragma omp requires unified_address //expected-error {{Target region encountered before requires directive with 'unified_address' clause}} +#pragma omp requires unified_shared_memory //expected-error {{Target region encountered before requires directive with 'unified_shared_memory' clause}} +#pragma omp requires reverse_offload //expected-error {{Target region encountered before requires directive with 'reverse_offload' clause}} +#pragma omp requires dynamic_allocators //expected-error {{Target region encountered before requires directive with 'dynamic_allocators' clause}} -- cgit v1.2.3 From c6dbb7392497a0f52a5631e12e56b491db2dc59c Mon Sep 17 00:00:00 2001 From: Gheorghe-Teodor Bercea Date: Thu, 18 Apr 2019 20:34:43 +0000 Subject: [OpenMP][NFC] Fix requires target test. Summary: Fix requires target test. Reviewers: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60886 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358711 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/requires_target_messages.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/requires_target_messages.cpp b/test/OpenMP/requires_target_messages.cpp index 190abbc07e..ef65d98fed 100644 --- a/test/OpenMP/requires_target_messages.cpp +++ b/test/OpenMP/requires_target_messages.cpp @@ -2,14 +2,14 @@ void foo2() { int a; - #pragma omp target // expected-note 4 {{Target previously encountered here}} + #pragma omp target // expected-note 4 {{target previously encountered here}} { a = a + 1; } } #pragma omp requires atomic_default_mem_order(seq_cst) -#pragma omp requires unified_address //expected-error {{Target region encountered before requires directive with 'unified_address' clause}} -#pragma omp requires unified_shared_memory //expected-error {{Target region encountered before requires directive with 'unified_shared_memory' clause}} -#pragma omp requires reverse_offload //expected-error {{Target region encountered before requires directive with 'reverse_offload' clause}} -#pragma omp requires dynamic_allocators //expected-error {{Target region encountered before requires directive with 'dynamic_allocators' clause}} +#pragma omp requires unified_address //expected-error {{target region encountered before requires directive with 'unified_address' clause}} +#pragma omp requires unified_shared_memory //expected-error {{target region encountered before requires directive with 'unified_shared_memory' clause}} +#pragma omp requires reverse_offload //expected-error {{target region encountered before requires directive with 'reverse_offload' clause}} +#pragma omp requires dynamic_allocators //expected-error {{target region encountered before requires directive with 'dynamic_allocators' clause}} -- cgit v1.2.3 From a079e64758490a99a20e2417f8a68bf7cce60945 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 19 Apr 2019 16:48:38 +0000 Subject: [OPENMP][NVPTX] target [teams distribute] simd maybe run without runtime. target [teams distribute] simd costructs do not require full runtime for the correct execution, we can run them without full runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358766 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/nvptx_target_simd_codegen.cpp | 16 ++++++++-------- .../nvptx_target_teams_distribute_simd_codegen.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/nvptx_target_simd_codegen.cpp b/test/OpenMP/nvptx_target_simd_codegen.cpp index ce4a4238f8..073d6fa2f1 100644 --- a/test/OpenMP/nvptx_target_simd_codegen.cpp +++ b/test/OpenMP/nvptx_target_simd_codegen.cpp @@ -54,33 +54,33 @@ int bar(int n){ } // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l25}}( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l30}}( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l35}}( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+l40}}( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK-NOT: call void @__kmpc_for_static_init // CHECK-NOT: call void @__kmpc_for_static_fini // CHECK-NOT: call i32 @__kmpc_nvptx_simd_reduce_nowait( // CHECK-NOT: call void @__kmpc_nvptx_end_reduce_nowait( -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void diff --git a/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp b/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp index f86b456b3b..6051637d55 100644 --- a/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp +++ b/test/OpenMP/nvptx_target_teams_distribute_simd_codegen.cpp @@ -63,33 +63,33 @@ int bar(int n){ } // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l30( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l36( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+}}_l41( -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void // CHECK: define {{.*}}void {{@__omp_offloading_.+}}_l46({{.+}}, i{{32|64}} [[F_IN:%.+]]) // CHECK: store {{.+}} [[F_IN]], {{.+}}* {{.+}}, -// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 1, i16 0) +// CHECK: call void @__kmpc_spmd_kernel_init(i32 %{{.+}}, i16 0, i16 0) // CHECK: store {{.+}} 99, {{.+}}* [[COMB_UB:%.+]], align // CHECK: call void @__kmpc_for_static_init_4({{.+}}, {{.+}}, {{.+}} 91, {{.+}}, {{.+}}, {{.+}}* [[COMB_UB]], // CHECK: call void @__kmpc_for_static_fini( -// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) +// CHECK: call void @__kmpc_spmd_kernel_deinit_v2(i16 0) // CHECK: ret void #endif -- cgit v1.2.3 From 4d8e7b3dae79488ffa99d70cdcf1f48ad1cde845 Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Tue, 23 Apr 2019 17:04:15 +0000 Subject: [APSInt][OpenMP] Fix isNegative, etc. for unsigned types Without this patch, APSInt inherits APInt::isNegative, which merely checks the sign bit without regard to whether the type is actually signed. isNonNegative and isStrictlyPositive call isNegative and so are also affected. This patch adjusts APSInt to override isNegative, isNonNegative, and isStrictlyPositive with implementations that consider whether the type is signed. A large set of Clang OpenMP tests are affected. Without this patch, these tests assume that `true` is not a valid argument for clauses like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but not APSInt::isStrictlyPositive. This patch adjusts those tests to assume `true` should be accepted. This patch also adds tests revealing various other similar fixes due to APSInt::isNegative calls in Clang's ExprConstant.cpp and SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object size based on `alloc_size`, `<<` and `>>` shift count validation, and OpenMP array section validation. Reviewed By: lebedev.ri, ABataev, hfinkel Differential Revision: https://reviews.llvm.org/D59712 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359012 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/distribute_collapse_messages.cpp | 4 ++-- test/OpenMP/distribute_parallel_for_collapse_messages.cpp | 4 ++-- .../distribute_parallel_for_simd_collapse_messages.cpp | 4 ++-- .../distribute_parallel_for_simd_safelen_messages.cpp | 14 ++++++++++---- .../distribute_parallel_for_simd_simdlen_messages.cpp | 14 ++++++++++---- test/OpenMP/distribute_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/distribute_simd_safelen_messages.cpp | 14 ++++++++++---- test/OpenMP/distribute_simd_simdlen_messages.cpp | 14 ++++++++++---- test/OpenMP/for_collapse_messages.cpp | 4 ++-- test/OpenMP/for_ordered_clause.cpp | 4 ++-- test/OpenMP/for_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/for_simd_safelen_messages.cpp | 4 ++-- test/OpenMP/for_simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/parallel_for_collapse_messages.cpp | 4 ++-- test/OpenMP/parallel_for_ordered_messages.cpp | 4 ++-- test/OpenMP/parallel_for_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/parallel_for_simd_safelen_messages.cpp | 4 ++-- test/OpenMP/parallel_for_simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/simd_collapse_messages.cpp | 4 ++-- test/OpenMP/simd_safelen_messages.cpp | 4 ++-- test/OpenMP/simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/target_map_messages.cpp | 2 ++ test/OpenMP/target_parallel_for_collapse_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_map_messages.cpp | 4 ++++ test/OpenMP/target_parallel_for_ordered_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_map_messages.cpp | 4 ++++ test/OpenMP/target_parallel_for_simd_ordered_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_safelen_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/target_parallel_map_messages.cpp | 4 ++++ test/OpenMP/target_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/target_simd_safelen_messages.cpp | 4 ++-- test/OpenMP/target_simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/target_teams_distribute_collapse_messages.cpp | 4 ++-- test/OpenMP/target_teams_distribute_map_messages.cpp | 4 ++++ ...get_teams_distribute_parallel_for_collapse_messages.cpp | 4 ++-- .../target_teams_distribute_parallel_for_map_messages.cpp | 4 ++++ ...eams_distribute_parallel_for_simd_collapse_messages.cpp | 4 ++-- ...get_teams_distribute_parallel_for_simd_map_messages.cpp | 4 ++++ ...teams_distribute_parallel_for_simd_safelen_messages.cpp | 14 ++++++++++---- ...teams_distribute_parallel_for_simd_simdlen_messages.cpp | 14 ++++++++++---- .../target_teams_distribute_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/target_teams_distribute_simd_map_messages.cpp | 4 ++++ .../target_teams_distribute_simd_safelen_messages.cpp | 14 ++++++++++---- .../target_teams_distribute_simd_simdlen_messages.cpp | 14 ++++++++++---- test/OpenMP/target_teams_map_messages.cpp | 2 ++ test/OpenMP/taskloop_collapse_messages.cpp | 4 ++-- test/OpenMP/taskloop_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/taskloop_simd_safelen_messages.cpp | 4 ++-- test/OpenMP/taskloop_simd_simdlen_messages.cpp | 4 ++-- test/OpenMP/teams_distribute_collapse_messages.cpp | 4 ++-- .../teams_distribute_parallel_for_collapse_messages.cpp | 4 ++-- ...eams_distribute_parallel_for_simd_collapse_messages.cpp | 4 ++-- ...teams_distribute_parallel_for_simd_safelen_messages.cpp | 14 ++++++++++---- ...teams_distribute_parallel_for_simd_simdlen_messages.cpp | 14 ++++++++++---- test/OpenMP/teams_distribute_simd_collapse_messages.cpp | 4 ++-- test/OpenMP/teams_distribute_simd_safelen_messages.cpp | 14 ++++++++++---- test/OpenMP/teams_distribute_simd_simdlen_messages.cpp | 14 ++++++++++---- 59 files changed, 228 insertions(+), 124 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/distribute_collapse_messages.cpp b/test/OpenMP/distribute_collapse_messages.cpp index b852fd2826..e4164daaed 100644 --- a/test/OpenMP/distribute_collapse_messages.cpp +++ b/test/OpenMP/distribute_collapse_messages.cpp @@ -42,7 +42,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -85,7 +85,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp distribute collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/distribute_parallel_for_collapse_messages.cpp index f01dfeea5c..c3298f1756 100644 --- a/test/OpenMP/distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp index b12dcc19d0..9399594be2 100644 --- a/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute parallel for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for simd', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp index 93766f9a6a..7e76c1f6ab 100644 --- a/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp index 8e40e3547f..9c1c552033 100644 --- a/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp @@ -66,11 +66,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} +// expected-error@+2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -148,11 +151,14 @@ int main(int argc, char **argv) { #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error {{expression is not an integral constant expression}} expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+3 {{expression is not an integral constant expression}} +// expected-error@+2 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} +#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_simd_collapse_messages.cpp b/test/OpenMP/distribute_simd_collapse_messages.cpp index f4d5b73634..204719a2e6 100644 --- a/test/OpenMP/distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/distribute_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute simd', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute simd collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_simd_safelen_messages.cpp b/test/OpenMP/distribute_simd_safelen_messages.cpp index c95d121ca2..30c0976368 100644 --- a/test/OpenMP/distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/distribute_simd_safelen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_simd_simdlen_messages.cpp b/test/OpenMP/distribute_simd_simdlen_messages.cpp index c95d121ca2..30c0976368 100644 --- a/test/OpenMP/distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/distribute_simd_simdlen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/for_collapse_messages.cpp b/test/OpenMP/for_collapse_messages.cpp index 230880b22d..5530ddcc6a 100644 --- a/test/OpenMP/for_collapse_messages.cpp +++ b/test/OpenMP/for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_ordered_clause.cpp b/test/OpenMP/for_ordered_clause.cpp index ec29a989d0..7ccf570def 100644 --- a/test/OpenMP/for_ordered_clause.cpp +++ b/test/OpenMP/for_ordered_clause.cpp @@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'ordered' clause}} -// expected-error@+5 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -113,7 +113,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/for_simd_collapse_messages.cpp b/test/OpenMP/for_simd_collapse_messages.cpp index 9e9b8ee675..f5c130f30a 100644 --- a/test/OpenMP/for_simd_collapse_messages.cpp +++ b/test/OpenMP/for_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_simd_safelen_messages.cpp b/test/OpenMP/for_simd_safelen_messages.cpp index 31b0f84cba..6868b938c2 100644 --- a/test/OpenMP/for_simd_safelen_messages.cpp +++ b/test/OpenMP/for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_simd_simdlen_messages.cpp b/test/OpenMP/for_simd_simdlen_messages.cpp index 09954283a1..86cc4690a9 100644 --- a/test/OpenMP/for_simd_simdlen_messages.cpp +++ b/test/OpenMP/for_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_collapse_messages.cpp b/test/OpenMP/parallel_for_collapse_messages.cpp index 9d99c25efa..192fa45c90 100644 --- a/test/OpenMP/parallel_for_collapse_messages.cpp +++ b/test/OpenMP/parallel_for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_ordered_messages.cpp b/test/OpenMP/parallel_for_ordered_messages.cpp index 381bc6ae1b..9681d780fb 100644 --- a/test/OpenMP/parallel_for_ordered_messages.cpp +++ b/test/OpenMP/parallel_for_ordered_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+5 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -104,7 +104,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/parallel_for_simd_collapse_messages.cpp b/test/OpenMP/parallel_for_simd_collapse_messages.cpp index d23086b9e5..39d01b8c2f 100644 --- a/test/OpenMP/parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/parallel_for_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_safelen_messages.cpp b/test/OpenMP/parallel_for_simd_safelen_messages.cpp index 49ebf428f3..939a1dafb3 100644 --- a/test/OpenMP/parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/parallel_for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/parallel_for_simd_simdlen_messages.cpp index 167644e388..8cf196bf71 100644 --- a/test/OpenMP/parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/parallel_for_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_collapse_messages.cpp b/test/OpenMP/simd_collapse_messages.cpp index b3100c097d..3e980d9492 100644 --- a/test/OpenMP/simd_collapse_messages.cpp +++ b/test/OpenMP/simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_safelen_messages.cpp b/test/OpenMP/simd_safelen_messages.cpp index b75a923e7f..f40873aeea 100644 --- a/test/OpenMP/simd_safelen_messages.cpp +++ b/test/OpenMP/simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_simdlen_messages.cpp b/test/OpenMP/simd_simdlen_messages.cpp index f34d628141..27ab4acf77 100644 --- a/test/OpenMP/simd_simdlen_messages.cpp +++ b/test/OpenMP/simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_map_messages.cpp b/test/OpenMP/target_map_messages.cpp index e1967d27c9..04e201d136 100644 --- a/test/OpenMP/target_map_messages.cpp +++ b/test/OpenMP/target_map_messages.cpp @@ -73,6 +73,8 @@ struct SA { {} #pragma omp target map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}} {} + #pragma omp target map(b[true:true]) + {} #pragma omp target map(: c,f) // expected-error {{missing map type}} {} diff --git a/test/OpenMP/target_parallel_for_collapse_messages.cpp b/test/OpenMP/target_parallel_for_collapse_messages.cpp index d8ebdda81a..2e194ffbd0 100644 --- a/test/OpenMP/target_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/target_parallel_for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target parallel for', but found only 1}} // expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) #if __cplusplus >= 201103L @@ -82,7 +82,7 @@ int main(int argc, char **argv) { for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) #if __cplusplus >= 201103L // expected-note@-2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} diff --git a/test/OpenMP/target_parallel_for_map_messages.cpp b/test/OpenMP/target_parallel_for_map_messages.cpp index 8521700b5c..6ef87d442f 100644 --- a/test/OpenMP/target_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(to: x) diff --git a/test/OpenMP/target_parallel_for_ordered_messages.cpp b/test/OpenMP/target_parallel_for_ordered_messages.cpp index 002e8e9a5c..38a977e293 100644 --- a/test/OpenMP/target_parallel_for_ordered_messages.cpp +++ b/test/OpenMP/target_parallel_for_ordered_messages.cpp @@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+2 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = ST; i < N; i++) @@ -103,7 +103,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp index f3f2aa9ace..24e30b3d3f 100644 --- a/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp @@ -43,7 +43,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -84,7 +84,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_parallel_for_simd_map_messages.cpp index 83259cdd3e..f18cc9a5f8 100644 --- a/test/OpenMP/target_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(to: x) diff --git a/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp b/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp index 3e3f6c26c3..08b9247c1b 100644 --- a/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp @@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { #pragma omp target parallel for simd ordered((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; -// expected-error@+3 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'ordered' clause}} // expected-error@+1 {{'ordered' clause with a parameter can not be specified in '#pragma omp target parallel for simd' directive}} #pragma omp target parallel for simd ordered(foobool(argc)), ordered(true), ordered(-5) @@ -105,7 +105,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp target parallel for simd ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp index 74b1a7374f..1121593e5e 100644 --- a/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target parallel for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp index f8b375ef1c..33a6642a8d 100644 --- a/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -111,7 +111,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'simdlen' clause}} -// expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_parallel_map_messages.cpp b/test/OpenMP/target_parallel_map_messages.cpp index 510595cb0b..52774aa741 100644 --- a/test/OpenMP/target_parallel_map_messages.cpp +++ b/test/OpenMP/target_parallel_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { foo(); #pragma omp target parallel map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} foo(); +#pragma omp target parallel map(l[true:true]) + foo(); #pragma omp target parallel map(x) foo(); #pragma omp target parallel map(tofrom: t[:I]) @@ -205,6 +207,8 @@ int main(int argc, char **argv) { foo(); #pragma omp target parallel map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} foo(); +#pragma omp target parallel map(l[true:true]) + foo(); #pragma omp target parallel map(x) foo(); #pragma omp target parallel map(to: x) diff --git a/test/OpenMP/target_simd_collapse_messages.cpp b/test/OpenMP/target_simd_collapse_messages.cpp index 400844152b..8bf2c3bbf7 100644 --- a/test/OpenMP/target_simd_collapse_messages.cpp +++ b/test/OpenMP/target_simd_collapse_messages.cpp @@ -41,7 +41,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -82,7 +82,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_safelen_messages.cpp b/test/OpenMP/target_simd_safelen_messages.cpp index 69ceab1a68..993d707114 100644 --- a/test/OpenMP/target_simd_safelen_messages.cpp +++ b/test/OpenMP/target_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_simdlen_messages.cpp b/test/OpenMP/target_simd_simdlen_messages.cpp index c65fe20d3a..3a6e477886 100644 --- a/test/OpenMP/target_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_simd_simdlen_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -111,7 +111,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'simdlen' clause}} -// expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_collapse_messages.cpp index 4010c5a9a9..7495a18443 100644 --- a/test/OpenMP/target_teams_distribute_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -122,7 +122,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_map_messages.cpp b/test/OpenMP/target_teams_distribute_map_messages.cpp index e4c1d0f898..0de429736e 100644 --- a/test/OpenMP/target_teams_distribute_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp index 61e76cde02..a866b79764 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -121,7 +121,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp index 878fac1517..f47655d686 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp index 069ea65ad2..4ca7a8ca9a 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -121,7 +121,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp index b2da680885..64fe5f6e09 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp index f068e6b2e4..d05f071e91 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp index d5f714c9c3..1c490582fd 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp index a2d3bde44a..6561091ec8 100644 --- a/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target teams distribute simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -118,7 +118,7 @@ int main(int argc, char **argv) { // expected-error@+6 {{expression is not an integral constant expression}} // expected-error@+5 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+4 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+4 {{argument to 'collapse' clause must be a strictly positive integer value}} #if __cplusplus >= 201103L // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif diff --git a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp index c559bcb410..3806c4ecf5 100644 --- a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(to: x) diff --git a/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp b/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp index 67b22216b9..da5c8eb75d 100644 --- a/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp b/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp index 6fea25a57a..851fff36f2 100644 --- a/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_map_messages.cpp b/test/OpenMP/target_teams_map_messages.cpp index e59a96c881..8608756bd4 100644 --- a/test/OpenMP/target_teams_map_messages.cpp +++ b/test/OpenMP/target_teams_map_messages.cpp @@ -57,6 +57,8 @@ struct SA { {} #pragma omp target teams map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}} {} + #pragma omp target teams map(b[true:true]) + {} #pragma omp target teams map(always, tofrom: c,f) {} diff --git a/test/OpenMP/taskloop_collapse_messages.cpp b/test/OpenMP/taskloop_collapse_messages.cpp index 4de0f38dae..091b8b8321 100644 --- a/test/OpenMP/taskloop_collapse_messages.cpp +++ b/test/OpenMP/taskloop_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp taskloop' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp taskloop collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_collapse_messages.cpp b/test/OpenMP/taskloop_simd_collapse_messages.cpp index 3f7e66a277..fd620c8fc1 100644 --- a/test/OpenMP/taskloop_simd_collapse_messages.cpp +++ b/test/OpenMP/taskloop_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_safelen_messages.cpp b/test/OpenMP/taskloop_simd_safelen_messages.cpp index 87c4fe07ab..b926689c3b 100644 --- a/test/OpenMP/taskloop_simd_safelen_messages.cpp +++ b/test/OpenMP/taskloop_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_simdlen_messages.cpp b/test/OpenMP/taskloop_simd_simdlen_messages.cpp index 4170d012dd..75d9a1d360 100644 --- a/test/OpenMP/taskloop_simd_simdlen_messages.cpp +++ b/test/OpenMP/taskloop_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/teams_distribute_collapse_messages.cpp b/test/OpenMP/teams_distribute_collapse_messages.cpp index bcbd774e8e..d95109c3dc 100644 --- a/test/OpenMP/teams_distribute_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) @@ -140,7 +140,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp index 2e83a37bc9..1171807fdb 100644 --- a/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) @@ -139,7 +139,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp index a287da7a36..31611c7ff0 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) @@ -139,7 +139,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp index e673bb382a..2b31c89634 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp index e673bb382a..2b31c89634 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_simd_collapse_messages.cpp b/test/OpenMP/teams_distribute_simd_collapse_messages.cpp index d0b2f814bf..a5eb6d20e0 100644 --- a/test/OpenMP/teams_distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_collapse_messages.cpp @@ -60,7 +60,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute simd', but found only 1}} // expected-error@+7 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+6 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+6 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+5 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -136,7 +136,7 @@ int main(int argc, char **argv) { // expected-error@+7 {{expression is not an integral constant expression}} // expected-error@+6 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} #if __cplusplus >= 201103L // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif diff --git a/test/OpenMP/teams_distribute_simd_safelen_messages.cpp b/test/OpenMP/teams_distribute_simd_safelen_messages.cpp index 7be581a96b..a3ea61e1da 100644 --- a/test/OpenMP/teams_distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_safelen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp b/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp index 7be581a96b..a3ea61e1da 100644 --- a/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; -- cgit v1.2.3 From 3065f15c2ec8b826e0c88b1971ffb53207cd5725 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 24 Apr 2019 19:58:30 +0000 Subject: [OPENMP]Initial support for non-rectangular loop nest. Added basic semantic analysis for the non-rectangular loop nests for OpenMP 5.0 support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359132 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_loop_messages.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index 8817c77acf..01c96add28 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -286,6 +286,13 @@ int test_iteration_spaces() { for (ii = 0; (ii < 10); (ii -= 0)) c[ii] = a[ii]; +#pragma omp parallel +// expected-error@+3 {{the loop initializer expression depends on the current loop control variable}} +// expected-error@+2 2 {{the loop condition expression depends on the current loop control variable}} +#pragma omp for + for (ii = ii * 10 + 25; ii < ii / ii - 23; ii += 1) + c[ii] = a[ii]; + #pragma omp parallel // expected-note@+2 {{defined as firstprivate}} // expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be firstprivate, predetermined as private}} @@ -596,9 +603,17 @@ int test_with_random_access_iterator() { template class TC { + int ii; public: int dotest_lt(IT begin, IT end) { #pragma omp parallel +// expected-error@+3 3 {{the loop initializer expression depends on the current loop control variable}} +// expected-error@+2 6 {{the loop condition expression depends on the current loop control variable}} +#pragma omp for + for (ii = ii * 10 + 25; ii < ii / ii - 23; ii += 1) + ; + +#pragma omp parallel // expected-note@+3 {{loop step is expected to be positive due to this condition}} // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}} #pragma omp for @@ -659,7 +674,7 @@ void test_with_template() { GoodIter begin, end; TC t1; TC t2; - t1.dotest_lt(begin, end); + t1.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} -- cgit v1.2.3 From 9981cdc9924fb8b614e60aef543372a47d12699e Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 25 Apr 2019 14:04:37 +0000 Subject: [OPENMP][AARCH64]Fix the test for declare simd, NFC. Renamed function a01 in the test to fix possible problems with the git hash match during testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359193 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/declare_simd_aarch64_sve.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/declare_simd_aarch64_sve.c b/test/OpenMP/declare_simd_aarch64_sve.c index 6c5dcead83..82f85c413b 100644 --- a/test/OpenMP/declare_simd_aarch64_sve.c +++ b/test/OpenMP/declare_simd_aarch64_sve.c @@ -33,12 +33,12 @@ void foo_loop(double *x, float *y, int N) { // test integers #pragma omp declare simd notinbranch -char a01(int x); -// CHECK-DAG: _ZGVsMxv_a01 -// CHECK-NOT: a01 +char a01_fun(int x); +// CHECK-DAG: _ZGVsMxv_a01_fun +// CHECK-NOT: a01_fun static int *in; static char *out; void do_something() { - *out = a01(*in); + *out = a01_fun(*in); } -- cgit v1.2.3 From 95b64a39967af2818c21254a8e1992a0e0e07c47 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 25 Apr 2019 16:21:13 +0000 Subject: [OPENMP] Improved check for the linear dependency in the non-rectangular loop nests. Added a checks that the initializer/condition expressions depend only only of the single previous loop iteration variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359200 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_loop_messages.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index 01c96add28..f3fba6781b 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -293,6 +293,12 @@ int test_iteration_spaces() { for (ii = ii * 10 + 25; ii < ii / ii - 23; ii += 1) c[ii] = a[ii]; +// expected-error@+3 {{expected loop invariant expression or ' * ii + ' kind of expression}} +#pragma omp for collapse(2) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (kk = ii * 10 + 25; kk < ii / ii - 23; kk += 1) + ; + #pragma omp parallel // expected-note@+2 {{defined as firstprivate}} // expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be firstprivate, predetermined as private}} @@ -603,7 +609,7 @@ int test_with_random_access_iterator() { template class TC { - int ii; + int ii, iii; public: int dotest_lt(IT begin, IT end) { #pragma omp parallel @@ -613,6 +619,14 @@ public: for (ii = ii * 10 + 25; ii < ii / ii - 23; ii += 1) ; +#pragma omp parallel +// expected-error@+4 2 {{expected loop invariant expression or ' * ii + ' kind of expression}} +// expected-error@+3 {{expected loop invariant expression or ' * TC::ii + ' kind of expression}} +#pragma omp for collapse(2) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (iii = ii * 10 + 25; iii < ii / ii - 23; iii += 1) + ; + #pragma omp parallel // expected-note@+3 {{loop step is expected to be positive due to this condition}} // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}} -- cgit v1.2.3 From bb82b001564e9b72c0dfcb4323798888c0bdde3b Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 26 Apr 2019 19:28:37 +0000 Subject: [OPENMP]Added check for non-random access types for the dependent loop counters. According to the OpenMP 5.0, For any associated loop where the b or lb expression is not loop invariant with respect to the outermost loop, the var-outer that appears in the expression may not have a random access iterator type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359340 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/for_loop_messages.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index f3fba6781b..f5ee0d4442 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -299,6 +299,13 @@ int test_iteration_spaces() { for (kk = ii * 10 + 25; kk < ii / ii - 23; kk += 1) ; +// expected-error@+4 {{expected loop invariant expression or ' * ii + ' kind of expression}} +#pragma omp for collapse(3) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (jj = 10 + 25; jj < 1000; jj += 1) + for (kk = ii * 10 + 25; kk < jj - 23; kk += 1) + ; + #pragma omp parallel // expected-note@+2 {{defined as firstprivate}} // expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be firstprivate, predetermined as private}} @@ -601,6 +608,14 @@ int test_with_random_access_iterator() { for (Iter1 I; I < end1; ++I) { } GoodIter1 I1, E1; +// expected-error@+4 {{expected an integer or a pointer type of the outer loop counter 'I' for non-rectangular nests}} +// expected-error@+4 {{expected an integer or a pointer type of the outer loop counter 'I' for non-rectangular nests}} +#pragma omp for collapse(3) + for (GoodIter1 I = I1; I < E1; I++) // expected-note 2 {{'I' declared here}} + for (int i = (I - I1) * 10 + 25; i < 23; i += 1) + for (int j = 10 + 25; j < 23 + (I - E1); j += 1) + ; + #pragma omp for for (GoodIter1 I = I1; I < E1; I++) ; @@ -609,7 +624,7 @@ int test_with_random_access_iterator() { template class TC { - int ii, iii; + int ii, iii, kk; public: int dotest_lt(IT begin, IT end) { #pragma omp parallel @@ -627,6 +642,17 @@ public: for (iii = ii * 10 + 25; iii < ii / ii - 23; iii += 1) ; +#pragma omp parallel +// expected-error@+6 2 {{expected loop invariant expression or ' * ii + ' kind of expression}} +// expected-error@+5 {{expected loop invariant expression or ' * TC::ii + ' kind of expression}} +// expected-error@+5 2 {{expected loop invariant expression or ' * ii + ' kind of expression}} +// expected-error@+4 {{expected loop invariant expression or ' * TC::ii + ' kind of expression}} +#pragma omp for collapse(3) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (iii = ii * 10 + 25; iii < ii / ii - 23; iii += 1) + for (kk = ii * 10 + 25; kk < iii - 23; kk += 1) + ; + #pragma omp parallel // expected-note@+3 {{loop step is expected to be positive due to this condition}} // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}} -- cgit v1.2.3 From 5192e612264da0e1990e81920410da77a10fa43f Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 29 Apr 2019 15:51:36 +0000 Subject: [OPENMP]Fix PR41617: crash on template instantiation. Fixed the crash on the template instantiation when trying to check the data locality in the current instantiation scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359459 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/critical_ast_print.cpp | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/critical_ast_print.cpp b/test/OpenMP/critical_ast_print.cpp index f51145e584..20cb9bf99a 100644 --- a/test/OpenMP/critical_ast_print.cpp +++ b/test/OpenMP/critical_ast_print.cpp @@ -15,28 +15,46 @@ void foo() {} // CHECK: template int tmain(T argc, char **argv) // CHECK: static int a; // CHECK-NEXT: #pragma omp critical{{$}} -// CHECK-NEXT: a = 2; +// CHECK-NEXT: a = argv[0][0]; // CHECK-NEXT: ++a; +// CHECK-NEXT: #pragma omp critical{{$}} +// CHECK-NEXT: { +// CHECK-NEXT: int b = 10; +// CHECK-NEXT: T c = 100; +// CHECK-NEXT: a = b + c; +// CHECK-NEXT: } // CHECK-NEXT: #pragma omp critical (the_name) hint(N){{$}} // CHECK-NEXT: foo(); // CHECK-NEXT: return N; // CHECK: template<> int tmain(int argc, char **argv) template -int tmain (T argc, char **argv) { +int tmain(T argc, char **argv) { T b = argc, c, d, e, f, g; static int a; // CHECK: static int a; #pragma omp critical - a=2; -// CHECK-NEXT: #pragma omp critical -// CHECK-NEXT: a = 2; -// CHECK-NEXT: ++a; + a = argv[0][0]; ++a; -#pragma omp critical (the_name) hint(N) + // CHECK-NEXT: #pragma omp critical + // CHECK-NEXT: a = argv[0][0]; + // CHECK-NEXT: ++a; + // CHECK-NEXT: #pragma omp critical{{$}} + // CHECK-NEXT: { + // CHECK-NEXT: int b = 10; + // CHECK-NEXT: int c = 100; + // CHECK-NEXT: a = b + c; + // CHECK-NEXT: } +#pragma omp critical + { + int b = 10; + T c = 100; + a = b + c; + } +#pragma omp critical(the_name) hint(N) foo(); -// CHECK-NEXT: #pragma omp critical (the_name) hint(4) -// CHECK-NEXT: foo(); -// CHECK-NEXT: return 4; + // CHECK-NEXT: #pragma omp critical (the_name) hint(4) + // CHECK-NEXT: foo(); + // CHECK-NEXT: return 4; return N; } -- cgit v1.2.3 From 336ca528612aa91867d963f22b4c3c6a6d61874f Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 6 May 2019 17:49:22 +0000 Subject: [OPENMP]Fix PR41768: check DSA for globals with `default(none)` clauses. If the `default(none)` was specified for the construct, we might miss diagnostic for the globals without explicitly specified data-sharing attributes. Patch fixes this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360061 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/distribute_parallel_for_default_messages.cpp | 8 ++++---- test/OpenMP/distribute_parallel_for_messages.cpp | 2 +- .../distribute_parallel_for_simd_default_messages.cpp | 8 ++++---- test/OpenMP/parallel_default_messages.cpp | 6 +++--- test/OpenMP/parallel_for_default_messages.cpp | 6 +++--- test/OpenMP/parallel_for_messages.cpp | 2 +- test/OpenMP/parallel_for_simd_default_messages.cpp | 6 +++--- test/OpenMP/parallel_for_simd_messages.cpp | 2 +- test/OpenMP/parallel_messages.cpp | 8 ++++++-- test/OpenMP/parallel_sections_default_messages.cpp | 4 ++-- test/OpenMP/parallel_sections_messages.cpp | 2 +- test/OpenMP/report_default_DSA.cpp | 2 +- test/OpenMP/target_parallel_default_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_default_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_messages.cpp | 2 +- test/OpenMP/target_parallel_for_simd_default_messages.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_messages.cpp | 2 +- test/OpenMP/target_teams_default_messages.cpp | 4 ++-- test/OpenMP/target_teams_distribute_default_messages.cpp | 2 +- test/OpenMP/target_teams_distribute_messages.cpp | 2 +- ...rget_teams_distribute_parallel_for_default_messages.cpp | 2 +- .../target_teams_distribute_parallel_for_messages.cpp | 2 +- ...teams_distribute_parallel_for_simd_default_messages.cpp | 2 +- .../target_teams_distribute_parallel_for_simd_messages.cpp | 2 +- test/OpenMP/target_teams_messages.cpp | 6 +++--- test/OpenMP/task_default_messages.cpp | 4 ++-- test/OpenMP/task_firstprivate_messages.cpp | 2 +- test/OpenMP/task_messages.cpp | 14 +++++++------- test/OpenMP/teams_default_messages.cpp | 4 ++-- test/OpenMP/teams_distribute_default_messages.cpp | 2 +- .../teams_distribute_parallel_for_default_messages.cpp | 2 +- test/OpenMP/teams_distribute_parallel_for_messages.cpp | 2 +- ...teams_distribute_parallel_for_simd_default_messages.cpp | 2 +- .../OpenMP/teams_distribute_parallel_for_simd_messages.cpp | 2 +- test/OpenMP/teams_distribute_simd_default_messages.cpp | 2 +- test/OpenMP/teams_distribute_simd_messages.cpp | 2 +- test/OpenMP/teams_messages.cpp | 2 +- 37 files changed, 69 insertions(+), 65 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/distribute_parallel_for_default_messages.cpp b/test/OpenMP/distribute_parallel_for_default_messages.cpp index cb9cbcf6ba..19042ef8a5 100644 --- a/test/OpenMP/distribute_parallel_for_default_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_default_messages.cpp @@ -24,7 +24,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target @@ -39,7 +39,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for default(none) +#pragma omp distribute parallel for default(none) // expected-note 2 {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); @@ -72,7 +72,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target @@ -87,7 +87,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for default(none) +#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/distribute_parallel_for_messages.cpp b/test/OpenMP/distribute_parallel_for_messages.cpp index 5ea73a88fc..6bda5d106b 100644 --- a/test/OpenMP/distribute_parallel_for_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_messages.cpp @@ -81,7 +81,7 @@ L1: } #pragma omp target #pragma omp teams -#pragma omp distribute parallel for default(none) +#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/distribute_parallel_for_simd_default_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_default_messages.cpp index 3014d039d2..80f88a17ce 100644 --- a/test/OpenMP/distribute_parallel_for_simd_default_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_default_messages.cpp @@ -24,7 +24,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target @@ -39,7 +39,7 @@ T tmain(T argc) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd default(none) +#pragma omp distribute parallel for simd default(none) // expected-note 2 {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); @@ -72,7 +72,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target @@ -87,7 +87,7 @@ int main(int argc, char **argv) { foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd default(none) +#pragma omp distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/parallel_default_messages.cpp b/test/OpenMP/parallel_default_messages.cpp index eb4b378f0d..440e91b103 100644 --- a/test/OpenMP/parallel_default_messages.cpp +++ b/test/OpenMP/parallel_default_messages.cpp @@ -18,14 +18,14 @@ int main(int argc, char **argv) { #pragma omp parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} foo(); - #pragma omp parallel default(none) + #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} - #pragma omp parallel default(none) + #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} - #pragma omp parallel default(none) + #pragma omp parallel default(none) // ge40-note {{explicit data sharing attribute requested here}} (void)c; // ge40-error {{variable 'c' must have explicitly specified data sharing attributes}} return 0; } diff --git a/test/OpenMP/parallel_for_default_messages.cpp b/test/OpenMP/parallel_for_default_messages.cpp index 95f6c9193e..8baa2f6c04 100644 --- a/test/OpenMP/parallel_for_default_messages.cpp +++ b/test/OpenMP/parallel_for_default_messages.cpp @@ -15,7 +15,7 @@ int main(int argc, char **argv) { #pragma omp parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for' cannot contain more than one 'default' clause}} @@ -25,11 +25,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for default(none) +#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); -#pragma omp parallel default(none) +#pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel for default(shared) for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/parallel_for_messages.cpp b/test/OpenMP/parallel_for_messages.cpp index 9ab4bccfc9..f5aa6e6647 100644 --- a/test/OpenMP/parallel_for_messages.cpp +++ b/test/OpenMP/parallel_for_messages.cpp @@ -58,7 +58,7 @@ L1: break; } } -#pragma omp parallel for default(none) +#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/parallel_for_simd_default_messages.cpp b/test/OpenMP/parallel_for_simd_default_messages.cpp index 6d751449bc..7b30e4106a 100644 --- a/test/OpenMP/parallel_for_simd_default_messages.cpp +++ b/test/OpenMP/parallel_for_simd_default_messages.cpp @@ -15,7 +15,7 @@ int main(int argc, char **argv) { #pragma omp parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'default' clause}} @@ -25,11 +25,11 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for simd default(none) +#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); -#pragma omp parallel default(none) +#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}} #pragma omp parallel for simd default(shared) for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} expected-error {{variable 'i' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/parallel_for_simd_messages.cpp b/test/OpenMP/parallel_for_simd_messages.cpp index f1d4c5b935..77b9b0851e 100644 --- a/test/OpenMP/parallel_for_simd_messages.cpp +++ b/test/OpenMP/parallel_for_simd_messages.cpp @@ -58,7 +58,7 @@ L1: break; } } -#pragma omp parallel for simd default(none) +#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/parallel_messages.cpp b/test/OpenMP/parallel_messages.cpp index 8b0c0353c2..49fc2305ff 100644 --- a/test/OpenMP/parallel_messages.cpp +++ b/test/OpenMP/parallel_messages.cpp @@ -7,6 +7,7 @@ void foo() { #pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}} +int a; struct S; S& bar(); int main(int argc, char **argv) { @@ -54,8 +55,11 @@ int main(int argc, char **argv) { break; } } - #pragma omp parallel default(none) - ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} +#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}} + { + ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} + ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} + } goto L2; // expected-error {{use of undeclared label 'L2'}} #pragma omp parallel diff --git a/test/OpenMP/parallel_sections_default_messages.cpp b/test/OpenMP/parallel_sections_default_messages.cpp index b16e5f7369..3d2e74933f 100644 --- a/test/OpenMP/parallel_sections_default_messages.cpp +++ b/test/OpenMP/parallel_sections_default_messages.cpp @@ -25,12 +25,12 @@ int main(int argc, char **argv) { } } -#pragma omp parallel sections default(none) +#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}} { ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} } -#pragma omp parallel sections default(none) +#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}} { #pragma omp parallel sections default(shared) { diff --git a/test/OpenMP/parallel_sections_messages.cpp b/test/OpenMP/parallel_sections_messages.cpp index 459953acd9..81f0c517cd 100644 --- a/test/OpenMP/parallel_sections_messages.cpp +++ b/test/OpenMP/parallel_sections_messages.cpp @@ -62,7 +62,7 @@ int main(int argc, char **argv) { break; } } -#pragma omp parallel sections default(none) +#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}} { ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} } diff --git a/test/OpenMP/report_default_DSA.cpp b/test/OpenMP/report_default_DSA.cpp index ba620a4ce8..d6f8158b0e 100644 --- a/test/OpenMP/report_default_DSA.cpp +++ b/test/OpenMP/report_default_DSA.cpp @@ -7,7 +7,7 @@ void foo(int x, int n) { for (int iter = 0; iter < x; iter++) { #pragma omp target teams distribute parallel for map( \ from \ - : vec [0:n]) default(none) + : vec [0:n]) default(none) // expected-note 4 {{explicit data sharing attribute requested here}} // expected-error@+1 {{variable 'n' must have explicitly specified data sharing attributes}} for (int ii = 0; ii < n; ii++) { // expected-error@+3 {{variable 'iter' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_parallel_default_messages.cpp b/test/OpenMP/target_parallel_default_messages.cpp index 9fb3fac697..0aab663b0b 100644 --- a/test/OpenMP/target_parallel_default_messages.cpp +++ b/test/OpenMP/target_parallel_default_messages.cpp @@ -18,14 +18,14 @@ int main(int argc, char **argv) { #pragma omp target parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} foo(); - #pragma omp target parallel default(none) + #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} #pragma omp target parallel default(none) foo(); #pragma omp target parallel default(shared) ++argc; - #pragma omp target parallel default(none) + #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/target_parallel_for_default_messages.cpp b/test/OpenMP/target_parallel_for_default_messages.cpp index 94049cd37b..aba3b30067 100644 --- a/test/OpenMP/target_parallel_for_default_messages.cpp +++ b/test/OpenMP/target_parallel_for_default_messages.cpp @@ -15,7 +15,7 @@ int main(int argc, char **argv) { #pragma omp target parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'default' clause}} @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for default(none) +#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/target_parallel_for_messages.cpp b/test/OpenMP/target_parallel_for_messages.cpp index 6bf4ac2807..c454987e25 100644 --- a/test/OpenMP/target_parallel_for_messages.cpp +++ b/test/OpenMP/target_parallel_for_messages.cpp @@ -61,7 +61,7 @@ L1: break; } } -#pragma omp target parallel for default(none) +#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_parallel_for_simd_default_messages.cpp b/test/OpenMP/target_parallel_for_simd_default_messages.cpp index b67bfc52e7..4b634e5116 100644 --- a/test/OpenMP/target_parallel_for_simd_default_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_default_messages.cpp @@ -15,7 +15,7 @@ int main(int argc, char **argv) { #pragma omp target parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); #pragma omp target parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'default' clause}} @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); -#pragma omp target parallel for simd default(none) +#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} foo(); diff --git a/test/OpenMP/target_parallel_for_simd_messages.cpp b/test/OpenMP/target_parallel_for_simd_messages.cpp index c0e03289d7..76090e8553 100644 --- a/test/OpenMP/target_parallel_for_simd_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_messages.cpp @@ -61,7 +61,7 @@ L1: break; } } -#pragma omp target parallel for simd default(none) +#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_teams_default_messages.cpp b/test/OpenMP/target_teams_default_messages.cpp index 18520d9e8d..a144fa05f1 100644 --- a/test/OpenMP/target_teams_default_messages.cpp +++ b/test/OpenMP/target_teams_default_messages.cpp @@ -18,10 +18,10 @@ int main(int argc, char **argv) { #pragma omp target teams default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} foo(); -#pragma omp target teams default(none) +#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} -#pragma omp target teams default(none) +#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/target_teams_distribute_default_messages.cpp b/test/OpenMP/target_teams_distribute_default_messages.cpp index 2a3229dde5..539a296f26 100644 --- a/test/OpenMP/target_teams_distribute_default_messages.cpp +++ b/test/OpenMP/target_teams_distribute_default_messages.cpp @@ -18,7 +18,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (int i=0; i<200; i++) foo(); - #pragma omp target teams distribute default(none) + #pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/target_teams_distribute_messages.cpp b/test/OpenMP/target_teams_distribute_messages.cpp index d3be0f632b..7b2080ae2b 100644 --- a/test/OpenMP/target_teams_distribute_messages.cpp +++ b/test/OpenMP/target_teams_distribute_messages.cpp @@ -61,7 +61,7 @@ L1: break; } } -#pragma omp target teams distribute default(none) +#pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_default_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_default_messages.cpp index d7c3fbaa9c..d5ea823858 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_default_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_default_messages.cpp @@ -18,7 +18,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (int i=0; i<200; i++) foo(); -#pragma omp target teams distribute parallel for default(none) +#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp index 551acd2e8f..e70c5df389 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_messages.cpp @@ -61,7 +61,7 @@ L1: break; } } -#pragma omp target teams distribute parallel for default(none) +#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp index a81aacea4a..d832d8cf16 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp @@ -23,7 +23,7 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for simd default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} for (int i=0; i<200; i++) foo(); -#pragma omp target teams distribute parallel for simd default(none) +#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_messages.cpp index 58e8862347..a98f7d83ec 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_messages.cpp @@ -62,7 +62,7 @@ L1: break; } } -#pragma omp target teams distribute parallel for simd default(none) +#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/target_teams_messages.cpp b/test/OpenMP/target_teams_messages.cpp index bc068f87b6..362767ef1d 100644 --- a/test/OpenMP/target_teams_messages.cpp +++ b/test/OpenMP/target_teams_messages.cpp @@ -47,14 +47,14 @@ int main(int argc, char **argv) { break; } } -#pragma omp target teams default(none) +#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} -#pragma omp target teams default(none) +#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} ; -#pragma omp target teams default(none) +#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}} { #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} ; diff --git a/test/OpenMP/task_default_messages.cpp b/test/OpenMP/task_default_messages.cpp index 046e388c14..0eb26856e7 100644 --- a/test/OpenMP/task_default_messages.cpp +++ b/test/OpenMP/task_default_messages.cpp @@ -13,10 +13,10 @@ int main(int argc, char **argv) { #pragma omp task default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} foo(); -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/task_firstprivate_messages.cpp b/test/OpenMP/task_firstprivate_messages.cpp index b34cda78d1..f299c75518 100644 --- a/test/OpenMP/task_firstprivate_messages.cpp +++ b/test/OpenMP/task_firstprivate_messages.cpp @@ -23,7 +23,7 @@ template struct S { T b; S(T a, T c) { -#pragma omp task default(none) firstprivate(a, b) +#pragma omp task default(none) firstprivate(a, b) // expected-note {{explicit data sharing attribute requested here}} a = b = c; // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} } }; diff --git a/test/OpenMP/task_messages.cpp b/test/OpenMP/task_messages.cpp index d490c7f8ea..92bb14983b 100644 --- a/test/OpenMP/task_messages.cpp +++ b/test/OpenMP/task_messages.cpp @@ -38,10 +38,10 @@ int foo() { #pragma omp task // expected-note@+1 2 {{predetermined as a firstprivate in a task construct here}} ++s1; -#pragma omp task default(none) +#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}} #pragma omp task // expected-error@+1 {{calling a private constructor of class 'S'}} ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}} @@ -167,7 +167,7 @@ L1: break; } } -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} goto L2; // expected-error {{use of undeclared label 'L2'}} @@ -184,10 +184,10 @@ L2: for (int n = 0; n < 100; ++n) { } -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} #pragma omp task default(shared) @@ -201,10 +201,10 @@ L2: #pragma omp task #pragma omp parallel shared(a, b) ++a, ++b; -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task // expected-error@+1 {{calling a private constructor of class 'S'}} ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/teams_default_messages.cpp b/test/OpenMP/teams_default_messages.cpp index c032f5e482..28a5e2902c 100644 --- a/test/OpenMP/teams_default_messages.cpp +++ b/test/OpenMP/teams_default_messages.cpp @@ -25,11 +25,11 @@ int main(int argc, char **argv) { foo(); #pragma omp target - #pragma omp teams default(none) + #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} #pragma omp target - #pragma omp teams default(none) + #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp parallel default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/teams_distribute_default_messages.cpp b/test/OpenMP/teams_distribute_default_messages.cpp index 5e8702a99d..9ebce9aea0 100644 --- a/test/OpenMP/teams_distribute_default_messages.cpp +++ b/test/OpenMP/teams_distribute_default_messages.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (int i=0; i<200; i++) foo(); #pragma omp target - #pragma omp teams distribute default(none) + #pragma omp teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/teams_distribute_parallel_for_default_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_default_messages.cpp index e5b3331520..efc139d84a 100644 --- a/test/OpenMP/teams_distribute_parallel_for_default_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_default_messages.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (int i=0; i<200; i++) foo(); #pragma omp target - #pragma omp teams distribute parallel for default(none) + #pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/teams_distribute_parallel_for_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_messages.cpp index 57ad666380..b861783842 100644 --- a/test/OpenMP/teams_distribute_parallel_for_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_messages.cpp @@ -76,7 +76,7 @@ L1: } } #pragma omp target -#pragma omp teams distribute parallel for default(none) +#pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_default_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_default_messages.cpp index 8db9d668fd..4de844737a 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_default_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_default_messages.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (int i=0; i<200; i++) foo(); #pragma omp target - #pragma omp teams distribute parallel for simd default(none) + #pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp index d27e156161..e95ddfc669 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp @@ -76,7 +76,7 @@ L1: } } #pragma omp target -#pragma omp teams distribute parallel for simd default(none) +#pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/teams_distribute_simd_default_messages.cpp b/test/OpenMP/teams_distribute_simd_default_messages.cpp index af176f46cb..8f6db01efb 100644 --- a/test/OpenMP/teams_distribute_simd_default_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_default_messages.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) { for (int i=0; i<200; i++) foo(); #pragma omp target - #pragma omp teams distribute simd default(none) + #pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} return 0; diff --git a/test/OpenMP/teams_distribute_simd_messages.cpp b/test/OpenMP/teams_distribute_simd_messages.cpp index 79128706bc..7a99e3f352 100644 --- a/test/OpenMP/teams_distribute_simd_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_messages.cpp @@ -76,7 +76,7 @@ L1: } } #pragma omp target -#pragma omp teams distribute simd default(none) +#pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}} for (int i = 0; i < 10; ++i) ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}} diff --git a/test/OpenMP/teams_messages.cpp b/test/OpenMP/teams_messages.cpp index 6ed3be9da5..bba7da2e0e 100644 --- a/test/OpenMP/teams_messages.cpp +++ b/test/OpenMP/teams_messages.cpp @@ -63,7 +63,7 @@ int main(int argc, char **argv) { } } #pragma omp target - #pragma omp teams default(none) + #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} goto L2; // expected-error {{use of undeclared label 'L2'}} -- cgit v1.2.3 From 03fbaba68257f6ebdec4aceec394580bd29e0b13 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 6 May 2019 20:07:20 +0000 Subject: [OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none). If the combined directive has default(none) clause and has clauses for inner directive that reference some variables, for which data-sharing attributes are not specified, the error messages should be emitted for such variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360073 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/OpenMP/distribute_parallel_for_ast_print.cpp | 8 ++++---- test/OpenMP/distribute_parallel_for_simd_ast_print.cpp | 4 ++-- test/OpenMP/parallel_for_ast_print.cpp | 4 ++-- test/OpenMP/parallel_for_schedule_messages.cpp | 2 ++ test/OpenMP/target_parallel_for_ast_print.cpp | 4 ++-- test/OpenMP/target_parallel_for_simd_ast_print.cpp | 4 ++-- test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp | 2 ++ 7 files changed, 16 insertions(+), 12 deletions(-) (limited to 'test/OpenMP') diff --git a/test/OpenMP/distribute_parallel_for_ast_print.cpp b/test/OpenMP/distribute_parallel_for_ast_print.cpp index 56bae3965b..3b32d08eb3 100644 --- a/test/OpenMP/distribute_parallel_for_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_ast_print.cpp @@ -122,8 +122,8 @@ void foo(int argc, char **argv) { [&]() { #pragma omp target #pragma omp teams -#pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) - // CHECK: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) +#pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) + // CHECK: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) for (int i = 0; i < 2; ++i) // CHECK: for (int i = 0; i < 2; ++i) [&]() { @@ -156,8 +156,8 @@ int main(int argc, char **argv) { #pragma omp threadprivate(g) #pragma omp target #pragma omp teams -#pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) - // CHECK: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) +#pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) + // CHECK: #pragma omp distribute parallel for schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp index db3300ed29..137a7460f5 100644 --- a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -123,8 +123,8 @@ int main(int argc, char **argv) { #pragma omp threadprivate(g) #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) - // CHECK: #pragma omp distribute parallel for simd schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) +#pragma omp distribute parallel for simd schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) + // CHECK: #pragma omp distribute parallel for simd schedule(guided, argc) default(none) copyin(g) dist_schedule(static, a) private(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/parallel_for_ast_print.cpp b/test/OpenMP/parallel_for_ast_print.cpp index 8e02ec40c2..06b6ab3b66 100644 --- a/test/OpenMP/parallel_for_ast_print.cpp +++ b/test/OpenMP/parallel_for_ast_print.cpp @@ -132,8 +132,8 @@ int main(int argc, char **argv) { // CHECK: static int a; static float g; #pragma omp threadprivate(g) -#pragma omp parallel for schedule(guided, argc) default(none) copyin(g) linear(a) - // CHECK: #pragma omp parallel for schedule(guided, argc) default(none) copyin(g) linear(a) +#pragma omp parallel for schedule(guided, argc) default(none) copyin(g) linear(a) shared(argc) + // CHECK: #pragma omp parallel for schedule(guided, argc) default(none) copyin(g) linear(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/parallel_for_schedule_messages.cpp b/test/OpenMP/parallel_for_schedule_messages.cpp index 5664529956..dfdd36dddd 100644 --- a/test/OpenMP/parallel_for_schedule_messages.cpp +++ b/test/OpenMP/parallel_for_schedule_messages.cpp @@ -50,6 +50,8 @@ T tmain(T argc, S **argv) { for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp parallel for schedule (static, N) // expected-error {{argument to 'schedule' clause must be a strictly positive integer value}} for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; + #pragma omp parallel for schedule (static, argc+argv[0][0]) default(none) // expected-error 2 {{variable 'argv' must have explicitly specified data sharing attributes}} expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}} expected-note 4 {{explicit data sharing attribute requested here}} + for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; return argc; } diff --git a/test/OpenMP/target_parallel_for_ast_print.cpp b/test/OpenMP/target_parallel_for_ast_print.cpp index 5e22ef3dd8..80c20baca0 100644 --- a/test/OpenMP/target_parallel_for_ast_print.cpp +++ b/test/OpenMP/target_parallel_for_ast_print.cpp @@ -176,8 +176,8 @@ int main(int argc, char **argv) { // CHECK: static int a; static float g; #pragma omp threadprivate(g) -#pragma omp target parallel for schedule(guided, argc) default(none) linear(a) - // CHECK: #pragma omp target parallel for schedule(guided, argc) default(none) linear(a) +#pragma omp target parallel for schedule(guided, argc) default(none) linear(a) shared(argc) + // CHECK: #pragma omp target parallel for schedule(guided, argc) default(none) linear(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/target_parallel_for_simd_ast_print.cpp b/test/OpenMP/target_parallel_for_simd_ast_print.cpp index 4ac606d90e..a368b8a088 100644 --- a/test/OpenMP/target_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/target_parallel_for_simd_ast_print.cpp @@ -200,8 +200,8 @@ int main(int argc, char **argv) { // CHECK: int clen = 5; static float g; #pragma omp threadprivate(g) -#pragma omp target parallel for simd schedule(guided, argc) default(none) linear(a) - // CHECK: #pragma omp target parallel for simd schedule(guided, argc) default(none) linear(a) +#pragma omp target parallel for simd schedule(guided, argc) default(none) linear(a) shared(argc) + // CHECK: #pragma omp target parallel for simd schedule(guided, argc) default(none) linear(a) shared(argc) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp index 6f990f7bd2..328e191ed3 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp @@ -106,6 +106,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for default(none) if(argc+argv[0][0]) // expected-error {{variable 'argv' must have explicitly specified data sharing attributes}} expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} expected-note 2 {{explicit data sharing attribute requested here}} + for (i = 0; i < argc; ++i) foo(); return tmain(argc, argv); } -- cgit v1.2.3