mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
b7382ed3fe
- Extend the Symbol interface with `isDeclaration` to identify operations that declare a symbol as opposed to define it. - Extend verification to disallow public declarations as per the discussion in https://llvm.discourse.group/t/rfc-symbol-definition-declaration-x-visibility-checks/2140 - Adopt the new interface for `FuncOp` and fix test and code to not have/create public function declarations. Differential Revision: https://reviews.llvm.org/D91456
69 lines
1.4 KiB
MLIR
69 lines
1.4 KiB
MLIR
// RUN: mlir-opt %s -test-func-erase-result -split-input-file | FileCheck %s
|
|
|
|
// CHECK: func private @f(){{$}}
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (f32 {test.erase_this_result})
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (f32 {test.A})
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
f32 {test.erase_this_result},
|
|
f32 {test.A}
|
|
)
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (f32 {test.A})
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
f32 {test.A},
|
|
f32 {test.erase_this_result}
|
|
)
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
f32 {test.A},
|
|
f32 {test.erase_this_result},
|
|
f32 {test.B}
|
|
)
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B})
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
f32 {test.A},
|
|
f32 {test.erase_this_result},
|
|
f32 {test.erase_this_result},
|
|
f32 {test.B}
|
|
)
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C})
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
f32 {test.A},
|
|
f32 {test.erase_this_result},
|
|
f32 {test.B},
|
|
f32 {test.erase_this_result},
|
|
f32 {test.C}
|
|
)
|
|
|
|
// -----
|
|
|
|
// CHECK: func private @f() -> (tensor<1xf32>, tensor<2xf32>, tensor<3xf32>)
|
|
// CHECK-NOT: attributes{{.*}}result
|
|
func private @f() -> (
|
|
tensor<1xf32>,
|
|
f32 {test.erase_this_result},
|
|
tensor<2xf32>,
|
|
f32 {test.erase_this_result},
|
|
tensor<3xf32>
|
|
)
|