summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_firstprivate_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-05-19 12:31:28 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-05-19 12:31:28 +0000
commit1d9c15cf188ef230083b7a15a35a649e70bf6f67 (patch)
tree9c8eefc4219729acd3efc3c8c6109585a2188fff /clang/test/OpenMP/parallel_firstprivate_codegen.cpp
parent9310166a63cbc40cdb3bdbea3724030af66ae1b3 (diff)
downloadbcm5719-llvm-1d9c15cf188ef230083b7a15a35a649e70bf6f67.tar.gz
bcm5719-llvm-1d9c15cf188ef230083b7a15a35a649e70bf6f67.zip
[OPENMP] Fixed codegen for copying/initialization of array variables/parameters.
This modification generates proper copyin/initialization sequences for array variables/parameters. Before they were considered as pointers, not arrays. llvm-svn: 237691
Diffstat (limited to 'clang/test/OpenMP/parallel_firstprivate_codegen.cpp')
-rw-r--r--clang/test/OpenMP/parallel_firstprivate_codegen.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/OpenMP/parallel_firstprivate_codegen.cpp b/clang/test/OpenMP/parallel_firstprivate_codegen.cpp
index 25a0921d5a4..64a12944fca 100644
--- a/clang/test/OpenMP/parallel_firstprivate_codegen.cpp
+++ b/clang/test/OpenMP/parallel_firstprivate_codegen.cpp
@@ -3,7 +3,9 @@
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
// expected-no-diagnostics
+#ifndef ARRAY
#ifndef HEADER
#define HEADER
@@ -237,5 +239,24 @@ int main() {
// CHECK-DAG: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[VAR_PRIV]])
// CHECK-DAG: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]*
// CHECK: ret void
+
#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) { }
+ ~St() {}
+};
+
+void array_func(int a[3], St s[2]) {
+// ARRAY: @__kmpc_fork_call(
+// ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.+}}, i8* %{{.+}}, i64 12, i32 4, i1 false)
+// ARRAY: call void @_ZN2StC1ERKS_(%struct.St* %{{.+}}, %struct.St* dereferenceable(8) %{{.+}}
+#pragma omp parallel firstprivate(a, s)
+ ;
+}
+#endif
+
OpenPOWER on IntegriCloud