1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
6 // expected-error@+1 {{expected valid '@'-identifier for symbol name}}
7 builtin.func missingsigil() -> (i1, index, f32)
14 // expected-error@+1 {{expected type instead of SSA identifier}}
15 builtin.func @mixed_named_arguments(f32, %a : i32) {
24 // expected-error@+1 {{expected SSA identifier}}
25 builtin.func @mixed_named_arguments(%a : i32, f32) -> () {
34 // expected-error@+1 {{entry block must have 1 arguments to match function signature}}
35 builtin.func @mixed_named_arguments(f32) {
45 // expected-error@+1 {{type of entry block argument #0('i32') must match the type of the corresponding argument in function signature('f32')}}
46 builtin.func @mixed_named_arguments(f32) {
55 // expected-error@+1 {{expected non-function type}}
60 // expected-error@+1 {{expected attribute name}}
65 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
66 func @f(%arg0: i64 {test.invalid_attr}) {
72 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
73 func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
79 // expected-error@+1 {{symbol declaration cannot have public visibility}}
80 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 @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 private @invalid_symbol_name_attr() attributes { sym_name = "x" }
94 // expected-error@+1 {{'type' is an inferred attribute and should not be specified in the explicit attribute dictionary}}
95 func private @invalid_symbol_type_attr() attributes { type = "x" }
99 // expected-error@+1 {{argument attribute array `arg_attrs` to have the same number of elements as the number of function arguments}}
100 func private @invalid_arg_attrs() attributes { arg_attrs = [{}] }
104 // expected-error@+1 {{expects argument attribute dictionary to be a DictionaryAttr, but got `10 : i64`}}
105 func private @invalid_arg_attrs(i32) attributes { arg_attrs = [10] }
109 // expected-error@+1 {{result attribute array `res_attrs` to have the same number of elements as the number of function results}}
110 func private @invalid_res_attrs() attributes { res_attrs = [{}] }
114 // expected-error@+1 {{expects result attribute dictionary to be a DictionaryAttr, but got `10 : i64`}}
115 func private @invalid_res_attrs() -> i32 attributes { res_attrs = [10] }