summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/cancellation_point_codegen.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2017-02-17 18:32:58 +0000
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2017-02-17 18:32:58 +0000
commitf5e70210f247a8f746d0664f88e89140f959f15b (patch)
tree1e509debc5105c411acbb3f87de37d883f2b5a94 /test/OpenMP/cancellation_point_codegen.cpp
parent696f45e1309f4314286f8835ff6c50c548771bf4 (diff)
[OpenMP] Fix cancellation point in task with no cancel
With tasks, the cancel may happen in another task. This has a different region info which means that we can't find it here. Differential Revision: https://reviews.llvm.org/D30091 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/cancellation_point_codegen.cpp')
-rw-r--r--test/OpenMP/cancellation_point_codegen.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/OpenMP/cancellation_point_codegen.cpp b/test/OpenMP/cancellation_point_codegen.cpp
index 22969141af..de65c11402 100644
--- a/test/OpenMP/cancellation_point_codegen.cpp
+++ b/test/OpenMP/cancellation_point_codegen.cpp
@@ -78,6 +78,12 @@ for (int i = 0; i < argc; ++i) {
}
// CHECK: call i8* @__kmpc_omp_task_alloc(
// CHECK: call i32 @__kmpc_omp_task(
+#pragma omp task
+{
+#pragma omp cancellation point taskgroup
+}
+// CHECK: call i8* @__kmpc_omp_task_alloc(
+// CHECK: call i32 @__kmpc_omp_task(
#pragma omp parallel sections
{
{
@@ -125,6 +131,15 @@ for (int i = 0; i < argc; ++i) {
// CHECK: [[RETURN]]
// CHECK: ret i32 0
+// CHECK: define internal i32 @{{[^(]+}}(i32
+// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancellationpoint(%ident_t* {{[^,]+}}, i32 {{[^,]+}}, i32 4)
+// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK: br i1 [[CMP]], label %[[EXIT:[^,]+]],
+// CHECK: [[EXIT]]
+// CHECK: br label %[[RETURN:.+]]
+// CHECK: [[RETURN]]
+// CHECK: ret i32 0
+
// CHECK: define internal void @{{[^(]+}}(i32* {{[^,]+}}, i32* {{[^,]+}})
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancellationpoint(%ident_t* {{[^,]+}}, i32 [[GTID:%.+]], i32 3)