brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · d6d4c3a Raw
56 lines · plain
1// RUN: mlir-opt --mlir-disable-threading -split-input-file -verify-diagnostics %s2 3func.func @verify_operand_type() {4  %0 = arith.constant 1 : index5  // expected-error@+1 {{op operand #0 must be 32-bit signless integer, but got 'index'}}6  "test.verifiers"(%0) ({7    %1 = arith.constant 2 : index8  }) : (index) -> ()9  return10}11 12// -----13 14func.func @verify_nested_op_block_trait() {15  %0 = arith.constant 1 : i3216  // expected-remark@+1 {{success run of verifier}}17  "test.verifiers"(%0) ({18    %1 = arith.constant 2 : index19    // expected-error@+1 {{op requires one region}}20    "test.verifiers"(%1) : (index) -> ()21  }) : (i32) -> ()22  return23}24 25// -----26 27func.func @verify_nested_op_operand() {28  %0 = arith.constant 1 : i3229  // expected-remark@+1 {{success run of verifier}}30  "test.verifiers"(%0) ({31    %1 = arith.constant 2 : index32    // expected-error@+1 {{op operand #0 must be 32-bit signless integer, but got 'index'}}33    "test.verifiers"(%1) ({34      %2 = arith.constant 3 : index35    }) : (index) -> ()36  }) : (i32) -> ()37  return38}39 40// -----41 42func.func @verify_nested_isolated_above() {43  %0 = arith.constant 1 : i3244  // expected-remark@+1 {{success run of verifier}}45  "test.verifiers"(%0) ({46    // expected-remark@-1 {{success run of region verifier}}47    %1 = arith.constant 2 : i3248    // expected-remark@+1 {{success run of verifier}}49    "test.verifiers"(%1) ({50      // expected-remark@-1 {{success run of region verifier}}51      %2 = arith.constant 3 : index52    }) : (i32) -> ()53  }) : (i32) -> ()54  return55}56