comparison mlir/test/IR/invalid-func-op.mlir @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
comparison
equal deleted inserted replaced
147:c2174574ed3a 150:1d019706d866
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
2
3 // -----
4
5 func @func_op() {
6 // expected-error@+1 {{expected valid '@'-identifier for symbol name}}
7 func missingsigil() -> (i1, index, f32)
8 return
9 }
10
11 // -----
12
13 func @func_op() {
14 // expected-error@+1 {{expected type instead of SSA identifier}}
15 func @mixed_named_arguments(f32, %a : i32) {
16 return
17 }
18 return
19 }
20
21 // -----
22
23 func @func_op() {
24 // expected-error@+1 {{expected SSA identifier}}
25 func @mixed_named_arguments(%a : i32, f32) -> () {
26 return
27 }
28 return
29 }
30
31 // -----
32
33 func @func_op() {
34 // expected-error@+1 {{entry block must have 1 arguments to match function signature}}
35 func @mixed_named_arguments(f32) {
36 ^entry:
37 return
38 }
39 return
40 }
41
42 // -----
43
44 func @func_op() {
45 // expected-error@+1 {{type of entry block argument #0('i32') must match the type of the corresponding argument in function signature('f32')}}
46 func @mixed_named_arguments(f32) {
47 ^entry(%arg : i32):
48 return
49 }
50 return
51 }
52
53 // -----
54
55 // expected-error@+1 {{expected non-function type}}
56 func @f() -> (foo
57
58 // -----
59
60 // expected-error@+1 {{expected attribute name}}
61 func @f() -> (i1 {)
62
63 // -----
64
65 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
66 func @f(%arg0: i64 {test.invalid_attr}) {
67 return
68 }
69
70 // -----
71
72 // expected-error@+1 {{invalid to use 'test.invalid_attr'}}
73 func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
74 return %arg0 : i64
75 }