1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
6 // expected-error@+1 {{expected valid '@'-identifier for symbol name}}
7 func.func missingsigil() -> (i1, index, f32)
13 func.func @func_op() {
14 // expected-error@+1 {{expected type instead of SSA identifier}}
15 func.func @mixed_named_arguments(f32, %a : i32) {
23 func.func @func_op() {
24 // expected-error@+1 {{expected SSA identifier}}
25 func.func @mixed_named_arguments(%a : i32, f32) -> () {
33 func.func @func_op() {
34 // expected-error@+1 {{op symbol's parent must have the SymbolTable trait}}
35 func.func @mixed_named_arguments(f32) {
44 func.func @func_op() {
45 // expected-error@+1 {{op symbol's parent must have the SymbolTable trait}}
46 func.func @mixed_named_arguments(f32) {
55 // expected-error@+1 {{expected non-function type}}
56 func.func @f() -> (foo
60 // expected-error@+1 {{expected attribute name}}
61 func.func @f() -> (i1 {)
65 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
66 func.func @f(%arg0: i64 {test.invalid_attr}) {
72 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
73 func.func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
79 // expected-error@+1 {{symbol declaration cannot have public visibility}}
80 func.func @invalid_public_declaration()
84 // expected-error@+1 {{'sym_visibility' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
85 func.func @legacy_visibility_syntax() attributes { sym_visibility = "private" }
89 // expected-error@+1 {{'sym_name' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
90 func.func private @invalid_symbol_name_attr() attributes { sym_name = "x" }
94 // expected-error@+1 {{'function_type' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
95 func.func private @invalid_symbol_type_attr() attributes { function_type = "x" }
99 // expected-error@+1 {{argument attribute array to have the same number of elements as the number of function arguments}}
100 func.func private @invalid_arg_attrs() attributes { arg_attrs = [{}] }
105 // expected-error@+1 {{result attribute array to have the same number of elements as the number of function results}}
106 func.func private @invalid_res_attrs() attributes { res_attrs = [{}] }