Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 1 | ; TODO(andydavis) Resolve relative path issue w.r.t invoking mlir-opt in RUN |
| 2 | ; statements (perhaps through using lit config substitutions). |
| 3 | ; |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 4 | ; RUN: %S/../../mlir-opt %s -o - -check-parser-errors |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 5 | |
| 6 | ; Check different error cases. |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 7 | ; ----- |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 8 | |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 9 | extfunc @illegaltype(i42) ; expected-error {{expected type}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 10 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 11 | ; ----- |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 12 | |
| 13 | extfunc @nestedtensor(tensor<tensor<i8>>) -> () ; expected-error {{expected type}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 14 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 15 | ; ----- |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 16 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 17 | cfgfunc @foo() |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 18 | cfgfunc @bar() ; expected-error {{expected '{' in CFG function}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 19 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 20 | ; ----- |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 21 | |
| 22 | extfunc missingsigil() -> (i1, int, f32) ; expected-error {{expected a function identifier like}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 23 | |
| 24 | |
| 25 | ; ----- |
| 26 | |
| 27 | cfgfunc @bad_branch() { |
| 28 | bb42: |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 29 | br missing ; expected-error {{reference to an undefined basic block 'missing'}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | ; ----- |
| 33 | |
| 34 | cfgfunc @block_redef() { |
| 35 | bb42: |
| 36 | return |
Jacques Pienaar | ca4c4a0 | 2018-06-25 08:10:46 -0700 | [diff] [blame] | 37 | bb42: ; expected-error {{redefinition of block 'bb42'}} |
| 38 | return |
| 39 | } |
| 40 | |
| 41 | ; ----- |
| 42 | |
| 43 | cfgfunc @no_terminator() { |
| 44 | bb40: |
| 45 | return |
| 46 | bb41: |
| 47 | bb42: ; expected-error {{expected terminator}} |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame] | 48 | return |
| 49 | } |