summaryrefslogtreecommitdiff
path: root/test/handler/test_ispc_ispc_handler.vader
blob: 619773fe910c5e247fdb1b0cb69d8a946f69c156 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Before:
  runtime ale_linters/ispc/ispc.vim

After:
  call ale#linter#Reset()

Execute(The ispc handler should parse input correctly):
  AssertEqual
  \ [
  \   {
  \     'bufnr': 0,
  \     'lnum': 33,
  \     'col': 14,
  \     'type': 'E',
  \     'text': 'syntax error, unexpected ''int'', expecting '','' or '';''.',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 36,
  \     'col': 5,
  \     'type': 'E',
  \     'text': 'syntax error, unexpected ''for''.',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 51,
  \     'col': 9,
  \     'type': 'E',
  \     'text': '''foobar.h'' file not found',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 79,
  \     'col': 52,
  \     'type': 'W',
  \     'text': 'Modulus operator with varying types is very inefficient.',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 85,
  \     'col': 13,
  \     'type': 'W',
  \     'text': 'Undefined behavior: all program instances are writing to the same location!',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 93,
  \     'col': 19,
  \     'type': 'W',
  \     'text': 'Gather required to load value.',
  \   },
  \   {
  \     'bufnr': 0,
  \     'lnum': 93,
  \     'col': 9,
  \     'type': 'W',
  \     'text': 'Scatter required to store value.',
  \   },
  \ ],
  \ ale_linters#ispc#ispc#Handle(0, [
  \   'Warning: No output file or header file name specified. Program will be compiled and warnings/errors will be issued, but no output will be generated. ',
  \   'Warning: No --target specified on command-line. Using default system target "avx2-i32x8".',
  \   'mandelbrot.ispc:33:14: Error: syntax error, unexpected ''int'', expecting '','' or '';''.',
  \   'static iline int mandel(float c_re, float c_im, int count) {',
  \   '             ^^^',
  \   '',
  \   'mandelbrot.ispc:36:5: Error: syntax error, unexpected ''for''.',
  \   '    for (i = 0; i < count; ++i) {',
  \   '    ^^^',
  \   '',
  \   'mandelbrot.ispc:51:9: fatal error: ''foobar.h'' file not found',
  \   '#include<foobar.h>',
  \   '        ^~~~~~~~~~',
  \   'mandelbrot.ispc:79:52: Performance Warning: Modulus operator with varying types is very inefficient.',
  \   '                double x = x0 + i * (dx + epsilon*(k%2)*delta);',
  \   '                                                   ^^^',
  \   '',
  \   'mandelbrot.ispc:85:13: Warning: Undefined behavior: all program instances are writing to the same location!',
  \   '            output[index] = (NNN) / sample_size;',
  \   '            ^^^^^^^^^^^^^',
  \   '',
  \   'mandelbrot.ispc:93:19: Performance Warning: Gather required to load value.',
  \   '        A[i*8] *= A[i*8];',
  \   '                  ^^^^^^',
  \   '',
  \   'mandelbrot.ispc:93:9: Performance Warning: Scatter required to store value.',
  \   '        A[i*8] *= A[i*8];',
  \   '        ^^^^^^',
  \   '',
  \ ])