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 | 8db3eab2a3f9cf13c2ef341ceaf5ca52ef76ff06 (patch) | |
tree | 809dcdd168c0752c28f14bb77ba954acb8f28afc /test/OpenMP/task_private_codegen.cpp | |
parent | 2da70aa8bfc5162f57dd818c0ee5509824fcbdd4 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/task_private_codegen.cpp')
-rw-r--r-- | test/OpenMP/task_private_codegen.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/OpenMP/task_private_codegen.cpp b/test/OpenMP/task_private_codegen.cpp index 197e8a8fa0..9cd69da258 100644 --- a/test/OpenMP/task_private_codegen.cpp +++ b/test/OpenMP/task_private_codegen.cpp @@ -3,11 +3,13 @@ // RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-apple-darwin10 -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 x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s // RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -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 // It doesn't pass on win32. Investigating. // REQUIRES: shell +#ifndef ARRAY #ifndef HEADER #define HEADER @@ -360,4 +362,26 @@ int main() { // CHECK: ret i32 #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[2], St s[2]) { +// ARRAY: call i8* @__kmpc_omp_task_alloc( +// ARRAY-NOT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.+}}, i8* %{{.+}}, i64 12, i32 4, i1 false) +// ARRAY: call void @_ZN2StC1Ev(%struct.St* %{{.+}}) +// ARRAY: store i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** %{{.+}}, +// ARRAY: call i32 @__kmpc_omp_task( +// ARRAY: define internal i32 [[DESTRUCTORS]](i32, +// ARRAY: call void @_ZN2StD1Ev(%struct.St* %{{.+}}) +// ARRAY: br i1 +#pragma omp task private(a, s) + ; +} +#endif |