| 1 |
// RUN: fir-opt --lower-workshare --allow-unregistered-dialect %s | FileCheck %s |
| 2 |
|
| 3 |
// Checks that the nested loop_wrapper gets parallelized |
| 4 |
func.func @wsfunc(%cond : i1) { |
| 5 |
omp.workshare { |
| 6 |
%c1 = arith.constant 1 : index |
| 7 |
%c42 = arith.constant 42 : index |
| 8 |
fir.if %cond { |
| 9 |
omp.workshare.loop_wrapper { |
| 10 |
omp.loop_nest (%arg1) : index = (%c1) to (%c42) inclusive step (%c1) { |
| 11 |
"test.test1"() : () -> () |
| 12 |
omp.yield |
| 13 |
} |
| 14 |
} |
| 15 |
} |
| 16 |
omp.terminator |
| 17 |
} |
| 18 |
return |
| 19 |
} |
| 20 |
|
| 21 |
// CHECK: fir.if |
| 22 |
// CHECK: omp.wsloop nowait |