llvm-capstone/mlir/test/IR/test-func-insert-arg.mlir
Christian Sigg fce529fc6e Fix insertFunctionArguments() block argument order.
Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D113171
2021-11-05 10:08:20 +01:00

50 lines
1.1 KiB
MLIR

// RUN: mlir-opt %s -test-func-insert-arg -split-input-file | FileCheck %s
// CHECK: func @f(%arg0: i1 {test.A})
func @f() attributes {test.insert_args = [
[0, i1, {test.A}]]} {
return
}
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B})
func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
[0, i1, {test.A}]]} {
return
}
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B})
func @f(%arg0: i1 {test.A}) attributes {test.insert_args = [
[1, i2, {test.B}]]} {
return
}
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i1 {test.A}, %arg1: i3 {test.C}) attributes {test.insert_args = [
[1, i2, {test.B}]]} {
return
}
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i2 {test.B}) attributes {test.insert_args = [
[0, i1, {test.A}],
[1, i3, {test.C}]]} {
return
}
// -----
// CHECK: func @f(%arg0: i1 {test.A}, %arg1: i2 {test.B}, %arg2: i3 {test.C})
func @f(%arg0: i3 {test.C}) attributes {test.insert_args = [
[0, i1, {test.A}],
[0, i2, {test.B}]]} {
return
}