diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-01-22 08:56:50 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-01-22 08:56:50 +0000 |
commit | 28d864582f4359b30e2df5f98827e2e57d94daa2 (patch) | |
tree | 7c0c766f4906b2c41911c926051a9fb41aa05dac /test/OpenMP/cancellation_point_codegen.cpp | |
parent | 01a74c4d2ddf7e92e8fb2f9de3a7a823840df0a2 (diff) |
[OPENMP] Generalize codegen for 'sections'-based directive.
If 'sections' directive has only one sub-section, the code for 'single'-based directive was emitted. Removed this codegen, because it causes crashes in different cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/cancellation_point_codegen.cpp')
-rw-r--r-- | test/OpenMP/cancellation_point_codegen.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/test/OpenMP/cancellation_point_codegen.cpp b/test/OpenMP/cancellation_point_codegen.cpp index 795f69ed24..91e6c69949 100644 --- a/test/OpenMP/cancellation_point_codegen.cpp +++ b/test/OpenMP/cancellation_point_codegen.cpp @@ -22,9 +22,16 @@ int main (int argc, char **argv) { #pragma omp cancel sections } } -// CHECK: call i32 @__kmpc_single( -// CHECK-NOT: @__kmpc_cancellationpoint -// CHECK: call void @__kmpc_end_single( +// CHECK: call void @__kmpc_for_static_init_4( +// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancellationpoint(%ident_t* {{[^,]+}}, i32 [[GTID]], i32 3) +// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0 +// CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]] +// CHECK: [[EXIT]] +// CHECK: call i32 @__kmpc_cancel_barrier(%ident_t* +// CHECK: br label +// CHECK: [[CONTINUE]] +// CHECK: br label +// CHECK: call void @__kmpc_for_static_fini( // CHECK: call void @__kmpc_barrier(%ident_t* #pragma omp sections { @@ -126,9 +133,16 @@ for (int i = 0; i < argc; ++i) { // CHECK: ret i32 0 // CHECK: define internal void @{{[^(]+}}(i32* {{[^,]+}}, i32* {{[^,]+}}) -// CHECK: call i32 @__kmpc_single( -// CHECK-NOT: @__kmpc_cancellationpoint -// CHECK: call void @__kmpc_end_single( +// CHECK: call void @__kmpc_for_static_init_4( +// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancellationpoint(%ident_t* {{[^,]+}}, i32 [[GTID:%.+]], i32 3) +// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0 +// CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]] +// CHECK: [[EXIT]] +// CHECK: call i32 @__kmpc_cancel_barrier(%ident_t* +// CHECK: br label +// CHECK: [[CONTINUE]] +// CHECK: br label +// CHECK: call void @__kmpc_for_static_fini( // CHECK: ret void // CHECK: define internal void @{{[^(]+}}(i32* {{[^,]+}}, i32* {{[^,]+}}) |