1 // RUN: fir-opt --lower-workshare --allow-unregistered-dialect %s | FileCheck %s
3 // Check that the safe to parallelize `fir.declare` op will not be parallelized
4 // due to its operand %alloc not being reloaded outside the omp.single.
7 %c0 = arith.constant 0 : index
9 %alloc = fir.allocmem !fir.array<?xf32>, %c0 {bindc_name = ".tmp.forall", uniq_name = ""}
10 %shape = fir.shape %c0 : (index) -> !fir.shape<1>
11 %declare = fir.declare %alloc(%shape) {uniq_name = ".tmp.forall"} : (!fir.heap<!fir.array<?xf32>>, !fir.shape<1>) -> !fir.heap<!fir.array<?xf32>>
12 fir.freemem %alloc : !fir.heap<!fir.array<?xf32>>
18 // CHECK: omp.single nowait
19 // CHECK: fir.allocmem
23 // CHECK: omp.terminator