[mlir][sparse] implement non-permutation MapRef encoding (#69406)
[llvm-project.git] / clang-tools-extra / clangd / test / diagnostics-tidy.test
bloba100c9f4359d10810717c3cb3b7391806f38cb40
1 # REQUIRES: clangd-tidy-checks
2 # RUN: clangd -lit-test -clang-tidy-checks=bugprone-sizeof-expression < %s | FileCheck -strict-whitespace %s
3 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
4 ---
5 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","text":"int main() {\n(void)sizeof(42);\n}"}}}
6 #      CHECK:  "method": "textDocument/publishDiagnostics",
7 # CHECK-NEXT:  "params": {
8 # CHECK-NEXT:    "diagnostics": [
9 # CHECK-NEXT:      {
10 # CHECK-NEXT:        "code": "bugprone-sizeof-expression",
11 # CHECK-NEXT:        "codeDescription": {
12 # CHECK-NEXT:          "href": "https://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-expression.html"
13 # CHECK-NEXT:        },
14 # CHECK-NEXT:        "message": "Suspicious usage of 'sizeof(K)'; did you mean 'K'?",
15 # CHECK-NEXT:        "range": {
16 # CHECK-NEXT:          "end": {
17 # CHECK-NEXT:            "character": 12,
18 # CHECK-NEXT:            "line": 1
19 # CHECK-NEXT:          },
20 # CHECK-NEXT:          "start": {
21 # CHECK-NEXT:            "character": 6,
22 # CHECK-NEXT:            "line": 1
23 # CHECK-NEXT:          }
24 # CHECK-NEXT:        },
25 # CHECK-NEXT:        "severity": 2,
26 # CHECK-NEXT:        "source": "clang-tidy"
27 # CHECK-NEXT:      }
28 # CHECK-NEXT:    ],
29 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c",
30 # CHECK-NEXT:    "version": 0
31 # CHECK-NEXT:  }
32 ---
33 {"jsonrpc":"2.0","id":2,"method":"sync","params":null}
34 ---
35 {"jsonrpc":"2.0","method":"textDocument/didClose","params":{"textDocument":{"uri":"test:///foo.c"}}}
36 #      CHECK:  "method": "textDocument/publishDiagnostics",
37 # CHECK-NEXT:  "params": {
38 # CHECK-NEXT:    "diagnostics": [],
39 # CHECK-NEXT:    "uri": "file://{{.*}}/foo.c"
40 # CHECK-NEXT:  }
41 ---
42 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
43 ---
44 {"jsonrpc":"2.0","method":"exit"}