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 | ; |
| 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 Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame^] | 9 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 10 | ; CHECK: expected type |
| 11 | ; CHECK-NEXT: illegaltype |
| 12 | extfunc @illegaltype(i42) |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame^] | 13 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 14 | ; ----- |
| 15 | ; CHECK: expected type |
| 16 | ; CHECK-NEXT: nestedtensor |
| 17 | extfunc @nestedtensor(tensor<tensor<i8>>) -> () |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame^] | 18 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 19 | ; ----- |
| 20 | ; CHECK: expected '{' in CFG function |
| 21 | cfgfunc @foo() |
| 22 | cfgfunc @bar() |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame^] | 23 | |
Jacques Pienaar | bae4051 | 2018-06-24 09:10:36 -0700 | [diff] [blame] | 24 | ; ----- |
| 25 | ; CHECK: expected a function identifier like |
| 26 | ; CHECK-NEXT: missingsigil |
| 27 | extfunc missingsigil() -> (i1, int, f32) |
Chris Lattner | f6d80a0 | 2018-06-24 11:18:29 -0700 | [diff] [blame^] | 28 | |
| 29 | |
| 30 | ; ----- |
| 31 | |
| 32 | cfgfunc @bad_branch() { |
| 33 | bb42: |
| 34 | br missing ; CHECK: error: reference to an undefined basic block 'missing' |
| 35 | } |
| 36 | |
| 37 | ; ----- |
| 38 | |
| 39 | cfgfunc @block_redef() { |
| 40 | bb42: |
| 41 | return |
| 42 | bb42: ; CHECK: error: redefinition of block 'bb42' |
| 43 | return |
| 44 | } |