From 8b8e202a33cbb3f1c64d306436be7c9af624b253 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 27 Apr 2015 05:22:09 +0000 Subject: [OPENMP] Codegen for 'taskwait' directive. Emit the following code for 'taskwait' directive within tied task: call i32 @__kmpc_omp_taskwait(, i32 ); Differential Revision: http://reviews.llvm.org/D9245 llvm-svn: 235836 --- clang/test/OpenMP/taskwait_codegen.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 clang/test/OpenMP/taskwait_codegen.cpp (limited to 'clang/test/OpenMP/taskwait_codegen.cpp') 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 +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 -- cgit v1.2.3