diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-05-19 12:31:28 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-05-19 12:31:28 +0000 |
commit | 1d9c15cf188ef230083b7a15a35a649e70bf6f67 (patch) | |
tree | 9c8eefc4219729acd3efc3c8c6109585a2188fff /clang/test/OpenMP/single_codegen.cpp | |
parent | 9310166a63cbc40cdb3bdbea3724030af66ae1b3 (diff) | |
download | bcm5719-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/single_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/single_codegen.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/OpenMP/single_codegen.cpp b/clang/test/OpenMP/single_codegen.cpp index 6b804269133..27d4787bb42 100644 --- a/clang/test/OpenMP/single_codegen.cpp +++ b/clang/test/OpenMP/single_codegen.cpp @@ -2,8 +2,10 @@ // RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG +// 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 @@ -166,5 +168,22 @@ void parallel_single() { } // TERM_DEBUG-DAG: [[DBG_LOC_START]] = !DILocation(line: [[@LINE-12]], // TERM_DEBUG-DAG: [[DBG_LOC_END]] = !DILocation(line: [[@LINE-3]], +#endif +#else +// ARRAY-LABEL: array_func +struct St { + int a, b; + St() : a(0), b(0) {} + St &operator=(const St &) { return *this; }; + ~St() {} +}; +void array_func(int a[3], St s[2]) { +// ARRAY: call void @__kmpc_copyprivate(%ident_t* @{{.+}}, i32 %{{.+}}, i64 16, i8* %{{.+}}, void (i8*, i8*)* [[CPY:@.+]], i32 %{{.+}}) +#pragma omp single copyprivate(a, s) + ; +} +// ARRAY: define internal void [[CPY]] +// ARRAY: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.+}}, i8* %{{.+}}, i64 12, i32 4, i1 false) +// ARRAY: call dereferenceable(8) %struct.St* @_ZN2StaSERKS_(%struct.St* %{{.+}}, %struct.St* dereferenceable(8) %{{.+}}) #endif |