1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
Before:
runtime! ale_linters/llvm/llc.vim
After:
call ale#linter#Reset()
Execute(llc handler should parse errors output for STDIN):
AssertEqual
\ [
\ {
\ 'lnum': 10,
\ 'col': 7,
\ 'text': "error: value doesn't match function result type 'i32'",
\ 'type': 'E',
\ },
\ {
\ 'lnum': 10,
\ 'col': 13,
\ 'text': "error: use of undefined value '@foo'",
\ 'type': 'E',
\ },
\ ],
\ ale_linters#llvm#llc#HandleErrors(bufnr(''), [
\ "llc: <stdin>:10:7: error: value doesn't match function result type 'i32'",
\ 'ret i64 0',
\ ' ^',
\ '',
\ "llc: <stdin>:10:13: error: use of undefined value '@foo'",
\ 'call void @foo(i64 %0)',
\ ' ^',
\ ])
Execute(llc handler should parse errors output for some file):
call ale#test#SetFilename('test.ll')
AssertEqual
\ [
\ {
\ 'lnum': 10,
\ 'col': 7,
\ 'text': "error: value doesn't match function result type 'i32'",
\ 'type': 'E',
\ },
\ {
\ 'lnum': 10,
\ 'col': 13,
\ 'text': "error: use of undefined value '@foo'",
\ 'type': 'E',
\ },
\ ],
\ ale_linters#llvm#llc#HandleErrors(bufnr(''), [
\ "llc: /path/to/test.ll:10:7: error: value doesn't match function result type 'i32'",
\ 'ret i64 0',
\ ' ^',
\ '',
\ "llc: /path/to/test.ll:10:13: error: use of undefined value '@foo'",
\ 'call void @foo(i64 %0)',
\ ' ^',
\ ])
|