blob: d742b6b0cfe33b0577b39d5307bef0d05fdfd78b [file] [log] [blame]
Jacques Pienaarbae40512018-06-24 09:10:36 -07001; TODO(andydavis) Resolve relative path issue w.r.t invoking mlir-opt in RUN
2; statements (perhaps through using lit config substitutions).
3;
Jacques Pienaarca4c4a02018-06-25 08:10:46 -07004; RUN: %S/../../mlir-opt %s -o - -check-parser-errors
Jacques Pienaarbae40512018-06-24 09:10:36 -07005
6; Check different error cases.
Jacques Pienaarbae40512018-06-24 09:10:36 -07007; -----
Chris Lattnerf6d80a02018-06-24 11:18:29 -07008
Jacques Pienaarca4c4a02018-06-25 08:10:46 -07009extfunc @illegaltype(i42) ; expected-error {{expected type}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070010
Jacques Pienaarbae40512018-06-24 09:10:36 -070011; -----
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070012
13extfunc @nestedtensor(tensor<tensor<i8>>) -> () ; expected-error {{expected type}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070014
Jacques Pienaarbae40512018-06-24 09:10:36 -070015; -----
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070016
Jacques Pienaarbae40512018-06-24 09:10:36 -070017cfgfunc @foo()
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070018cfgfunc @bar() ; expected-error {{expected '{' in CFG function}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070019
Jacques Pienaarbae40512018-06-24 09:10:36 -070020; -----
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070021
22extfunc missingsigil() -> (i1, int, f32) ; expected-error {{expected a function identifier like}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070023
24
25; -----
26
27cfgfunc @bad_branch() {
28bb42:
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070029 br missing ; expected-error {{reference to an undefined basic block 'missing'}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070030}
31
32; -----
33
34cfgfunc @block_redef() {
35bb42:
36 return
Jacques Pienaarca4c4a02018-06-25 08:10:46 -070037bb42: ; expected-error {{redefinition of block 'bb42'}}
38 return
39}
40
41; -----
42
43cfgfunc @no_terminator() {
44bb40:
45 return
46bb41:
47bb42: ; expected-error {{expected terminator}}
Chris Lattnerf6d80a02018-06-24 11:18:29 -070048 return
49}