blob: e572fa2e81877acf772207761eaf16d2477620a3 [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;
4; RUN: %S/../../mlir-opt %s -o - -check-parser-errors 2>&1 | FileCheck %s
5
6; Check different error cases.
7; TODO(jpienaar): This is checking the errors by simplify verifying the output.
8; -----
Chris Lattnerf6d80a02018-06-24 11:18:29 -07009
Jacques Pienaarbae40512018-06-24 09:10:36 -070010; CHECK: expected type
11; CHECK-NEXT: illegaltype
12extfunc @illegaltype(i42)
Chris Lattnerf6d80a02018-06-24 11:18:29 -070013
Jacques Pienaarbae40512018-06-24 09:10:36 -070014; -----
15; CHECK: expected type
16; CHECK-NEXT: nestedtensor
17extfunc @nestedtensor(tensor<tensor<i8>>) -> ()
Chris Lattnerf6d80a02018-06-24 11:18:29 -070018
Jacques Pienaarbae40512018-06-24 09:10:36 -070019; -----
20; CHECK: expected '{' in CFG function
21cfgfunc @foo()
22cfgfunc @bar()
Chris Lattnerf6d80a02018-06-24 11:18:29 -070023
Jacques Pienaarbae40512018-06-24 09:10:36 -070024; -----
25; CHECK: expected a function identifier like
26; CHECK-NEXT: missingsigil
27extfunc missingsigil() -> (i1, int, f32)
Chris Lattnerf6d80a02018-06-24 11:18:29 -070028
29
30; -----
31
32cfgfunc @bad_branch() {
33bb42:
34 br missing ; CHECK: error: reference to an undefined basic block 'missing'
35}
36
37; -----
38
39cfgfunc @block_redef() {
40bb42:
41 return
42bb42: ; CHECK: error: redefinition of block 'bb42'
43 return
44}