Skip to content

Commit 8c8b89c

Browse files
Add a test
In fact, modify an existing test to check multi-block dealloc regions
1 parent f7ec756 commit 8c8b89c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/test/Target/LLVMIR/openmp-target-private-allocatable.mlir

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ omp.private {type = private} @box.heap_privatizer : !llvm.struct<(ptr, i64, i32,
88
llvm.call @alloc_foo_1(%arg0) : (!llvm.ptr) -> ()
99
omp.yield(%arg1 : !llvm.ptr)
1010
} dealloc {
11+
// There is no reason for the dealloc region here to have two blocks.
12+
// But a multi-block test is useful in checking that the OMPIRBuilder
13+
// has updated the InsertPoint properly after translating the dealloc
14+
// region to LLVMIR.
15+
// See https://github.com/llvm/llvm-project/issues/129202 for more
16+
// context
1117
^bb0(%arg0: !llvm.ptr):
18+
llvm.br ^bb1
19+
^bb1:
1220
llvm.call @dealloc_foo_1(%arg0) : (!llvm.ptr) -> ()
1321
omp.yield
1422
}
@@ -60,3 +68,6 @@ llvm.func @_FortranAAssign(!llvm.ptr, !llvm.ptr, !llvm.ptr, i32) -> !llvm.struct
6068

6169
// Now, check the deallocation of the private var.
6270
// CHECK: call void @dealloc_foo_1(ptr %[[DESC_TO_DEALLOC]])
71+
// CHECK-NEXT: br label %[[CONT_BLOCK:.*]]
72+
// CHECK: [[CONT_BLOCK]]:
73+
// CHECK-NEXT: ret void

0 commit comments

Comments
 (0)