Skip to content

Commit 99d20f9

Browse files
committed
Fix tests
1 parent fed4884 commit 99d20f9

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

flang/test/Transforms/OpenMP/should-use-workshare-lowering-cfg.mlir

Lines changed: 0 additions & 22 deletions
This file was deleted.

flang/test/Transforms/OpenMP/should-use-workshare-lowering.mlir

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,25 @@ func.func @should_not_parallelize_3(%arg: !fir.ref<!fir.array<42xi32>>, %idx : i
138138
}
139139
return
140140
}
141+
142+
// CHECK-LABEL: @should_not_parallelize_4
143+
// CHECK-NOT: omp.workshare.loop_wrapper
144+
func.func @should_not_parallelize_4(%arg: !fir.ref<!fir.array<42xi32>>, %idx : index) {
145+
omp.workshare {
146+
^bb1:
147+
%c42 = arith.constant 42 : index
148+
%c1_i32 = arith.constant 1 : i32
149+
%shape = fir.shape %c42 : (index) -> !fir.shape<1>
150+
%array:2 = hlfir.declare %arg(%shape) {uniq_name = "array"} : (!fir.ref<!fir.array<42xi32>>, !fir.shape<1>) -> (!fir.ref<!fir.array<42xi32>>, !fir.ref<!fir.array<42xi32>>)
151+
%elemental = hlfir.elemental %shape unordered : (!fir.shape<1>) -> !hlfir.expr<42xi32> {
152+
^bb0(%i: index):
153+
hlfir.yield_element %c1_i32 : i32
154+
}
155+
hlfir.assign %elemental to %array#0 : !hlfir.expr<42xi32>, !fir.ref<!fir.array<42xi32>>
156+
hlfir.destroy %elemental : !hlfir.expr<42xi32>
157+
cf.br ^bb2
158+
^bb2:
159+
omp.terminator
160+
}
161+
return
162+
}

0 commit comments

Comments
 (0)