annotate mlir/test/IR/result.mlir @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
4 // Test mixed normal and variadic results
anatofuz
parents:
diff changeset
5 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
6
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
7 func.func @correct_variadic_result() -> tensor<f32> {
150
anatofuz
parents:
diff changeset
8 // CHECK: mixed_normal_variadic_result
anatofuz
parents:
diff changeset
9 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>)
anatofuz
parents:
diff changeset
10 return %0#4 : tensor<f32>
anatofuz
parents:
diff changeset
11 }
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 // -----
anatofuz
parents:
diff changeset
14
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
15 func.func @error_in_first_variadic_result() -> tensor<f32> {
150
anatofuz
parents:
diff changeset
16 // expected-error @+1 {{result #1 must be tensor of any type}}
anatofuz
parents:
diff changeset
17 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>)
anatofuz
parents:
diff changeset
18 return %0#4 : tensor<f32>
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 // -----
anatofuz
parents:
diff changeset
22
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
23 func.func @error_in_normal_result() -> tensor<f32> {
150
anatofuz
parents:
diff changeset
24 // expected-error @+1 {{result #2 must be tensor of any type}}
anatofuz
parents:
diff changeset
25 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>)
anatofuz
parents:
diff changeset
26 return %0#4 : tensor<f32>
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 // -----
anatofuz
parents:
diff changeset
30
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
31 func.func @error_in_second_variadic_result() -> tensor<f32> {
150
anatofuz
parents:
diff changeset
32 // expected-error @+1 {{result #3 must be tensor of any type}}
anatofuz
parents:
diff changeset
33 %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>)
anatofuz
parents:
diff changeset
34 return %0#4 : tensor<f32>
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36