blob: 92a799a88541ce75d30e61adf7badcffaa89823b [file] [log] [blame]
Nicolas Vasilachedac75ae2019-06-24 21:35:211// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
Lei Zhang3812d9562019-06-09 14:00:092
3//===----------------------------------------------------------------------===//
4// Test mixed normal and variadic operands
5//===----------------------------------------------------------------------===//
6
7func @correct_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
8 // CHECK: mixed_normal_variadic_operand
9 "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg0, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>) -> ()
10 return
11}
12
13// -----
14
15func @error_in_first_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
Lei Zhanga3e6f102019-06-12 19:08:1316 // expected-error @+1 {{operand #1 must be tensor of any type}}
Lei Zhang3812d9562019-06-09 14:00:0917 "test.mixed_normal_variadic_operand"(%arg0, %arg1, %arg0, %arg0, %arg0) : (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>) -> ()
18 return
19}
20
21// -----
22
23func @error_in_normal_operand(%arg0: tensor<f32>, %arg1: f32) {
Lei Zhanga3e6f102019-06-12 19:08:1324 // expected-error @+1 {{operand #2 must be tensor of any type}}
Lei Zhang3812d9562019-06-09 14:00:0925 "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg1, %arg0, %arg0) : (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>) -> ()
26 return
27}
28
29// -----
30
31func @error_in_second_variadic_operand(%arg0: tensor<f32>, %arg1: f32) {
Lei Zhanga3e6f102019-06-12 19:08:1332 // expected-error @+1 {{operand #3 must be tensor of any type}}
Lei Zhang3812d9562019-06-09 14:00:0933 "test.mixed_normal_variadic_operand"(%arg0, %arg0, %arg0, %arg1, %arg0) : (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>) -> ()
34 return
35}
Stephen Neuendorffer34d12c12020-07-30 21:47:4236
37// -----
38
39func @testfunc(%arg0: i32) {
40 return
41}
42func @invalid_call_operandtype() {
Mogballa54f4ea2021-10-12 23:14:5743 %0 = arith.constant 0.0 : f32
Stephen Neuendorffer34d12c12020-07-30 21:47:4244 // expected-error @+1 {{operand type mismatch: expected operand type 'i32', but provided 'f32' for operand number 0}}
45 call @testfunc(%0) : (f32) -> ()
46 return
47}