Mercurial > hg > CbC > CbC_llvm
diff mlir/test/IR/result.mlir @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | c4bab56944e8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mlir/test/IR/result.mlir Thu Feb 13 15:10:13 2020 +0900 @@ -0,0 +1,36 @@ +// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s + +//===----------------------------------------------------------------------===// +// Test mixed normal and variadic results +//===----------------------------------------------------------------------===// + +func @correct_variadic_result() -> tensor<f32> { + // CHECK: mixed_normal_variadic_result + %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>) + return %0#4 : tensor<f32> +} + +// ----- + +func @error_in_first_variadic_result() -> tensor<f32> { + // expected-error @+1 {{result #1 must be tensor of any type}} + %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, f32, tensor<f32>, tensor<f32>, tensor<f32>) + return %0#4 : tensor<f32> +} + +// ----- + +func @error_in_normal_result() -> tensor<f32> { + // expected-error @+1 {{result #2 must be tensor of any type}} + %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, f32, tensor<f32>, tensor<f32>) + return %0#4 : tensor<f32> +} + +// ----- + +func @error_in_second_variadic_result() -> tensor<f32> { + // expected-error @+1 {{result #3 must be tensor of any type}} + %0:5 = "test.mixed_normal_variadic_result"() : () -> (tensor<f32>, tensor<f32>, tensor<f32>, f32, tensor<f32>) + return %0#4 : tensor<f32> +} +