brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 507e37c Raw
48 lines · plain
1// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s2 3//===----------------------------------------------------------------------===//4// Test mixed normal and variadic operands5//===----------------------------------------------------------------------===//6 7func.func @correct_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {8  // CHECK: mixed_normal_variadic_operand9  "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg0, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>) -> ()10  return11}12 13// -----14 15func.func @error_in_first_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {16  // expected-error @+1 {{operand #1 must be variadic of tensor of any type}}17  "test.mixed_normal_variadic_operand"(%arg0, %arg1, %arg0, %arg0, %arg0) : (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>) -> ()18  return19}20 21// -----22 23func.func @error_in_normal_operand(%arg0: tensor<f32>, %arg1: f32) {24  // expected-error @+1 {{operand #2 must be tensor of any type}}25  "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg1, %arg0, %arg0) : (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>) -> ()26  return27}28 29// -----30 31func.func @error_in_second_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {32  // expected-error @+1 {{operand #3 must be variadic of tensor of any type}}33  "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg1, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>) -> ()34  return35}36 37// -----38 39func.func @testfunc(%arg0: i32) {40  return41}42func.func @invalid_call_operandtype() {43  %0 = arith.constant 0.0 : f3244  // expected-error @+1 {{operand type mismatch: expected operand type 'i32', but provided 'f32' for operand number 0}}45  call @testfunc(%0) : (f32) -> ()46  return47}48