1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
3 //===----------------------------------------------------------------------===//
4 // Test mixed normal and variadic results
5 //===----------------------------------------------------------------------===//
7 func.func @correct_variadic_result() -> tensor<f32> {
8 // CHECK: mixed_normal_variadic_result
9 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>)
10 return %0#4 : tensor<f32>
15 func.func @error_in_first_variadic_result() -> tensor<f32> {
16 // expected-error @+1 {{result #1 must be variadic of tensor of any type}}
17 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>)
18 return %0#4 : tensor<f32>
23 func.func @error_in_normal_result() -> tensor<f32> {
24 // expected-error @+1 {{result #2 must be tensor of any type}}
25 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>)
26 return %0#4 : tensor<f32>
31 func.func @error_in_second_variadic_result() -> tensor<f32> {
32 // expected-error @+1 {{result #3 must be variadic of tensor of any type}}
33 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>)
34 return %0#4 : tensor<f32>