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 | 3015bcc62aa4fc948dd02736f525df4b5d18e8fb (patch) | |
| tree | e4e194cff0be6799df9dcac9b9f4099b63664423 /clang/test/OpenMP/cancellation_point_codegen.cpp | |
| parent | 40038d2d1eef3994c64aaebc61316999e5269ee9 (diff) | |
| download | bcm5719-llvm-3015bcc62aa4fc948dd02736f525df4b5d18e8fb.tar.gz bcm5719-llvm-3015bcc62aa4fc948dd02736f525df4b5d18e8fb.zip | |
[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.
llvm-svn: 258495
Diffstat (limited to 'clang/test/OpenMP/cancellation_point_codegen.cpp')
| -rw-r--r-- | clang/test/OpenMP/cancellation_point_codegen.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/clang/test/OpenMP/cancellation_point_codegen.cpp b/clang/test/OpenMP/cancellation_point_codegen.cpp index 795f69ed24f..91e6c699491 100644 --- a/clang/test/OpenMP/cancellation_point_codegen.cpp +++ b/clang/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* {{[^,]+}}) |

