150
|
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
|
|
2
|
|
3 //===----------------------------------------------------------------------===//
|
|
4 // Test mixed normal and variadic results
|
|
5 //===----------------------------------------------------------------------===//
|
|
6
|
236
|
7 func.func @correct_variadic_result() -> tensor<f32> {
|
150
|
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>
|
|
11 }
|
|
12
|
|
13 // -----
|
|
14
|
236
|
15 func.func @error_in_first_variadic_result() -> tensor<f32> {
|
150
|
16 // expected-error @+1 {{result #1 must be 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>
|
|
19 }
|
|
20
|
|
21 // -----
|
|
22
|
236
|
23 func.func @error_in_normal_result() -> tensor<f32> {
|
150
|
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>
|
|
27 }
|
|
28
|
|
29 // -----
|
|
30
|
236
|
31 func.func @error_in_second_variadic_result() -> tensor<f32> {
|
150
|
32 // expected-error @+1 {{result #3 must be 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>
|
|
35 }
|
|
36
|