summaryrefslogtreecommitdiff
path: root/test/handler/test_llc_handler.vader
diff options
context:
space:
mode:
authorLinda_pp <rhysd@users.noreply.github.com>2017-10-10 18:13:09 +0900
committerw0rp <w0rp@users.noreply.github.com>2017-10-10 10:13:09 +0100
commit70177480ba1f9968409709442fc4be4e9a69d564 (patch)
treeea1971f3903f98831d4868e2ef2f54a3c79064a9 /test/handler/test_llc_handler.vader
parenta809c4fa3a781af7401d2f11ee5155caef081457 (diff)
downloadale-70177480ba1f9968409709442fc4be4e9a69d564.zip
Add llc integration for LLVM IR (#979)
Check LLVM IR with llc
Diffstat (limited to 'test/handler/test_llc_handler.vader')
-rw-r--r--test/handler/test_llc_handler.vader56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/handler/test_llc_handler.vader b/test/handler/test_llc_handler.vader
new file mode 100644
index 00000000..edea2337
--- /dev/null
+++ b/test/handler/test_llc_handler.vader
@@ -0,0 +1,56 @@
+Before:
+ runtime! ale_linters/llvm/llc.vim
+
+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)',
+ \ ' ^',
+ \ ])
+