2019-06-20 02:21:41 +08:00
|
|
|
// RUN: mlir-opt %s -split-input-file -verify-diagnostics
|
2019-06-04 03:08:22 +08:00
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @func_op() {
|
2019-11-14 01:31:45 +08:00
|
|
|
// expected-error@+1 {{expected valid '@'-identifier for symbol name}}
|
2019-06-04 03:08:22 +08:00
|
|
|
func missingsigil() -> (i1, index, f32)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @func_op() {
|
|
|
|
// expected-error@+1 {{expected type instead of SSA identifier}}
|
|
|
|
func @mixed_named_arguments(f32, %a : i32) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @func_op() {
|
|
|
|
// expected-error@+1 {{expected SSA identifier}}
|
|
|
|
func @mixed_named_arguments(%a : i32, f32) -> () {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
2019-06-06 09:12:16 +08:00
|
|
|
func @func_op() {
|
|
|
|
// expected-error@+1 {{entry block must have 1 arguments to match function signature}}
|
|
|
|
func @mixed_named_arguments(f32) {
|
|
|
|
^entry:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
func @func_op() {
|
|
|
|
// expected-error@+1 {{type of entry block argument #0('i32') must match the type of the corresponding argument in function signature('f32')}}
|
|
|
|
func @mixed_named_arguments(f32) {
|
|
|
|
^entry(%arg : i32):
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
2019-10-19 07:02:56 +08:00
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
// expected-error@+1 {{expected non-function type}}
|
|
|
|
func @f() -> (foo
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
// expected-error@+1 {{expected attribute name}}
|
|
|
|
func @f() -> (i1 {)
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
// expected-error@+1 {{invalid to use 'test.invalid_attr'}}
|
|
|
|
func @f(%arg0: i64 {test.invalid_attr}) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----
|
|
|
|
|
|
|
|
// expected-error@+1 {{invalid to use 'test.invalid_attr'}}
|
|
|
|
func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
|
|
|
|
return %arg0 : i64
|
|
|
|
}
|