diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-27 05:22:09 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-27 05:22:09 +0000 |
| commit | 8b8e202a33cbb3f1c64d306436be7c9af624b253 (patch) | |
| tree | c912b1e7251d4c5a23e548ddbbb4ec22b8b76de6 /clang/test/OpenMP/taskwait_codegen.cpp | |
| parent | a89adf22db0db5aaa561b20a5ae1845190c851a7 (diff) | |
| download | bcm5719-llvm-8b8e202a33cbb3f1c64d306436be7c9af624b253.tar.gz bcm5719-llvm-8b8e202a33cbb3f1c64d306436be7c9af624b253.zip | |
[OPENMP] Codegen for 'taskwait' directive.
Emit the following code for 'taskwait' directive within tied task:
call i32 @__kmpc_omp_taskwait(<loc>, i32 <thread_id>);
Differential Revision: http://reviews.llvm.org/D9245
llvm-svn: 235836
Diffstat (limited to 'clang/test/OpenMP/taskwait_codegen.cpp')
| -rw-r--r-- | clang/test/OpenMP/taskwait_codegen.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/OpenMP/taskwait_codegen.cpp b/clang/test/OpenMP/taskwait_codegen.cpp new file mode 100644 index 00000000000..f25812659e1 --- /dev/null +++ b/clang/test/OpenMP/taskwait_codegen.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp=libiomp5 -x c++ -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +void foo() {} + +template <class T> +T tmain(T argc) { + static T a; +#pragma omp taskwait + return a + argc; +} +int main(int argc, char **argv) { +#pragma omp taskwait + return tmain(argc); +} + +// CHECK-LABEL: @main +// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%{{.+}}* @{{.+}}) +// CHECK: call i32 @__kmpc_omp_taskwait(%{{.+}}* @{{.+}}, i32 [[GTID]]) + +// CHECK-LABEL: tmain +// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%{{.+}}* @{{.+}}) +// CHECK: call i32 @__kmpc_omp_taskwait(%{{.+}}* @{{.+}}, i32 [[GTID]]) + + +#endif |

