llvm-project
35 строк · 1.4 Кб
1// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
2
3//===----------------------------------------------------------------------===//
4// Test mixed normal and variadic results
5//===----------------------------------------------------------------------===//
6
7func.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>)
10return %0#4 : tensor<f32>
11}
12
13// -----
14
15func.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>)
18return %0#4 : tensor<f32>
19}
20
21// -----
22
23func.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>)
26return %0#4 : tensor<f32>
27}
28
29// -----
30
31func.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>)
34return %0#4 : tensor<f32>
35}
36
37