50 lines · plain
1// RUN: fir-opt --split-input-file --lower-workshare --allow-unregistered-dialect %s | FileCheck %s2 3// Checks that the omp.workshare.loop_wrapper binds to the correct omp.workshare4 5func.func @wsfunc() {6 %c1 = arith.constant 1 : index7 %c42 = arith.constant 42 : index8 omp.parallel {9 omp.workshare nowait {10 omp.parallel {11 omp.workshare nowait {12 omp.workshare.loop_wrapper {13 omp.loop_nest (%arg1) : index = (%c1) to (%c42) inclusive step (%c1) {14 "test.test2"() : () -> ()15 omp.yield16 }17 }18 omp.terminator19 }20 omp.terminator21 }22 omp.terminator23 }24 omp.terminator25 }26 return27}28 29// CHECK-LABEL: func.func @wsfunc() {30// CHECK: %[[VAL_0:.*]] = arith.constant 1 : index31// CHECK: %[[VAL_1:.*]] = arith.constant 42 : index32// CHECK: omp.parallel {33// CHECK: omp.single nowait {34// CHECK: omp.parallel {35// CHECK: omp.wsloop nowait {36// CHECK: omp.loop_nest (%[[VAL_2:.*]]) : index = (%[[VAL_0]]) to (%[[VAL_1]]) inclusive step (%[[VAL_0]]) {37// CHECK: "test.test2"() : () -> ()38// CHECK: omp.yield39// CHECK: }40// CHECK: }41// CHECK: omp.terminator42// CHECK: }43// CHECK: omp.terminator44// CHECK: }45// CHECK: omp.terminator46// CHECK: }47// CHECK: return48// CHECK: }49 50