brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 345c53d Raw
51 lines · plain
1// RUN: mlir-opt %s -verify-diagnostics2 3 4func.func @omp_canonloop_block_arg(%tc : i32) -> () {5  // expected-error@below {{Canonical loop region must have exactly one argument}}6  "omp.canonical_loop" (%tc) ({7    ^bb0(%iv: i32, %somearg: i32):8      omp.terminator9  }) : (i32) -> ()10  return11}12 13 14func.func @omp_canonloop_multiple_generators(%tc : i32) -> () {15  // expected-error@below {{'omp.new_cli' op CLI must have at most one generator}}16  %cli = omp.new_cli17  // expected-note@below {{second generator here}}18  omp.canonical_loop(%cli) %iv1 : i32 in range(%tc) {19    omp.terminator20  }21  // expected-note@below {{first generator here}}22  omp.canonical_loop(%cli) %iv2 : i32 in range(%tc) {23    omp.terminator24  }25  return26}27 28 29func.func @omp_canonloop_multiple_consumers() -> () {30  // expected-error@below {{'omp.new_cli' op CLI must have at most one consumer}}31  %cli = omp.new_cli32  %tc = llvm.mlir.constant(4 : i32) : i3233  omp.canonical_loop(%cli) %iv1 : i32 in range(%tc) {34    omp.terminator35  }36  // expected-note@below {{second consumer here}}37  omp.unroll_heuristic(%cli)38  // expected-note@below {{first consumer here}}39  omp.unroll_heuristic(%cli)40  return41}42 43 44func.func @omp_canonloop_no_generator() -> () {45  // expected-error@below {{'omp.new_cli' op CLI has no generator}}46  %cli = omp.new_cli47  // expected-note@below {{see consumer here}}48  omp.unroll_heuristic(%cli)49  return50}51