| 1 |
// RUN: fir-opt --lower-workshare --allow-unregistered-dialect %s 2>&1 | FileCheck %s |
| 2 |
|
| 3 |
// CHECK: warning: omp workshare with unstructured control flow is currently unsupported and will be serialized. |
| 4 |
|
| 5 |
// CHECK: omp.parallel |
| 6 |
// CHECK-NEXT: omp.single |
| 7 |
|
| 8 |
// TODO Check transforming a simple CFG |
| 9 |
func.func @wsfunc() { |
| 10 |
%a = fir.alloca i32 |
| 11 |
omp.parallel { |
| 12 |
omp.workshare { |
| 13 |
^bb1: |
| 14 |
%c1 = arith.constant 1 : i32 |
| 15 |
cf.br ^bb3(%c1: i32) |
| 16 |
^bb3(%arg1: i32): |
| 17 |
"test.test2"(%arg1) : (i32) -> () |
| 18 |
omp.terminator |
| 19 |
} |
| 20 |
omp.terminator |
| 21 |
} |
| 22 |
return |
| 23 |
} |